public abstract class ValueAxis<T extends java.lang.Number> extends Axis<T>
Type | Property and Description |
---|---|
DoubleProperty |
lowerBound
The value for the lower bound of this axis (minimum value).
|
IntegerProperty |
minorTickCount
The number of minor tick divisions to be displayed between each major tick mark.
|
DoubleProperty |
minorTickLength
The length of minor tick mark lines.
|
BooleanProperty |
minorTickVisible
true if minor tick marks should be displayed
|
ReadOnlyDoubleProperty |
scale
The scale factor from data units to visual units
|
<any> |
tickLabelFormatter
StringConverter used to format tick mark labels.
|
DoubleProperty |
upperBound
The value for the upper bound of this axis (maximum value).
|
animatedProperty, autoRangingProperty, labelProperty, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty
Modifier and Type | Class and Description |
---|---|
private static class |
ValueAxis.StyleableProperties |
Axis.TickMark<T>
Modifier and Type | Field and Description |
---|---|
protected DoubleProperty |
currentLowerBound
The current value for the lowerBound of this axis (minimum value).
|
(package private) double |
dataMaxValue
This is the maximum current data value and it is used while auto ranging.
|
(package private) double |
dataMinValue
This is the minimum current data value and it is used while auto ranging.
|
private DoubleProperty |
lowerBound
The value for the lower bound of this axis (minimum value).
|
private IntegerProperty |
minorTickCount
The number of minor tick divisions to be displayed between each major tick mark.
|
private DoubleProperty |
minorTickLength
The length of minor tick mark lines.
|
private boolean |
minorTickMarksDirty |
private java.util.List<T> |
minorTickMarkValues
List of the values at which there are minor ticks
|
private Path |
minorTickPath |
private BooleanProperty |
minorTickVisible
true if minor tick marks should be displayed
|
private double |
offset |
private ReadOnlyDoubleWrapper |
scale
The scale factor from data units to visual units
|
private <any> |
tickLabelFormatter
StringConverter used to format tick mark labels.
|
private DoubleProperty |
upperBound
The value for the upper bound of this axis (maximum value).
|
measure, measureInvalid, rangeValid, tickLabelsVisibleInvalid
Constructor and Description |
---|
ValueAxis()
Creates a auto-ranging ValueAxis.
|
ValueAxis(double lowerBound,
double upperBound)
Creates a non-auto-ranging ValueAxis with the given lower and upper bound.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
autoRange(double length)
This calculates the upper and lower bound based on the data provided to invalidateRange() method.
|
protected java.lang.Object |
autoRange(double minValue,
double maxValue,
double length,
double labelSize)
Called to set the upper and lower bound and anything else that needs to be auto-ranged.
|
protected abstract java.util.List<T> |
calculateMinorTickMarks()
Calculates a list of the data values for every minor tick mark
|
protected double |
calculateNewScale(double length,
double lowerBound,
double upperBound)
Calculates new scale for this axis.
|
static java.util.List<<any>> |
getClassCssMetaData() |
java.util.List<<any>> |
getCssMetaData() |
double |
getDisplayPosition(T value)
Gets the display position along this axis for a given value.
|
double |
getLowerBound()
Gets the value of the property lowerBound.
|
int |
getMinorTickCount()
Gets the value of the property minorTickCount.
|
double |
getMinorTickLength()
Gets the value of the property minorTickLength.
|
double |
getScale()
Gets the value of the property scale.
|
<any> |
getTickLabelFormatter()
Gets the value of the property tickLabelFormatter.
|
double |
getUpperBound()
Gets the value of the property upperBound.
|
T |
getValueForDisplay(double displayPosition)
Gets the data value for the given display position on this axis.
|
double |
getZeroPosition()
Gets the display position of the zero line along this axis.
|
void |
invalidateRange(java.util.List<T> data)
Called when the data has changed and the range may not be valid anymore.
|
boolean |
isMinorTickVisible()
Gets the value of the property minorTickVisible.
|
boolean |
isValueOnAxis(T value)
Checks if the given value is plottable on this axis
|
protected void |
layoutChildren()
Invoked during the layout pass to layout this axis and all its content.
|
DoubleProperty |
lowerBoundProperty()
The value for the lower bound of this axis (minimum value).
|
IntegerProperty |
minorTickCountProperty()
The number of minor tick divisions to be displayed between each major tick mark.
|
DoubleProperty |
minorTickLengthProperty()
The length of minor tick mark lines.
|
BooleanProperty |
minorTickVisibleProperty()
true if minor tick marks should be displayed
|
ReadOnlyDoubleProperty |
scaleProperty()
The scale factor from data units to visual units
|
(package private) ReadOnlyDoubleWrapper |
scalePropertyImpl() |
void |
setLowerBound(double value)
Sets the value of the property lowerBound.
|
void |
setMinorTickCount(int value)
Sets the value of the property minorTickCount.
|
void |
setMinorTickLength(double value)
Sets the value of the property minorTickLength.
|
void |
setMinorTickVisible(boolean value)
Sets the value of the property minorTickVisible.
|
protected void |
setScale(double scale)
Sets the value of the property scale.
|
void |
setTickLabelFormatter(<any> value)
Sets the value of the property tickLabelFormatter.
|
void |
setUpperBound(double value)
Sets the value of the property upperBound.
|
<any> |
tickLabelFormatterProperty()
StringConverter used to format tick mark labels.
|
protected void |
tickMarksUpdated()
Called during layout if the tickmarks have been updated, allowing subclasses to do anything they need to
in reaction.
|
double |
toNumericValue(T value)
All axis values must be representable by some numeric value.
|
T |
toRealValue(double value)
All axis values must be representable by some numeric value.
|
private void |
updateMinorTickPath(Side side,
double length) |
DoubleProperty |
upperBoundProperty()
The value for the upper bound of this axis (maximum value).
|
animatedProperty, autoRangingProperty, calculateTickValues, computePrefHeight, computePrefWidth, getAnimated, getEffectiveSide, getEffectiveTickLabelRotation, getLabel, getRange, getSide, getTickLabelFill, getTickLabelFont, getTickLabelGap, getTickLabelRotation, getTickLength, getTickMarkLabel, getTickMarks, invalidateRange, isAutoRanging, isRangeValid, isTickLabelsVisible, isTickMarkVisible, labelProperty, measureTickMarkLabelSize, measureTickMarkSize, measureTickMarkSize, requestAxisLayout, requestLayout, setAnimated, setAutoRanging, setEffectiveOrientation, setEffectiveTickLabelRotation, setLabel, setRange, setSide, setTickLabelFill, setTickLabelFont, setTickLabelGap, setTickLabelRotation, setTickLabelsVisible, setTickLength, setTickMarkVisible, shouldAnimate, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty
public final BooleanProperty minorTickVisibleProperty
isMinorTickVisible()
,
setMinorTickVisible(boolean)
public final ReadOnlyDoubleProperty scaleProperty
getScale()
,
setScale(double)
public final DoubleProperty upperBoundProperty
getUpperBound()
,
setUpperBound(double)
public final DoubleProperty lowerBoundProperty
getLowerBound()
,
setLowerBound(double)
public final <any> tickLabelFormatterProperty
getTickLabelFormatter()
,
#setTickLabelFormatter()
public final DoubleProperty minorTickLengthProperty
getMinorTickLength()
,
setMinorTickLength(double)
public final IntegerProperty minorTickCountProperty
getMinorTickCount()
,
setMinorTickCount(int)
private final Path minorTickPath
private double offset
double dataMinValue
double dataMaxValue
private java.util.List<T extends java.lang.Number> minorTickMarkValues
private boolean minorTickMarksDirty
protected final DoubleProperty currentLowerBound
private BooleanProperty minorTickVisible
private ReadOnlyDoubleWrapper scale
private DoubleProperty upperBound
private DoubleProperty lowerBound
private final <any> tickLabelFormatter
private DoubleProperty minorTickLength
private IntegerProperty minorTickCount
public ValueAxis()
public ValueAxis(double lowerBound, double upperBound)
lowerBound
- The lower bound for this axis, i.e. min plottable valueupperBound
- The upper bound for this axis, i.e. max plottable valuepublic final boolean isMinorTickVisible()
public final void setMinorTickVisible(boolean value)
public final BooleanProperty minorTickVisibleProperty()
isMinorTickVisible()
,
setMinorTickVisible(boolean)
public final double getScale()
protected final void setScale(double scale)
public final ReadOnlyDoubleProperty scaleProperty()
getScale()
,
setScale(double)
ReadOnlyDoubleWrapper scalePropertyImpl()
public final double getUpperBound()
public final void setUpperBound(double value)
public final DoubleProperty upperBoundProperty()
getUpperBound()
,
setUpperBound(double)
public final double getLowerBound()
public final void setLowerBound(double value)
public final DoubleProperty lowerBoundProperty()
getLowerBound()
,
setLowerBound(double)
public final <any> getTickLabelFormatter()
public final void setTickLabelFormatter(<any> value)
public final <any> tickLabelFormatterProperty()
getTickLabelFormatter()
,
#setTickLabelFormatter()
public final double getMinorTickLength()
public final void setMinorTickLength(double value)
public final DoubleProperty minorTickLengthProperty()
getMinorTickLength()
,
setMinorTickLength(double)
public final int getMinorTickCount()
public final void setMinorTickCount(int value)
public final IntegerProperty minorTickCountProperty()
getMinorTickCount()
,
setMinorTickCount(int)
protected final java.lang.Object autoRange(double length)
protected final double calculateNewScale(double length, double lowerBound, double upperBound)
length
- The display length of the axislowerBound
- The lower bound valueupperBound
- The upper bound valueprotected java.lang.Object autoRange(double minValue, double maxValue, double length, double labelSize)
minValue
- The min data value that needs to be plotted on this axismaxValue
- The max data value that needs to be plotted on this axislength
- The length of the axis in display coordinateslabelSize
- The approximate average size a label takes along the axisprotected abstract java.util.List<T> calculateMinorTickMarks()
protected void tickMarksUpdated()
tickMarksUpdated
in class Axis<T extends java.lang.Number>
protected void layoutChildren()
layoutChildren
in class Axis<T extends java.lang.Number>
private void updateMinorTickPath(Side side, double length)
public void invalidateRange(java.util.List<T> data)
invalidateRange
in class Axis<T extends java.lang.Number>
data
- The current set of all data that needs to be plotted on this axispublic double getDisplayPosition(T value)
getDisplayPosition
in class Axis<T extends java.lang.Number>
value
- The data value to work out display position forpublic T getValueForDisplay(double displayPosition)
getValueForDisplay
in class Axis<T extends java.lang.Number>
displayPosition
- A pixel position on this axispublic double getZeroPosition()
getZeroPosition
in class Axis<T extends java.lang.Number>
public boolean isValueOnAxis(T value)
isValueOnAxis
in class Axis<T extends java.lang.Number>
value
- The value to check if its on axispublic double toNumericValue(T value)
toNumericValue
in class Axis<T extends java.lang.Number>
value
- The data value to convertpublic T toRealValue(double value)
toRealValue
in class Axis<T extends java.lang.Number>
value
- The numeric value to convertpublic static java.util.List<<any>> getClassCssMetaData()
public java.util.List<<any>> getCssMetaData()
getCssMetaData
in class Axis<T extends java.lang.Number>