Package de.gsi.chart.axes
Interface Axis
-
- All Superinterfaces:
javafx.beans.Observable
- All Known Implementing Classes:
AbstractAxis,AbstractAxisParameter,CategoryAxis,DefaultNumericAxis,LinearAxis,LogarithmicAxis,NumericAxis
public interface Axis extends javafx.beans.Observable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javafx.beans.property.BooleanPropertyautoGrowRangingProperty()This is true when the axis determines its range from the data automaticallyjavafx.beans.property.BooleanPropertyautoRangingProperty()This is true when the axis determines its range from the data automaticallyjavafx.beans.property.BooleanPropertyautoUnitScalingProperty()voiddrawAxis(javafx.scene.canvas.GraphicsContext gc, double axisWidth, double axisHeight)Function allows custom drawing of axes outside the Axis environment (ie.voidforceRedraw()forces redrawing of axis (via layoutChildren()).AxisRangegetAutoRange()if available (last) auto-range that has been computedbooleangetAutoUnitScaling()AxisTransformgetAxisTransform()doublegetDisplayPosition(double value)Get the display position along this axis for a given value.doublegetHeight()java.lang.StringgetLabel()doublegetLength()LogAxisTypegetLogAxisType()doublegetLowerBound()intgetMinorTickCount()javafx.collections.ObservableList<TickMark>getMinorTickMarks()AxisRangegetRange()on auto-ranging this returns getAutoRange(), otherwise the user-specified range getUserRange() (ie.SidegetSide()javafx.scene.paint.PaintgetTickLabelFill()javafx.scene.text.FontgetTickLabelFont()javafx.util.StringConverter<java.lang.Number>getTickLabelFormatter()doublegetTickLabelGap()java.lang.StringgetTickMarkLabel(double value)Get the string label name for a tick mark with the given valuejavafx.collections.ObservableList<TickMark>getTickMarks()doublegetTickUnit()java.lang.StringgetUnit()doublegetUnitScaling()doublegetUpperBound()AxisRangegetUserRange()user-specified range (ie.doublegetValueForDisplay(double displayPosition)Get the data value for the given display position on this axis.doublegetWidth()doublegetZeroPosition()Get the display position of the zero line along this axis.voidinvalidateRange(java.util.List<java.lang.Number> data)Called when data has changed and the range may not be valid any more.voidinvertAxis(boolean value)This istruewhen the axis labels and data point order should be invertedjavafx.beans.property.BooleanPropertyinvertAxisProperty()This istruewhen the axis labels and data point order should be invertedbooleanisAutoGrowRanging()This is true when the axis determines its range from the data automatically and grows it if necessarybooleanisAutoNotification()Checks it automatic notification is enabled.booleanisAutoRanging()This is true when the axis determines its range from the data automaticallybooleanisInvertedAxis()This istruewhen the axis labels and data point order should be invertedbooleanisLogAxis()This is true when the axis implements a log scalebooleanisTimeAxis()This is true when the axis corresponds to a time axisbooleanisValueOnAxis(double value)Checks if the given value is plottable on this axisjavafx.beans.property.StringPropertylabelProperty()javafx.beans.property.DoublePropertylowerBoundProperty()voidrequestAxisLayout()Request that the axis is laid out in the next layout pass.voidsetAnimated(boolean value)voidsetAutoGrowRanging(boolean value)This is true when the axis determines its range from the data automatically and grows it if necessaryvoidsetAutoNotifaction(boolean flag)Set the automatic notification of invalidation listeners.voidsetAutoRanging(boolean value)This is true when the axis determines its range from the data automaticallyvoidsetAutoUnitScaling(boolean value)voidsetLabel(java.lang.String value)voidsetLowerBound(double value)voidsetSide(Side newSide)voidsetTickUnit(double tickUnit)voidsetTimeAxis(boolean value)This istruewhen the axis labels and data point should be plotted according to some time-axis definitionvoidsetUnit(java.lang.String value)voidsetUnitScaling(double value)voidsetUnitScaling(MetricPrefix value)voidsetUpperBound(double value)javafx.beans.property.ObjectProperty<Side>sideProperty()javafx.beans.property.DoublePropertytickUnitProperty()javafx.beans.property.BooleanPropertytimeAxisProperty()This istruewhen the axis labels and data point should be plotted according to some time-axis definitionjavafx.beans.property.ObjectProperty<java.lang.String>unitProperty()javafx.beans.property.DoublePropertyunitScalingProperty()javafx.beans.property.DoublePropertyupperBoundProperty()
-
-
-
Method Detail
-
getAutoRange
AxisRange getAutoRange()
if available (last) auto-range that has been computed- Returns:
- computed auto-range
-
getUserRange
AxisRange getUserRange()
user-specified range (ie. limits based on [lower,upper]Bound)- Returns:
- user-specified range
-
getRange
AxisRange getRange()
on auto-ranging this returns getAutoRange(), otherwise the user-specified range getUserRange() (ie. limits based on [lower,upper]Bound)- Returns:
- actual range that is being used.
-
requestAxisLayout
void requestAxisLayout()
Request that the axis is laid out in the next layout pass. This replaces requestLayout() as it has been overridden to do nothing so that changes to children's bounds etc do not cause a layout. This was done as a optimisation as the Axis knows the exact minimal set of changes that really need layout to be updated. So we only want to request layout then, not on any child change.
-
getLength
double getLength()
- Returns:
- axis length in pixel
-
getSide
Side getSide()
- Returns:
- the layout side
-
setSide
void setSide(Side newSide)
-
sideProperty
javafx.beans.property.ObjectProperty<Side> sideProperty()
-
getZeroPosition
double getZeroPosition()
Get the display position of the zero line along this axis.- Returns:
- display position or Double.NaN if zero is not in current range;
-
getDisplayPosition
double getDisplayPosition(double value)
Get the display position along this axis for a given value. If the value is not in the current range, the returned value will be an extrapolation of the display position. If the value is not valid for this Axis and the axis cannot display such value in any range, Double.NaN is returned- Parameters:
value- The data value to work out display position for- Returns:
- display position or Double.NaN if value not valid
-
getValueForDisplay
double getValueForDisplay(double displayPosition)
Get the data value for the given display position on this axis. If the axis is a CategoryAxis this will be the nearest value.- Parameters:
displayPosition- A pixel position on this axis- Returns:
- the nearest data value to the given pixel position or null if not on axis;
-
isValueOnAxis
boolean isValueOnAxis(double value)
Checks if the given value is plottable on this axis- Parameters:
value- The value to check if its on axis- Returns:
- true if the given value is plottable on this axis
-
setAutoNotifaction
void setAutoNotifaction(boolean flag)
Set the automatic notification of invalidation listeners. In general, axes should notify registered invalidation listeners, if the axes range or style parameters have changed.- Parameters:
flag- true for automatic notification
-
isAutoNotification
boolean isAutoNotification()
Checks it automatic notification is enabled.- Returns:
- true if automatic notification is enabled
-
isAutoRanging
boolean isAutoRanging()
This is true when the axis determines its range from the data automatically- Returns:
- true if axis shall be updated to the optimal data range
-
setAutoRanging
void setAutoRanging(boolean value)
This is true when the axis determines its range from the data automatically- Parameters:
value- true if axis shall be updated to the optimal data range
-
autoRangingProperty
javafx.beans.property.BooleanProperty autoRangingProperty()
This is true when the axis determines its range from the data automatically- Returns:
- property
-
isAutoGrowRanging
boolean isAutoGrowRanging()
This is true when the axis determines its range from the data automatically and grows it if necessary- Returns:
- true if axis shall be updated to the optimal data range
-
setAutoGrowRanging
void setAutoGrowRanging(boolean value)
This is true when the axis determines its range from the data automatically and grows it if necessary- Parameters:
value- true if axis shall be updated to the optimal data range and grows it if necessary
-
autoGrowRangingProperty
javafx.beans.property.BooleanProperty autoGrowRangingProperty()
This is true when the axis determines its range from the data automatically- Returns:
- property
-
isInvertedAxis
boolean isInvertedAxis()
This istruewhen the axis labels and data point order should be inverted- Returns:
trueif axis shall be inverted (i.e. drawn from 'max->min', rather than the normal 'min->max')
-
invertAxis
void invertAxis(boolean value)
This istruewhen the axis labels and data point order should be inverted- Parameters:
value-trueif axis shall be inverted (i.e. drawn from 'max->min', rather than the normal 'min->max')
-
invertAxisProperty
javafx.beans.property.BooleanProperty invertAxisProperty()
This istruewhen the axis labels and data point order should be inverted- Returns:
- property
-
invalidateRange
void invalidateRange(java.util.List<java.lang.Number> data)
Called when data has changed and the range may not be valid any more. This is only called by the chart if isAutoRanging() returns true. If we are auto ranging it will cause layout to be requested and auto ranging to happen on next layout pass.- Parameters:
data- The current set of all data that needs to be plotted on this axis
-
isLogAxis
boolean isLogAxis()
This is true when the axis implements a log scale- Returns:
- true if axis is log scale
-
getLogAxisType
LogAxisType getLogAxisType()
- Returns:
- given linear and/or logarithmic (+ sub-type, e.g. log10, dB20, ...) axis types
-
isTimeAxis
boolean isTimeAxis()
This is true when the axis corresponds to a time axis- Returns:
- true if axis is a time scale
-
setTimeAxis
void setTimeAxis(boolean value)
This istruewhen the axis labels and data point should be plotted according to some time-axis definition- Parameters:
value-trueif axis shall be drawn with time-axis labels
-
timeAxisProperty
javafx.beans.property.BooleanProperty timeAxisProperty()
This istruewhen the axis labels and data point should be plotted according to some time-axis definition- Returns:
- the timeAxis property
-
getLabel
java.lang.String getLabel()
- Returns:
- axis primary label
-
setLabel
void setLabel(java.lang.String value)
- Parameters:
value- the new axis primary label
-
labelProperty
javafx.beans.property.StringProperty labelProperty()
- Returns:
- the primary label property
-
getAutoUnitScaling
boolean getAutoUnitScaling()
- Returns:
- whether unit is automatically adjusted to multiples of 1e3 (kilo, mega, ...) or 1e-3 (milli, micro, ...)
-
setAutoUnitScaling
void setAutoUnitScaling(boolean value)
- Parameters:
value- scaling valuetrue-> scale to the nearest SI unit prefix
-
autoUnitScalingProperty
javafx.beans.property.BooleanProperty autoUnitScalingProperty()
- Returns:
true-> scale to the nearest SI unit prefix
-
getUnit
java.lang.String getUnit()
- Returns:
- axis primary unit scaling
-
setUnit
void setUnit(java.lang.String value)
- Parameters:
value- the new axis primary unit scaling
-
unitProperty
javafx.beans.property.ObjectProperty<java.lang.String> unitProperty()
- Returns:
- the primary unit scaling property
-
getUnitScaling
double getUnitScaling()
- Returns:
- axis primary unit scaling
-
setUnitScaling
void setUnitScaling(double value)
- Parameters:
value- the new axis primary unit label
-
setUnitScaling
void setUnitScaling(MetricPrefix value)
- Parameters:
value- the new axis primary unit label
-
unitScalingProperty
javafx.beans.property.DoubleProperty unitScalingProperty()
- Returns:
- the primary unit label property
-
getTickUnit
double getTickUnit()
-
setTickUnit
void setTickUnit(double tickUnit)
-
tickUnitProperty
javafx.beans.property.DoubleProperty tickUnitProperty()
-
getUpperBound
double getUpperBound()
-
setUpperBound
void setUpperBound(double value)
-
upperBoundProperty
javafx.beans.property.DoubleProperty upperBoundProperty()
-
getLowerBound
double getLowerBound()
-
setLowerBound
void setLowerBound(double value)
-
lowerBoundProperty
javafx.beans.property.DoubleProperty lowerBoundProperty()
-
getWidth
double getWidth()
-
getHeight
double getHeight()
-
getTickMarks
javafx.collections.ObservableList<TickMark> getTickMarks()
-
getMinorTickMarks
javafx.collections.ObservableList<TickMark> getMinorTickMarks()
-
getMinorTickCount
int getMinorTickCount()
-
getTickMarkLabel
java.lang.String getTickMarkLabel(double value)
Get the string label name for a tick mark with the given value- Parameters:
value- The value to format into a tick label string- Returns:
- A formatted string for the given value
-
getTickLabelFormatter
javafx.util.StringConverter<java.lang.Number> getTickLabelFormatter()
-
getAxisTransform
AxisTransform getAxisTransform()
-
setAnimated
void setAnimated(boolean value)
- Parameters:
value- true if axis range changes will be animated and false otherwise
-
getTickLabelFont
javafx.scene.text.Font getTickLabelFont()
- Returns:
- the font for all tick labels
-
getTickLabelFill
javafx.scene.paint.Paint getTickLabelFill()
- Returns:
- the fill for all tick labels
-
getTickLabelGap
double getTickLabelGap()
- Returns:
- the gap between tick labels and the tick mark lines
-
drawAxis
void drawAxis(javafx.scene.canvas.GraphicsContext gc, double axisWidth, double axisHeight)Function allows custom drawing of axes outside the Axis environment (ie. on another canvas)- Parameters:
gc- the graphic context on which the axis is to be drawnaxisWidth- the axis width in pixel (N.B. padding is being added)axisHeight- the axis height in pixel (N.B. padding is being added)
-
forceRedraw
void forceRedraw()
forces redrawing of axis (via layoutChildren()). This is used to force an update while the main chart area is being updated (a requestLayout()) would be executed only during the next pulse. This is used explicitly in the Chart class. Outside use of this context should be limited to a minimum... handle with care
-
-