Class BarChartNumericYAxis
java.lang.Object
com.amalgamasimulation.charts.axes.AbstractAxis<Number>
com.amalgamasimulation.charts.axes.BarChartNumericYAxis
- All Implemented Interfaces:
IAxisTitlePropertyOwner<Number>,IGetDisplayedRangePropertyOwner,IMaxValuePropertyOwner,INumericStylePropertyOwner,IValueInRangePropertyOwner
public class BarChartNumericYAxis
extends AbstractAxis<Number>
implements IMaxValuePropertyOwner, IGetDisplayedRangePropertyOwner, INumericStylePropertyOwner, IValueInRangePropertyOwner, IAxisTitlePropertyOwner<Number>
Class that represents an Y-axis drawn on a
BarChart or
HistogramChart area. It holds properties for axis ticks and labels
along the axis. This axis does allow ranging operations.- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternalprotected com.amalgamasimulation.charts.internals.axes.NumericYAxisInternal -
Constructor Summary
ConstructorsConstructorDescriptionBarChartNumericYAxis(com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.NumericYAxisInternal yAxisInternal) Constructs aBarChartInternalY-axis with givenNumericYAxisInternal -
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.NumericYAxisInternalprotected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternalReturns the currently displayed values range of axis.doubleReturns the maximum 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.booleanChecks whether this axis title should be drawn.booleanisValueDisplayed(double value) Checks whether the value is displayed on this axis.Removes the displayed range changed action.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.setNumericStyle(AxisNumericStyle numericTicksAndLabels) 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.setTitleVisible(boolean visible) Specifies whether this axis title should be drawn.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.AbstractBarChartInternal chartInternal -
yAxisInternal
protected com.amalgamasimulation.charts.internals.axes.NumericYAxisInternal yAxisInternal
-
-
Constructor Details
-
BarChartNumericYAxis
public BarChartNumericYAxis(com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.NumericYAxisInternal yAxisInternal) Constructs aBarChartInternalY-axis with givenNumericYAxisInternal- Parameters:
chartInternal-BarChartInternalwhich is the owner of this objectyAxisInternal-NumericYAxisInternalwhich is the internal axis logic aggregator
-
-
Method Details
-
getChartInternal
protected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal getChartInternal()- Specified by:
getChartInternalin classAbstractAxis<Number>
-
getAxisInternal
protected com.amalgamasimulation.charts.internals.axes.NumericYAxisInternal getAxisInternal()- Specified by:
getAxisInternalin classAbstractAxis<Number>
-
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
-
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
-
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
-
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:
numericTicksAndLabels- 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
-
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
-