Class GanttChartNumericXAxis
java.lang.Object
com.amalgamasimulation.charts.axes.AbstractAxis<Number>
com.amalgamasimulation.charts.axes.GanttChartNumericXAxis
- All Implemented Interfaces:
IAxisTitlePropertyOwner<Number>,ICurrentValuePropertyOwner,IDiscretizationPropertyOwner,IDisplayedRangeAutoScrollPropertyOwner,IGetDisplayedRangePropertyOwner,INumericStylePropertyOwner,IScrollBarPropertyOwner,ISetNumericDisplayedRangePropertyOwner,IValueInRangePropertyOwner,IZeroGridLinePropertyOwner
public class GanttChartNumericXAxis
extends AbstractAxis<Number>
implements IScrollBarPropertyOwner, ISetNumericDisplayedRangePropertyOwner, INumericStylePropertyOwner, IValueInRangePropertyOwner, IDisplayedRangeAutoScrollPropertyOwner, IZeroGridLinePropertyOwner, IAxisTitlePropertyOwner<Number>, IDiscretizationPropertyOwner
Class that represents an X-axis drawn on a
NumericGanttChart area. It
holds properties for ticks and labels along the axis. The X-axis tick labels
represents the numeric arguments of the visual set data elements. This axis
does allow ranging, zoom or pan operations.- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.GanttChartInternalprotected com.amalgamasimulation.charts.internals.axes.NumericXAxisInternal -
Constructor Summary
ConstructorsConstructorDescriptionGanttChartNumericXAxis(com.amalgamasimulation.charts.internals.charts.GanttChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.NumericXAxisInternal xAxisInternal) Constructs aGanttChartInternalX-axis with givenNumericXAxisInternal -
Method Summary
Modifier and TypeMethodDescriptionaddDisplayedRangeChangeHandler(BiConsumer<Double, Double> handler) Adds the action to be executed every time the displayed range changed.adjustDisplayRange(boolean adjustToFirstNonZeroElement) Sets the minimum and maximum displayed values equal to the minimum and maximum values in the chart contents.Clear all the displayed range changed actions.protected com.amalgamasimulation.charts.internals.axes.NumericXAxisInternalprotected com.amalgamasimulation.charts.internals.charts.GanttChartInternaldoubleReturns this axis current value.javafx.scene.paint.ColorReturns the color of the current value guideline.doubleReturns the width of the current value guideline, in pixels.Returns the currently displayed values range of axis.doubleReturns the maximum size of displayed values range of axis.doubleReturns the minimum size of displayed values range of axis.doublegetTitle()Returns the title of this axis, ornullif title has not been specified.javafx.scene.paint.ColorReturns the color of this axis title.javafx.scene.text.FontReturns the font of this axis title.intReturns the font size of this axis title.javafx.scene.paint.ColorReturns the color of the zero grid line.intReturns the width of the zero grid line, in pixels.booleanChecks if the current value guideline is visible.booleanChecks if displayed range is auto-scrolled during setting new values to any of the displayed visual sets.booleanChecks whether the displayed values range can be changed.booleanChecks whether the scrollbar is currently displayed.booleanChecks whether the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible.booleanChecks whether this axis title should be drawn.booleanisValueDisplayed(double value) Checks whether the value is displayed on this axis.booleanChecks whether the zero grid line is visible.Removes the displayed range changed action.setCurrentValue(Supplier<Double> currentValue) Sets this axis current value.Sets the color of the current value guideline.setCurrentValueGuidelineColor(javafx.scene.paint.Color color) Sets the color of the current value guideline.setCurrentValueGuidelineVisible(boolean currentArgumentLineVisible) Specifies whether the current value guideline should be drawn.setCurrentValueGuidelineWidth(double width) Sets the width of the current value guideline, in pixels.setDisplayedRange(double minValue, double maxValue) Sets the currently displayed values range of axis.setDisplayedRangeAutoScrollEnabled(boolean enabled) Specifies whether the displayed range is auto-scrolled during setting new values to any of the displayed visual sets.setDisplayedRangeChangeDisabled(double displayedRangeSize) Specifies the displayed values range cannot be changed.Specifies the displayed values range can be changed.setDisplayedRangeMaxSize(double minSize) Sets the maximum size of displayed values range of axis.setDisplayedRangeMinSize(double minSize) Sets the minimum size of displayed values range of axis.Resets displayed range to default values.setLabelsFormat(Function<Double, String> format) Sets the formatter to axis labels, i.e.setNumericStyle(AxisNumericStyle style) Sets theAxisNumericStylethat specifies the formatting and ticks details for axis in case it shows numeric values.setScrollBarVisible(boolean visible) Specifies whether the scrollbar should be drawn if scrolling the displayed rang of axis is possible.Sets the new title to this axis.setTitleColor(Color color) Sets the new color to this axis title.setTitleColor(javafx.scene.paint.Color color) Sets the new color to this axis title.setTitleFont(javafx.scene.text.Font font) Sets the new font to this axis title.setTitleFontSize(int fontSize) Sets the new font size to this axis title.setTitleVisible(boolean visible) Specifies whether this axis title should be drawn.setZeroGridLineColor(Color color) Sets the new color to the zero grid line of this chart.setZeroGridLineColor(javafx.scene.paint.Color color) Sets the new color to the zero grid line of this chart.setZeroGridLineVisible(boolean visible) Specifies whether the zero grid line should be drawn.setZeroGridLineWidth(int width) Sets the new width to the zero grid line of this chart, in pixels.Methods inherited from class com.amalgamasimulation.charts.axes.AbstractAxis
getLabelsColor, getLabelsFont, getLabelsFontSize, setGridLinesColor, setGridLinesColor, setGridLinesVisible, setGridLinesWidth, setLabelsColor, setLabelsColor, setLabelsFont, setLabelsFontSizeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.amalgamasimulation.charts.axes.IDiscretizationPropertyOwner
getPixelsPerChronoUnit
-
Field Details
-
chartInternal
protected com.amalgamasimulation.charts.internals.charts.GanttChartInternal chartInternal -
xAxisInternal
protected com.amalgamasimulation.charts.internals.axes.NumericXAxisInternal xAxisInternal
-
-
Constructor Details
-
GanttChartNumericXAxis
public GanttChartNumericXAxis(com.amalgamasimulation.charts.internals.charts.GanttChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.NumericXAxisInternal xAxisInternal) Constructs aGanttChartInternalX-axis with givenNumericXAxisInternal- Parameters:
chartInternal-GanttChartInternalwhich is the owner of this objectxAxisInternal-NumericXAxisInternalwhich is the internal axis logic aggregator
-
-
Method Details
-
getChartInternal
protected com.amalgamasimulation.charts.internals.charts.GanttChartInternal getChartInternal()- Specified by:
getChartInternalin classAbstractAxis<Number>
-
getAxisInternal
protected com.amalgamasimulation.charts.internals.axes.NumericXAxisInternal getAxisInternal()- Specified by:
getAxisInternalin classAbstractAxis<Number>
-
getLengthInPixels
public double getLengthInPixels()- Specified by:
getLengthInPixelsin interfaceIDiscretizationPropertyOwner
-
getDisplayedRange
Description copied from interface:IGetDisplayedRangePropertyOwnerReturns the currently displayed values range of axis.- Specified by:
getDisplayedRangein interfaceIGetDisplayedRangePropertyOwner- Returns:
- the pair contains minimum and maximum values of the currently displayed range
-
setNumericStyle
Description copied from interface:INumericStylePropertyOwnerSets theAxisNumericStylethat specifies the formatting and ticks details for axis in case it shows numeric values.- Specified by:
setNumericStylein interfaceINumericStylePropertyOwner- Parameters:
style- newAxisNumericStylethat specifies the formatting and ticks details for axis in case it shows numeric values- Returns:
- reference to this object
-
setScrollBarVisible
Description copied from interface:IScrollBarPropertyOwnerSpecifies whether the scrollbar should be drawn if scrolling the displayed rang of axis is possible. True by default. If set to false, the scrollbar will never be drawn but the functionality of scrolling this axis will still remain. Redraws this axis and it's parent chart if visibility is changed.- Specified by:
setScrollBarVisiblein interfaceIScrollBarPropertyOwner- Parameters:
visible- flag setting if the scrollbar should be drawn if scrolling the displayed rang of axis is possible- Returns:
- reference to this object
- See Also:
-
isScrollBarVisible
public boolean isScrollBarVisible()Description copied from interface:IScrollBarPropertyOwnerChecks whether the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible.- Specified by:
isScrollBarVisiblein interfaceIScrollBarPropertyOwner- Returns:
trueif the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible,falseotherwise
-
isScrollBarDisplayed
public boolean isScrollBarDisplayed()Description copied from interface:IScrollBarPropertyOwnerChecks whether the scrollbar is currently displayed.- Specified by:
isScrollBarDisplayedin interfaceIScrollBarPropertyOwner- Returns:
trueif the scrollbar is currently displayed,falseotherwise
-
setDisplayedRangeMinSize
Description copied from interface:ISetNumericDisplayedRangePropertyOwnerSets the minimum size of displayed values range of axis. 0 by default. This size limits the users' ability to scale the range of axis down.- Specified by:
setDisplayedRangeMinSizein interfaceISetNumericDisplayedRangePropertyOwner- Parameters:
minSize- new minimum size of displayed values range of axis- Returns:
- reference to this object
-
setDisplayedRangeMaxSize
Description copied from interface:ISetNumericDisplayedRangePropertyOwnerSets the maximum size of displayed values range of axis. Maximum is not limited by default. This size limits the users' ability to scale the range of axis up.- Specified by:
setDisplayedRangeMaxSizein interfaceISetNumericDisplayedRangePropertyOwner- Parameters:
minSize- new maximum size of displayed values range of axis- Returns:
- reference to this object
-
getDisplayedRangeMinSize
public double getDisplayedRangeMinSize()Description copied from interface:ISetNumericDisplayedRangePropertyOwnerReturns the minimum size of displayed values range of axis.- Specified by:
getDisplayedRangeMinSizein interfaceISetNumericDisplayedRangePropertyOwner- Returns:
- the minimum size of displayed values range of axis
-
getDisplayedRangeMaxSize
public double getDisplayedRangeMaxSize()Description copied from interface:ISetNumericDisplayedRangePropertyOwnerReturns the maximum size of displayed values range of axis.- Specified by:
getDisplayedRangeMaxSizein interfaceISetNumericDisplayedRangePropertyOwner- Returns:
- the maximum size of displayed values range of axis
-
setDisplayedRange
Description copied from interface:ISetNumericDisplayedRangePropertyOwnerSets the currently displayed values range of axis. Scrolls and scales the axis accordingly and redraws the chart.- Specified by:
setDisplayedRangein interfaceISetNumericDisplayedRangePropertyOwner- Parameters:
minValue- new displayed range minimum valuemaxValue- new displayed range maximum value- Returns:
- reference to this object
- See Also:
-
setDisplayedRangeChangeEnabled
Description copied from interface:ISetNumericDisplayedRangePropertyOwnerSpecifies the displayed values range can be changed.- Specified by:
setDisplayedRangeChangeEnabledin interfaceISetNumericDisplayedRangePropertyOwner- Returns:
- reference to this object
-
setDisplayedRangeChangeDisabled
Description copied from interface:ISetNumericDisplayedRangePropertyOwnerSpecifies the displayed values range cannot be changed. Displayed values range becomes equals to displayedRangeSize.- Specified by:
setDisplayedRangeChangeDisabledin interfaceISetNumericDisplayedRangePropertyOwner- Parameters:
displayedRangeSize- new fixed displayed range size- Returns:
- reference to this object
-
isDisplayedRangeChangeEnabled
public boolean isDisplayedRangeChangeEnabled()Description copied from interface:ISetNumericDisplayedRangePropertyOwnerChecks whether the displayed values range can be changed.- Specified by:
isDisplayedRangeChangeEnabledin interfaceISetNumericDisplayedRangePropertyOwner- Returns:
trueif the displayed values range can be changed,falseotherwise
-
addDisplayedRangeChangeHandler
Description copied from interface:IGetDisplayedRangePropertyOwnerAdds the action to be executed every time the displayed range changed.- Specified by:
addDisplayedRangeChangeHandlerin interfaceIGetDisplayedRangePropertyOwner- Parameters:
handler- new displayed range changed action- Returns:
- reference to this object
-
removeDisplayedRangeChangeHandler
Description copied from interface:IGetDisplayedRangePropertyOwnerRemoves the displayed range changed action.- Specified by:
removeDisplayedRangeChangeHandlerin interfaceIGetDisplayedRangePropertyOwner- Parameters:
handler- removed displayed range changed action- Returns:
- reference to this object
-
clearDisplayedRangeChangeHandler
Description copied from interface:IGetDisplayedRangePropertyOwnerClear all the displayed range changed actions.- Specified by:
clearDisplayedRangeChangeHandlerin interfaceIGetDisplayedRangePropertyOwner- Returns:
- reference to this object
-
isValueDisplayed
public boolean isValueDisplayed(double value) Description copied from interface:IValueInRangePropertyOwnerChecks whether the value is displayed on this axis.- Specified by:
isValueDisplayedin interfaceIValueInRangePropertyOwner- Parameters:
value- value to check- Returns:
trueif the value is displayed on this axis,falseotherwise
-
setDisplayedRangeAutoScrollEnabled
Description copied from interface:IDisplayedRangeAutoScrollPropertyOwnerSpecifies whether the displayed range is auto-scrolled during setting new values to any of the displayed visual sets.- Specified by:
setDisplayedRangeAutoScrollEnabledin interfaceIDisplayedRangeAutoScrollPropertyOwner- Parameters:
enabled- flag setting if the displayed range is auto-scrolled during setting new values to any of the displayed visual sets- Returns:
- reference to this object
-
isDisplayedRangeAutoScrollEnabled
public boolean isDisplayedRangeAutoScrollEnabled()Description copied from interface:IDisplayedRangeAutoScrollPropertyOwnerChecks if displayed range is auto-scrolled during setting new values to any of the displayed visual sets.- Specified by:
isDisplayedRangeAutoScrollEnabledin interfaceIDisplayedRangeAutoScrollPropertyOwner- Returns:
trueif displayed range is auto-scrolled during setting new values to any of the displayed visual sets,falseotherwise
-
setDisplayedRangeToDefault
Description copied from interface:ISetNumericDisplayedRangePropertyOwnerResets displayed range to default values. The default state is the range of data items, including the last one i.e. with zero scroll.- Specified by:
setDisplayedRangeToDefaultin interfaceISetNumericDisplayedRangePropertyOwner- Returns:
- reference to this object
-
adjustDisplayRange
Description copied from interface:ISetNumericDisplayedRangePropertyOwnerSets the minimum and maximum displayed values equal to the minimum and maximum values in the chart contents. Used to display a complete set of data within a single displayed range.- Specified by:
adjustDisplayRangein interfaceISetNumericDisplayedRangePropertyOwner- Parameters:
adjustToFirstNonZeroElement- specifies the 'left adjustment' option- Returns:
- reference to this object
-
setZeroGridLineVisible
Description copied from interface:IZeroGridLinePropertyOwnerSpecifies whether the zero grid line should be drawn. Redraws this chart if the visibility is changed.- Specified by:
setZeroGridLineVisiblein interfaceIZeroGridLinePropertyOwner- Parameters:
visible- new zero grid line visibility- Returns:
- reference to this object
- See Also:
-
setZeroGridLineColor
Description copied from interface:IZeroGridLinePropertyOwnerSets the new color to the zero grid line of this chart. Redraws this chart if color is changed.- Specified by:
setZeroGridLineColorin interfaceIZeroGridLinePropertyOwner- Parameters:
color- new zero grid line color- Returns:
- reference to this object
- See Also:
-
setZeroGridLineColor
Description copied from interface:IZeroGridLinePropertyOwnerSets the new color to the zero grid line of this chart. Redraws this chart if color is changed.- Specified by:
setZeroGridLineColorin interfaceIZeroGridLinePropertyOwner- Parameters:
color- new zero grid line color- Returns:
- reference to this object
- See Also:
-
setZeroGridLineWidth
Description copied from interface:IZeroGridLinePropertyOwnerSets the new width to the zero grid line of this chart, in pixels. Redraws this chart if width is changed.- Specified by:
setZeroGridLineWidthin interfaceIZeroGridLinePropertyOwner- Parameters:
width- new zero grid line width, in pixels- Returns:
- reference to this object
- See Also:
-
isZeroGridLineVisible
public boolean isZeroGridLineVisible()Description copied from interface:IZeroGridLinePropertyOwnerChecks whether the zero grid line is visible.- Specified by:
isZeroGridLineVisiblein interfaceIZeroGridLinePropertyOwner- Returns:
trueif zero grid line is visible,falseotherwise
-
getZeroGridLineColor
public javafx.scene.paint.Color getZeroGridLineColor()Description copied from interface:IZeroGridLinePropertyOwnerReturns the color of the zero grid line.- Specified by:
getZeroGridLineColorin interfaceIZeroGridLinePropertyOwner- Returns:
- the color of the zero grid line
-
getZeroGridLineWidth
public int getZeroGridLineWidth()Description copied from interface:IZeroGridLinePropertyOwnerReturns the width of the zero grid line, in pixels.- Specified by:
getZeroGridLineWidthin interfaceIZeroGridLinePropertyOwner- Returns:
- the width of the zero grid line, in pixels
-
getCurrentValue
public double getCurrentValue()Description copied from interface:ICurrentValuePropertyOwnerReturns this axis current value.- Specified by:
getCurrentValuein interfaceICurrentValuePropertyOwner- Returns:
- this axis current value
-
setCurrentValue
Description copied from interface:ICurrentValuePropertyOwnerSets this axis current value.- Specified by:
setCurrentValuein interfaceICurrentValuePropertyOwner- Parameters:
currentValue- new axis current value- Returns:
- reference to this object
-
setCurrentValueGuidelineVisible
Description copied from interface:ICurrentValuePropertyOwnerSpecifies whether the current value guideline should be drawn. Redraws this axis and it's parent chart if visibility is changed.- Specified by:
setCurrentValueGuidelineVisiblein interfaceICurrentValuePropertyOwner- Parameters:
currentArgumentLineVisible- new current value guideline visibility- Returns:
- reference to this object
- See Also:
-
setCurrentValueGuidelineColor
Description copied from interface:ICurrentValuePropertyOwnerSets the color of the current value guideline. Transparent and semi-transparent colors are allowed. Redraws this axis and it's parent chart if color is changed.- Specified by:
setCurrentValueGuidelineColorin interfaceICurrentValuePropertyOwner- Parameters:
color- new current value guideline color- Returns:
- reference to this object
- See Also:
-
setCurrentValueGuidelineColor
Description copied from interface:ICurrentValuePropertyOwnerSets the color of the current value guideline. Transparent and semi-transparent colors are allowed. Redraws this axis and it's parent chart if color is changed.- Specified by:
setCurrentValueGuidelineColorin interfaceICurrentValuePropertyOwner- Parameters:
color- new current value guideline color- Returns:
- reference to this object
- See Also:
-
setCurrentValueGuidelineWidth
Description copied from interface:ICurrentValuePropertyOwnerSets the width of the current value guideline, in pixels. Redraws this axis and it's parent chart if width is changed.- Specified by:
setCurrentValueGuidelineWidthin interfaceICurrentValuePropertyOwner- Parameters:
width- new current value guideline width, in pixels- Returns:
- reference to this object
- See Also:
-
getCurrentValueGuidelineColor
public javafx.scene.paint.Color getCurrentValueGuidelineColor()Description copied from interface:ICurrentValuePropertyOwnerReturns the color of the current value guideline.- Specified by:
getCurrentValueGuidelineColorin interfaceICurrentValuePropertyOwner- Returns:
- the color of the current value guideline
-
getCurrentValueGuidelineWidth
public double getCurrentValueGuidelineWidth()Description copied from interface:ICurrentValuePropertyOwnerReturns the width of the current value guideline, in pixels.- Specified by:
getCurrentValueGuidelineWidthin interfaceICurrentValuePropertyOwner- Returns:
- the width of the current value guideline, in pixels
-
setLabelsFormat
Description copied from interface:INumericStylePropertyOwnerSets the formatter to axis labels, i.e. the function that takes aDoublevalue and produces aStringthat should be drawn to represent this value.- Specified by:
setLabelsFormatin interfaceINumericStylePropertyOwner- Parameters:
format- new axis labels formatter- Returns:
- reference to this object
-
isCurrentValueGuidelineVisible
public boolean isCurrentValueGuidelineVisible()Description copied from interface:ICurrentValuePropertyOwnerChecks if the current value guideline is visible.- Specified by:
isCurrentValueGuidelineVisiblein interfaceICurrentValuePropertyOwner- Returns:
trueif the current value guideline is visible,falseotherwise
-
setTitle
Description copied from interface:IAxisTitlePropertyOwnerSets the new title to this axis. Redraws this axis and it's parent chart if title is changed.- Specified by:
setTitlein interfaceIAxisTitlePropertyOwner<Number>- Parameters:
title- new axis title- Returns:
- reference to this object
- See Also:
-
setTitleVisible
Description copied from interface:IAxisTitlePropertyOwnerSpecifies whether this axis title should be drawn. Redraws this axis and it's parent chart if visibility is changed.- Specified by:
setTitleVisiblein interfaceIAxisTitlePropertyOwner<Number>- Parameters:
visible- new axis title visibility- Returns:
- reference to this object
- See Also:
-
setTitleFont
Description copied from interface:IAxisTitlePropertyOwnerSets the new font to this axis title. Redraws this axis and it's parent chart if font is changed.- Specified by:
setTitleFontin interfaceIAxisTitlePropertyOwner<Number>- Parameters:
font- new axis title font- Returns:
- reference to this object
- See Also:
-
setTitleFontSize
Description copied from interface:IAxisTitlePropertyOwnerSets the new font size to this axis title. Redraws this axis and it's parent chart if font size is changed.- Specified by:
setTitleFontSizein interfaceIAxisTitlePropertyOwner<Number>- Parameters:
fontSize- new axis title font size- Returns:
- reference to this object
- See Also:
-
setTitleColor
Description copied from interface:IAxisTitlePropertyOwnerSets the new color to this axis title. Redraws this axis and it's parent chart if color is changed.- Specified by:
setTitleColorin interfaceIAxisTitlePropertyOwner<Number>- Parameters:
color- new axis title color- Returns:
- reference to this object
- See Also:
-
setTitleColor
Description copied from interface:IAxisTitlePropertyOwnerSets the new color to this axis title. Redraws this axis and it's parent chart if color is changed.- Specified by:
setTitleColorin interfaceIAxisTitlePropertyOwner<Number>- Parameters:
color- new axis title color- Returns:
- reference to this object
- See Also:
-
getTitleColor
public javafx.scene.paint.Color getTitleColor()Description copied from interface:IAxisTitlePropertyOwnerReturns the color of this axis title.- Specified by:
getTitleColorin interfaceIAxisTitlePropertyOwner<Number>- Returns:
- the color of this axis title
-
getTitle
Description copied from interface:IAxisTitlePropertyOwnerReturns the title of this axis, ornullif title has not been specified.- Specified by:
getTitlein interfaceIAxisTitlePropertyOwner<Number>- Returns:
- the title of this axis, or
nullif title has not been specified
-
isTitleVisible
public boolean isTitleVisible()Description copied from interface:IAxisTitlePropertyOwnerChecks whether this axis title should be drawn.- Specified by:
isTitleVisiblein interfaceIAxisTitlePropertyOwner<Number>- Returns:
trueif this axis title should be drawn,falseotherwise
-
getTitleFont
public javafx.scene.text.Font getTitleFont()Description copied from interface:IAxisTitlePropertyOwnerReturns the font of this axis title.- Specified by:
getTitleFontin interfaceIAxisTitlePropertyOwner<Number>- Returns:
- axis title font
-
getTitleFontSize
public int getTitleFontSize()Description copied from interface:IAxisTitlePropertyOwnerReturns the font size of this axis title.- Specified by:
getTitleFontSizein interfaceIAxisTitlePropertyOwner<Number>- Returns:
- the font size of this axis title
-