Class LineChartNumericYAxis
java.lang.Object
com.amalgamasimulation.charts.axes.AbstractAxis<Number>
com.amalgamasimulation.charts.axes.LineChartNumericYAxis
- All Implemented Interfaces:
IAutoAdjustmentPropertyOwner,IAxisTitlePositionPropertyOwner,IAxisTitlePropertyOwner<Number>,IGetDisplayedRangePropertyOwner,IMaxValuePropertyOwner,IMinMaxValuePropertyOwner,IMinValuePropertyOwner,INumericStylePropertyOwner,IValueInRangePropertyOwner,IZeroGridLinePropertyOwner
public class LineChartNumericYAxis
extends AbstractAxis<Number>
implements IMinMaxValuePropertyOwner, IGetDisplayedRangePropertyOwner, INumericStylePropertyOwner, IValueInRangePropertyOwner, IAutoAdjustmentPropertyOwner, IAxisTitlePropertyOwner<Number>, IZeroGridLinePropertyOwner, IAxisTitlePositionPropertyOwner
Class that represents an Y-axis drawn on a
NumericLineChart area. It
holds properties for ticks and labels along the axis. The Y-axis tick labels
represents the numeric values of the visual set data elements. This axis does
allow ranging operations.- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.LineChartInternalprotected com.amalgamasimulation.charts.internals.axes.NumericLineChartYAxisInternal -
Constructor Summary
ConstructorsConstructorDescriptionLineChartNumericYAxis(com.amalgamasimulation.charts.internals.charts.LineChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.NumericLineChartYAxisInternal yAxisInternal) Constructs aLineChartInternalX-axis with givenNumericLineChartYAxisInternal -
Method Summary
Modifier and TypeMethodDescriptionaddDisplayedRangeChangeHandler(BiConsumer<Double, Double> handler) Adds the action to be executed every time the displayed range changed.Clear all the displayed range changed actions.protected com.amalgamasimulation.charts.internals.axes.NumericLineChartYAxisInternalprotected com.amalgamasimulation.charts.internals.charts.LineChartInternalReturns the currently displayed values range of axis.doubleReturns the maximum possible value that can be displayed on axis.doubleReturns the minimum possible value that can be displayed on axis.getTitle()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.Returns theAxisTitlePositionthat specifies the the chart's title position.javafx.scene.paint.ColorReturns the color of the zero grid line.intReturns the width of the zero grid line, in pixels.booleanChecks whether the maximum value is equal to the maximum value of the currently displayed contents.booleanChecks whether the minimum value is equal to the minimum value of the currently displayed contents.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.booleanChecks whether zero is always exists in the displayed range.Removes the displayed range changed action.setDisplayedRangeMaxValueAutoAdjustmentEnabled(boolean enabled) Specifies an axis mode in which the maximum axis value is equal to the maximum value of the currently displayed contents.setDisplayedRangeMinValueAutoAdjustmentEnabled(boolean enabled) Specifies an axis mode in which the minimum axis value is equal to the minimum value of the currently displayed contents.setLabelsFormat(Function<Double, String> format) Sets the formatter to axis labels, i.e.setMaxValue(double value) Sets the maximum possible value that can be displayed on axis.setMinAdjustedDisplayedRange(double minAdjustRange) Specifies minimum axis range of the currently displayed contents.setMinValue(double value) Sets the minimum possible value that can be displayed on axis.setNumericStyle(AxisNumericStyle style) Sets theAxisNumericStylethat specifies the formatting and ticks details for axis in case it shows numeric values.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.setTitlePosition(AxisTitlePosition yAxisTitlePosition) Sets theAxisTitlePositionthat specifies the chart's title position.setTitleVisible(boolean visible) Specifies whether this axis title should be drawn.setValueLimits(double minValue, double maxValue) Convenience method, can be used instead of calling two methods setMinValue and setMaxValue.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.setZeroInDisplayedRange(boolean showZero) Specifies an axis mode in which zero value is always exists in the displayed range.Methods inherited from class com.amalgamasimulation.charts.axes.AbstractAxis
getLabelsColor, getLabelsFont, getLabelsFontSize, setGridLinesColor, setGridLinesColor, setGridLinesVisible, setGridLinesWidth, setLabelsColor, setLabelsColor, setLabelsFont, setLabelsFontSize
-
Field Details
-
chartInternal
protected com.amalgamasimulation.charts.internals.charts.LineChartInternal chartInternal -
yAxisInternal
protected com.amalgamasimulation.charts.internals.axes.NumericLineChartYAxisInternal yAxisInternal
-
-
Constructor Details
-
LineChartNumericYAxis
public LineChartNumericYAxis(com.amalgamasimulation.charts.internals.charts.LineChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.NumericLineChartYAxisInternal yAxisInternal) Constructs aLineChartInternalX-axis with givenNumericLineChartYAxisInternal- Parameters:
chartInternal-LineChartInternalwhich is the owner of this objectyAxisInternal-NumericLineChartYAxisInternalwhich is the internal axis logic aggregator
-
-
Method Details
-
getChartInternal
protected com.amalgamasimulation.charts.internals.charts.LineChartInternal getChartInternal()- Specified by:
getChartInternalin classAbstractAxis<Number>
-
getAxisInternal
protected com.amalgamasimulation.charts.internals.axes.NumericLineChartYAxisInternal getAxisInternal()- Specified by:
getAxisInternalin classAbstractAxis<Number>
-
getTitlePosition
Description copied from interface:IAxisTitlePositionPropertyOwnerReturns theAxisTitlePositionthat specifies the the chart's title position.- Specified by:
getTitlePositionin interfaceIAxisTitlePositionPropertyOwner- Returns:
- this current
AxisTitlePosition
-
setTitlePosition
Description copied from interface:IAxisTitlePositionPropertyOwnerSets theAxisTitlePositionthat specifies the chart's title position. Redraws this axis and it's parent chart.- Specified by:
setTitlePositionin interfaceIAxisTitlePositionPropertyOwner- Parameters:
yAxisTitlePosition- newAxisTitlePositionthat specifies the chart's title position- Returns:
- reference to this object
-
setMinValue
Description copied from interface:IMinValuePropertyOwnerSets the minimum possible value that can be displayed on axis. The displayed range of axis cannot include values less than the specified value. Scrolling of axis is limited accordingly. Redraws this axis and it's parent chart.- Specified by:
setMinValuein interfaceIMinValuePropertyOwner- Parameters:
value- minimum possible value that can be displayed on axis- Returns:
- reference to this object
-
setMaxValue
Description copied from interface:IMaxValuePropertyOwnerSets the maximum possible value that can be displayed on axis. The displayed range of axis cannot include values more than the specified value. Scrolling of axis is limited accordingly. Redraws this axis and it's parent chart.- Specified by:
setMaxValuein interfaceIMaxValuePropertyOwner- Parameters:
value- maximum possible value that can be displayed on axis- 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
-
getMinValue
public double getMinValue()Description copied from interface:IMinValuePropertyOwnerReturns the minimum possible value that can be displayed on axis.- Specified by:
getMinValuein interfaceIMinValuePropertyOwner- Returns:
- the minimum possible value that can be displayed on axis
-
getMaxValue
public double getMaxValue()Description copied from interface:IMaxValuePropertyOwnerReturns the maximum possible value that can be displayed on axis.- Specified by:
getMaxValuein interfaceIMaxValuePropertyOwner- Returns:
- the maximum possible value that can be displayed on axis
-
setValueLimits
Description copied from interface:IMinMaxValuePropertyOwnerConvenience method, can be used instead of calling two methods setMinValue and setMaxValue. Redraws this axis and it's parent chart.- Specified by:
setValueLimitsin interfaceIMinMaxValuePropertyOwner- Parameters:
minValue- minimum possible value that can be displayed on axismaxValue- maximum possible value that can be displayed on axis- Returns:
- reference to this object
-
setMinAdjustedDisplayedRange
Description copied from interface:IAutoAdjustmentPropertyOwnerSpecifies minimum axis range of the currently displayed contents. Redraws this chart if value is changed.- Specified by:
setMinAdjustedDisplayedRangein interfaceIAutoAdjustmentPropertyOwner- Parameters:
minAdjustRange- minimum axis range of the currently displayed contents- Returns:
- reference to this object
- See Also:
-
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
-
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
-
setZeroInDisplayedRange
Description copied from interface:IAutoAdjustmentPropertyOwnerSpecifies an axis mode in which zero value is always exists in the displayed range. Redraws this chart if visibility is changed.- Specified by:
setZeroInDisplayedRangein interfaceIAutoAdjustmentPropertyOwner- Parameters:
showZero- flag setting zero value will be always in the displayed range- Returns:
- reference to this object
- See Also:
-
setDisplayedRangeMinValueAutoAdjustmentEnabled
Description copied from interface:IAutoAdjustmentPropertyOwnerSpecifies an axis mode in which the minimum axis value is equal to the minimum value of the currently displayed contents. Redraws this chart if value is changed.- Specified by:
setDisplayedRangeMinValueAutoAdjustmentEnabledin interfaceIAutoAdjustmentPropertyOwner- Parameters:
enabled- flag setting the minimum axis value will be equal to the minimum value of the currently displayed contents- Returns:
- reference to this object
- See Also:
-
setDisplayedRangeMaxValueAutoAdjustmentEnabled
Description copied from interface:IAutoAdjustmentPropertyOwnerSpecifies an axis mode in which the maximum axis value is equal to the maximum value of the currently displayed contents. Redraws this chart if value is changed.- Specified by:
setDisplayedRangeMaxValueAutoAdjustmentEnabledin interfaceIAutoAdjustmentPropertyOwner- Parameters:
enabled- flag setting the maximum axis value will be equal to the maximum value of the currently displayed contents- Returns:
- reference to this object
- See Also:
-
isZeroInDisplayedRange
public boolean isZeroInDisplayedRange()Description copied from interface:IAutoAdjustmentPropertyOwnerChecks whether zero is always exists in the displayed range.- Specified by:
isZeroInDisplayedRangein interfaceIAutoAdjustmentPropertyOwner- Returns:
trueif zero is always exists in the displayed range,falseotherwise
-
isDisplayedRangeMinValueAutoAdjustmentEnabled
public boolean isDisplayedRangeMinValueAutoAdjustmentEnabled()Description copied from interface:IAutoAdjustmentPropertyOwnerChecks whether the minimum value is equal to the minimum value of the currently displayed contents.- Specified by:
isDisplayedRangeMinValueAutoAdjustmentEnabledin interfaceIAutoAdjustmentPropertyOwner- Returns:
trueif the minimum value is equal to the minimum value of the currently displayed contents,falseotherwise
-
isDisplayedRangeMaxValueAutoAdjustmentEnabled
public boolean isDisplayedRangeMaxValueAutoAdjustmentEnabled()Description copied from interface:IAutoAdjustmentPropertyOwnerChecks whether the maximum value is equal to the maximum value of the currently displayed contents.- Specified by:
isDisplayedRangeMaxValueAutoAdjustmentEnabledin interfaceIAutoAdjustmentPropertyOwner- Returns:
trueif the maximum value is equal to the maximum value of the currently displayed contents,falseotherwise
-
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
-
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
-
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
-