Package de.gsi.chart.axes
Interface Axis
-
- All Superinterfaces:
de.gsi.dataset.AxisDescription,de.gsi.dataset.event.EventSource
- All Known Implementing Classes:
AbstractAxis,AbstractAxisParameter,CategoryAxis,ColorGradientAxis,DefaultNumericAxis,LinearAxis,LogarithmicAxis,NumericAxis
public interface Axis extends de.gsi.dataset.AxisDescription, de.gsi.dataset.event.EventSource
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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 computedAxisTransformgetAxisTransform()doublegetDisplayPosition(double value)Get the display position along this axis for a given value.doublegetHeight()doublegetLength()LogAxisTypegetLogAxisType()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()doublegetUnitScaling()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 inverteddefault voidinvokeListener(de.gsi.dataset.event.UpdateEvent updateEvent, boolean executeParallel)invoke object within update listener listbooleanisAutoGrowRanging()This is true when the axis determines its range from the data automatically and grows it if necessarybooleanisAutoRanging()This is true when the axis determines its range from the data automaticallybooleanisAutoUnitScaling()booleanisInvertedAxis()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.DoublePropertymaxProperty()javafx.beans.property.DoublePropertyminProperty()javafx.beans.property.StringPropertynameProperty()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 necessaryvoidsetAutoRanging(boolean value)This is true when the axis determines its range from the data automaticallyvoidsetAutoUnitScaling(boolean value)voidsetName(java.lang.String 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)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()
-
-
-
Method Detail
-
autoGrowRangingProperty
javafx.beans.property.BooleanProperty autoGrowRangingProperty()
This is true when the axis determines its range from the data automatically- Returns:
- property
-
autoRangingProperty
javafx.beans.property.BooleanProperty autoRangingProperty()
This is true when the axis determines its range from the data automatically- Returns:
- property
-
autoUnitScalingProperty
javafx.beans.property.BooleanProperty autoUnitScalingProperty()
- Returns:
true-> scale to the nearest SI unit prefix
-
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
-
getAutoRange
AxisRange getAutoRange()
if available (last) auto-range that has been computed- Returns:
- computed auto-range
-
getAxisTransform
AxisTransform getAxisTransform()
-
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
-
getHeight
double getHeight()
-
getLength
double getLength()
- Specified by:
getLengthin interfacede.gsi.dataset.AxisDescription- Returns:
- axis length in pixel
-
getLogAxisType
LogAxisType getLogAxisType()
- Returns:
- given linear and/or logarithmic (+ sub-type, e.g. log10, dB20, ...) axis types
-
getMinorTickCount
int getMinorTickCount()
-
getMinorTickMarks
javafx.collections.ObservableList<TickMark> getMinorTickMarks()
-
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.
-
getSide
Side getSide()
- Returns:
- the layout side
-
getTickLabelFill
javafx.scene.paint.Paint getTickLabelFill()
- Returns:
- the fill for all tick labels
-
getTickLabelFont
javafx.scene.text.Font getTickLabelFont()
- Returns:
- the font for all tick labels
-
getTickLabelFormatter
javafx.util.StringConverter<java.lang.Number> getTickLabelFormatter()
-
getTickLabelGap
double getTickLabelGap()
- Returns:
- the gap between tick labels and the tick mark lines
-
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
-
getTickMarks
javafx.collections.ObservableList<TickMark> getTickMarks()
-
getTickUnit
double getTickUnit()
-
getUnitScaling
double getUnitScaling()
- Returns:
- axis primary unit scaling
-
getUserRange
AxisRange getUserRange()
user-specified range (ie. limits based on [lower,upper]Bound)- Returns:
- user-specified range
-
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;
-
getWidth
double getWidth()
-
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;
-
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
-
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
-
invokeListener
default void invokeListener(de.gsi.dataset.event.UpdateEvent updateEvent, boolean executeParallel)invoke object within update listener list- Specified by:
invokeListenerin interfacede.gsi.dataset.event.EventSource- Parameters:
updateEvent- the event the listeners are notified withexecuteParallel-trueexecute event listener via parallel executor service
-
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
-
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
-
isAutoUnitScaling
boolean isAutoUnitScaling()
- Returns:
- whether unit is automatically adjusted to multiples of 1e3 (kilo, mega, ...) or 1e-3 (milli, micro, ...)
-
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')
-
isLogAxis
boolean isLogAxis()
This is true when the axis implements a log scale- Returns:
- true if axis is log scale
-
isTimeAxis
boolean isTimeAxis()
This is true when the axis corresponds to a time axis- Returns:
- true if axis is a time scale
-
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
-
maxProperty
javafx.beans.property.DoubleProperty maxProperty()
-
minProperty
javafx.beans.property.DoubleProperty minProperty()
-
nameProperty
javafx.beans.property.StringProperty nameProperty()
- Returns:
- the primary axis name/label property
-
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.
-
setAnimated
void setAnimated(boolean value)
- Parameters:
value- true if axis range changes will be animated and false otherwise
-
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
-
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
-
setAutoUnitScaling
void setAutoUnitScaling(boolean value)
- Parameters:
value- scaling valuetrue-> scale to the nearest SI unit prefix
-
setName
void setName(java.lang.String value)
- Parameters:
value- the new axis primary label
-
setSide
void setSide(Side newSide)
-
setTickUnit
void setTickUnit(double tickUnit)
-
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
-
setUnit
void setUnit(java.lang.String value)
- Parameters:
value- the new axis primary unit name
-
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
-
sideProperty
javafx.beans.property.ObjectProperty<Side> sideProperty()
-
tickUnitProperty
javafx.beans.property.DoubleProperty tickUnitProperty()
-
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
-
unitProperty
javafx.beans.property.ObjectProperty<java.lang.String> unitProperty()
- Returns:
- the primary unit name property
-
unitScalingProperty
javafx.beans.property.DoubleProperty unitScalingProperty()
- Returns:
- the primary unit label property
-
-