public final class CategoryAxis extends Axis<java.lang.String>
Type | Property and Description |
---|---|
ReadOnlyDoubleProperty |
categorySpacing
This is the gap between one category and the next along this axis
|
DoubleProperty |
endMargin
The margin between the last tick mark and the axis end
|
BooleanProperty |
gapStartAndEnd
If this is true then half the space between ticks is left at the start
and end
|
DoubleProperty |
startMargin
The margin between the axis start and the first tick-mark
|
animatedProperty, autoRangingProperty, labelProperty, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty
Modifier and Type | Class and Description |
---|---|
private static class |
CategoryAxis.StyleableProperties |
Axis.TickMark<T>
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
allDataCategories |
private ChartLayoutAnimator |
animator |
private <any> |
categories |
private ReadOnlyDoubleWrapper |
categorySpacing
This is the gap between one category and the next along this axis
|
private boolean |
changeIsLocal |
private java.lang.Object |
currentAnimationID |
private DoubleProperty |
endMargin
The margin between the last tick mark and the axis end
|
private DoubleProperty |
firstCategoryPos
This is the gap between one category and the next along this axis
|
private BooleanProperty |
gapStartAndEnd
If this is true then half the space between ticks is left at the start
and end
|
private <any> |
itemsListener |
private DoubleProperty |
startMargin
The margin between the axis start and the first tick-mark
|
measure, measureInvalid, rangeValid, tickLabelsVisibleInvalid
Constructor and Description |
---|
CategoryAxis()
Create a auto-ranging category axis with an empty list of categories.
|
CategoryAxis(<any> categories)
Create a category axis with the given categories.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
autoRange(double length)
This calculates the categories based on the data provided to invalidateRange() method.
|
private double |
calculateNewFirstPos(double length,
double catSpacing) |
private double |
calculateNewSpacing(double length,
java.util.List<java.lang.String> categories) |
private double |
calculateRequiredSize(boolean axisVertical,
double tickLabelRotation) |
protected java.util.List<java.lang.String> |
calculateTickValues(double length,
java.lang.Object range)
Calculate a list of all the data values for each tick mark in range
|
ReadOnlyDoubleProperty |
categorySpacingProperty()
This is the gap between one category and the next along this axis
|
private void |
checkAndRemoveDuplicates(java.lang.String category) |
DoubleProperty |
endMarginProperty()
The margin between the last tick mark and the axis end
|
BooleanProperty |
gapStartAndEndProperty()
If this is true then half the space between ticks is left at the start
and end
|
(package private) java.util.List<java.lang.String> |
getAllDataCategories() |
<any> |
getCategories()
Returns a
ObservableList of categories plotted on this axis. |
double |
getCategorySpacing()
Gets the value of the property categorySpacing.
|
static java.util.List<<any>> |
getClassCssMetaData() |
java.util.List<<any>> |
getCssMetaData() |
double |
getDisplayPosition(java.lang.String value)
Get the display position along this axis for a given value.
|
private java.lang.String |
getDuplicate() |
double |
getEndMargin()
Gets the value of the property endMargin.
|
protected java.lang.Object |
getRange()
Called to get the current axis range.
|
double |
getStartMargin()
Gets the value of the property startMargin.
|
protected java.lang.String |
getTickMarkLabel(java.lang.String value)
Get the string label name for a tick mark with the given value
|
java.lang.String |
getValueForDisplay(double displayPosition)
Get the data value for the given display position on this axis.
|
double |
getZeroPosition()
Get the display position of the zero line along this axis.
|
void |
invalidateRange(java.util.List<java.lang.String> data)
Called when data has changed and the range may not be valid any more.
|
boolean |
isGapStartAndEnd()
Gets the value of the property gapStartAndEnd.
|
boolean |
isValueOnAxis(java.lang.String value)
Checks if the given value is plottable on this axis
|
protected Dimension2D |
measureTickMarkSize(java.lang.String value,
java.lang.Object range)
Measure the size of the label for given tick mark value.
|
void |
setCategories(<any> value)
The ordered list of categories plotted on this axis.
|
void |
setEndMargin(double value)
Sets the value of the property endMargin.
|
void |
setGapStartAndEnd(boolean value)
Sets the value of the property gapStartAndEnd.
|
protected void |
setRange(java.lang.Object range,
boolean animate)
Called to set the current axis range to the given range.
|
void |
setStartMargin(double value)
Sets the value of the property startMargin.
|
DoubleProperty |
startMarginProperty()
The margin between the axis start and the first tick-mark
|
double |
toNumericValue(java.lang.String value)
All axis values must be representable by some numeric value.
|
java.lang.String |
toRealValue(double value)
All axis values must be representable by some numeric value.
|
animatedProperty, autoRangingProperty, computePrefHeight, computePrefWidth, getAnimated, getEffectiveSide, getEffectiveTickLabelRotation, getLabel, getSide, getTickLabelFill, getTickLabelFont, getTickLabelGap, getTickLabelRotation, getTickLength, getTickMarks, invalidateRange, isAutoRanging, isRangeValid, isTickLabelsVisible, isTickMarkVisible, labelProperty, layoutChildren, measureTickMarkLabelSize, measureTickMarkSize, requestAxisLayout, requestLayout, setAnimated, setAutoRanging, setEffectiveOrientation, setEffectiveTickLabelRotation, setLabel, setSide, setTickLabelFill, setTickLabelFont, setTickLabelGap, setTickLabelRotation, setTickLabelsVisible, setTickLength, setTickMarkVisible, shouldAnimate, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarksUpdated, tickMarkVisibleProperty
public final DoubleProperty startMarginProperty
getStartMargin()
,
setStartMargin(double)
public final DoubleProperty endMarginProperty
getEndMargin()
,
setEndMargin(double)
public final BooleanProperty gapStartAndEndProperty
isGapStartAndEnd()
,
setGapStartAndEnd(boolean)
public final ReadOnlyDoubleProperty categorySpacingProperty
getCategorySpacing()
private java.util.List<java.lang.String> allDataCategories
private boolean changeIsLocal
private final DoubleProperty firstCategoryPos
private java.lang.Object currentAnimationID
private final ChartLayoutAnimator animator
private <any> itemsListener
private DoubleProperty startMargin
private DoubleProperty endMargin
private BooleanProperty gapStartAndEnd
private <any> categories
private final ReadOnlyDoubleWrapper categorySpacing
public CategoryAxis()
public CategoryAxis(<any> categories)
categories
- List of the categories for this axispublic final double getStartMargin()
public final void setStartMargin(double value)
public final DoubleProperty startMarginProperty()
getStartMargin()
,
setStartMargin(double)
public final double getEndMargin()
public final void setEndMargin(double value)
public final DoubleProperty endMarginProperty()
getEndMargin()
,
setEndMargin(double)
public final boolean isGapStartAndEnd()
public final void setGapStartAndEnd(boolean value)
public final BooleanProperty gapStartAndEndProperty()
isGapStartAndEnd()
,
setGapStartAndEnd(boolean)
public final void setCategories(<any> value)
IllegalArgumentException
is thrown.value
- the ordered list of categories plotted on this axisprivate void checkAndRemoveDuplicates(java.lang.String category)
private java.lang.String getDuplicate()
public final <any> getCategories()
ObservableList
of categories plotted on this axis.public final double getCategorySpacing()
public final ReadOnlyDoubleProperty categorySpacingProperty()
getCategorySpacing()
private double calculateNewSpacing(double length, java.util.List<java.lang.String> categories)
private double calculateNewFirstPos(double length, double catSpacing)
protected java.lang.Object getRange()
protected void setRange(java.lang.Object range, boolean animate)
protected java.lang.Object autoRange(double length)
private double calculateRequiredSize(boolean axisVertical, double tickLabelRotation)
protected java.util.List<java.lang.String> calculateTickValues(double length, java.lang.Object range)
calculateTickValues
in class Axis<java.lang.String>
length
- The length of the axis in display unitsrange
- A range object returned from autoRange()protected java.lang.String getTickMarkLabel(java.lang.String value)
getTickMarkLabel
in class Axis<java.lang.String>
value
- The value to format into a tick label stringprotected Dimension2D measureTickMarkSize(java.lang.String value, java.lang.Object range)
measureTickMarkSize
in class Axis<java.lang.String>
value
- tick mark valuerange
- range to use during calculationspublic void invalidateRange(java.util.List<java.lang.String> data)
invalidateRange
in class Axis<java.lang.String>
data
- The current set of all data that needs to be plotted on this axisfinal java.util.List<java.lang.String> getAllDataCategories()
public double getDisplayPosition(java.lang.String value)
getDisplayPosition
in class Axis<java.lang.String>
value
- The data value to work out display position forpublic java.lang.String getValueForDisplay(double displayPosition)
getValueForDisplay
in class Axis<java.lang.String>
displayPosition
- A pixel position on this axispublic boolean isValueOnAxis(java.lang.String value)
isValueOnAxis
in class Axis<java.lang.String>
value
- The value to check if its on axispublic double toNumericValue(java.lang.String value)
toNumericValue
in class Axis<java.lang.String>
value
- The data value to convertpublic java.lang.String toRealValue(double value)
toRealValue
in class Axis<java.lang.String>
value
- The numeric value to convertpublic double getZeroPosition()
getZeroPosition
in class Axis<java.lang.String>
public static java.util.List<<any>> getClassCssMetaData()
public java.util.List<<any>> getCssMetaData()
getCssMetaData
in class Axis<java.lang.String>