java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.chart.Axis<T>
- All Implemented Interfaces:
- Styleable,- EventTarget
- Direct Known Subclasses:
- CategoryAxis,- ValueAxis
public abstract class Axis<T> extends Region
Base class for all axes in JavaFX that represents an axis drawn on a chart area.
 It holds properties for axis auto ranging, ticks and labels along the axis.
 
 Some examples of concrete subclasses include NumberAxis whose axis plots data
 in numbers and CategoryAxis whose values / ticks represent string
 categories along its axis.
- Since:
- JavaFX 2.0
- 
Property SummaryProperties Type Property Description BooleanPropertyanimatedWhen true any changes to the axis and its range will be animated.BooleanPropertyautoRangingThis is true when the axis determines its range from the data automaticallyObjectProperty<String>labelThe axis labelObjectProperty<Side>sideThe side of the plot which this axis is being drawn onObjectProperty<Paint>tickLabelFillThe fill for all tick labelsObjectProperty<Font>tickLabelFontThe font for all tick labelsDoublePropertytickLabelGapThe gap between tick labels and the tick mark linesDoublePropertytickLabelRotationRotation in degrees of tick mark labels from their normal horizontal.BooleanPropertytickLabelsVisibletrue if tick mark labels should be displayedDoublePropertytickLengthThe length of tick mark linesBooleanPropertytickMarkVisibletrue if tick marks should be displayedProperties inherited from class javafx.scene.layout.Regionbackground, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.ParentneedsLayoutProperties inherited from class javafx.scene.NodeaccessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classAxis.TickMark<T>TickMark represents the label text, its associated properties for each tick along the Axis.
- 
Field SummaryFields inherited from class javafx.scene.layout.RegionUSE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.NodeBASELINE_OFFSET_SAME_AS_HEIGHT
- 
Constructor SummaryConstructors Constructor Description Axis()Creates and initializes a new instance of the Axis class.
- 
Method SummaryModifier and Type Method Description BooleanPropertyanimatedProperty()When true any changes to the axis and its range will be animated.protected abstract ObjectautoRange(double length)This calculates the upper and lower bound based on the data provided to invalidateRange() method.BooleanPropertyautoRangingProperty()This is true when the axis determines its range from the data automaticallyprotected abstract List<T>calculateTickValues(double length, Object range)Calculate a list of all the data values for each tick mark in rangeprotected doublecomputePrefHeight(double width)Computes the preferred height of this axis for the given width.protected doublecomputePrefWidth(double height)Computes the preferred width of this axis for the given height.booleangetAnimated()Indicates whether the changes to axis range will be animated or not.static List<CssMetaData<? extends Styleable,?>>getClassCssMetaData()List<CssMetaData<? extends Styleable,?>>getCssMetaData()This method should delegate toNode.getClassCssMetaData()so that a Node's CssMetaData can be accessed without the need for reflection.abstract doublegetDisplayPosition(T value)Get the display position along this axis for a given value.StringgetLabel()Gets the value of the property label.protected abstract ObjectgetRange()Called to get the current axis range.SidegetSide()Gets the value of the property side.PaintgetTickLabelFill()Gets the value of the property tickLabelFill.FontgetTickLabelFont()Gets the value of the property tickLabelFont.doublegetTickLabelGap()Gets the value of the property tickLabelGap.doublegetTickLabelRotation()Gets the value of the property tickLabelRotation.doublegetTickLength()Gets the value of the property tickLength.protected abstract StringgetTickMarkLabel(T value)Get the string label name for a tick mark with the given valueObservableList<Axis.TickMark<T>>getTickMarks()Unmodifiable observable list of tickmarks, each TickMark directly representing a tickmark on this axis.abstract TgetValueForDisplay(double displayPosition)Get the data value for the given display position on this axis.abstract doublegetZeroPosition()Get the display position of the zero line along this axis.protected voidinvalidateRange()Mark the current range invalid, this will cause anything that depends on the range to be recalculated on the next layout.voidinvalidateRange(List<T> data)Called when data has changed and the range may not be valid any more.booleanisAutoRanging()Gets the value of the property autoRanging.protected booleanisRangeValid()See if the current range is valid, if it is not then any range dependent calulcations need to redone on the next layout passbooleanisTickLabelsVisible()Gets the value of the property tickLabelsVisible.booleanisTickMarkVisible()Gets the value of the property tickMarkVisible.abstract booleanisValueOnAxis(T value)Checks if the given value is plottable on this axisObjectProperty<String>labelProperty()The axis labelprotected voidlayoutChildren()Invoked during the layout pass to layout this axis and all its content.protected Dimension2DmeasureTickMarkLabelSize(String labelText, double rotation)Measure the size of the label for given tick mark value.protected Dimension2DmeasureTickMarkSize(T value, double rotation)Measure the size of the label for given tick mark value.protected Dimension2DmeasureTickMarkSize(T value, Object range)Measure the size of the label for given tick mark value.voidrequestAxisLayout()Request that the axis is laid out in the next layout pass.voidrequestLayout()We suppress requestLayout() calls here by doing nothing as we don't want changes to our children to cause layout.voidsetAnimated(boolean value)Sets the value of the property animated.voidsetAutoRanging(boolean value)Sets the value of the property autoRanging.voidsetLabel(String value)Sets the value of the property label.protected abstract voidsetRange(Object range, boolean animate)Called to set the current axis range to the given range.voidsetSide(Side value)Sets the value of the property side.voidsetTickLabelFill(Paint value)Sets the value of the property tickLabelFill.voidsetTickLabelFont(Font value)Sets the value of the property tickLabelFont.voidsetTickLabelGap(double value)Sets the value of the property tickLabelGap.voidsetTickLabelRotation(double value)Sets the value of the property tickLabelRotation.voidsetTickLabelsVisible(boolean value)Sets the value of the property tickLabelsVisible.voidsetTickLength(double value)Sets the value of the property tickLength.voidsetTickMarkVisible(boolean value)Sets the value of the property tickMarkVisible.protected booleanshouldAnimate()This is used to check if any given animation should run.ObjectProperty<Side>sideProperty()The side of the plot which this axis is being drawn onObjectProperty<Paint>tickLabelFillProperty()The fill for all tick labelsObjectProperty<Font>tickLabelFontProperty()The font for all tick labelsDoublePropertytickLabelGapProperty()The gap between tick labels and the tick mark linesDoublePropertytickLabelRotationProperty()Rotation in degrees of tick mark labels from their normal horizontal.BooleanPropertytickLabelsVisibleProperty()true if tick mark labels should be displayedDoublePropertytickLengthProperty()The length of tick mark linesprotected voidtickMarksUpdated()Called during layout if the tickmarks have been updated, allowing subclasses to do anything they need to in reaction.BooleanPropertytickMarkVisibleProperty()true if tick marks should be displayedabstract doubletoNumericValue(T value)All axis values must be representable by some numeric value.abstract TtoRealValue(double value)All axis values must be representable by some numeric value.Methods inherited from class javafx.scene.layout.RegionbackgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.ParentgetBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.NodeaccessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.StyleablegetStyleableNode
- 
Property Details- 
sideThe side of the plot which this axis is being drawn on- See Also:
- getSide(),- setSide(Side)
 
- 
labelThe axis label- See Also:
- getLabel(),- setLabel(String)
 
- 
tickMarkVisibletrue if tick marks should be displayed- See Also:
- isTickMarkVisible(),- setTickMarkVisible(boolean)
 
- 
tickLabelsVisibletrue if tick mark labels should be displayed
- 
tickLengthThe length of tick mark lines- See Also:
- getTickLength(),- setTickLength(double)
 
- 
autoRangingThis is true when the axis determines its range from the data automatically- See Also:
- isAutoRanging(),- setAutoRanging(boolean)
 
- 
tickLabelFontThe font for all tick labels- See Also:
- getTickLabelFont(),- setTickLabelFont(Font)
 
- 
tickLabelFillThe fill for all tick labels- See Also:
- getTickLabelFill(),- setTickLabelFill(Paint)
 
- 
tickLabelGapThe gap between tick labels and the tick mark lines- See Also:
- getTickLabelGap(),- setTickLabelGap(double)
 
- 
animatedWhen true any changes to the axis and its range will be animated.- See Also:
- getAnimated(),- setAnimated(boolean)
 
- 
tickLabelRotationRotation in degrees of tick mark labels from their normal horizontal.
 
- 
- 
Constructor Details- 
Axispublic Axis()Creates and initializes a new instance of the Axis class.
 
- 
- 
Method Details- 
getTickMarksUnmodifiable observable list of tickmarks, each TickMark directly representing a tickmark on this axis. This is updated whenever the displayed tickmarks changes.- Returns:
- Unmodifiable observable list of TickMarks on this axis
 
- 
getSideGets the value of the property side.- Property description:
- The side of the plot which this axis is being drawn on
 
- 
setSideSets the value of the property side.- Property description:
- The side of the plot which this axis is being drawn on
 
- 
sidePropertyThe side of the plot which this axis is being drawn on- See Also:
- getSide(),- setSide(Side)
 
- 
getLabelGets the value of the property label.- Property description:
- The axis label
 
- 
setLabelSets the value of the property label.- Property description:
- The axis label
 
- 
labelPropertyThe axis label- See Also:
- getLabel(),- setLabel(String)
 
- 
isTickMarkVisiblepublic final boolean isTickMarkVisible()Gets the value of the property tickMarkVisible.- Property description:
- true if tick marks should be displayed
 
- 
setTickMarkVisiblepublic final void setTickMarkVisible(boolean value)Sets the value of the property tickMarkVisible.- Property description:
- true if tick marks should be displayed
 
- 
tickMarkVisiblePropertytrue if tick marks should be displayed- See Also:
- isTickMarkVisible(),- setTickMarkVisible(boolean)
 
- 
isTickLabelsVisiblepublic final boolean isTickLabelsVisible()Gets the value of the property tickLabelsVisible.- Property description:
- true if tick mark labels should be displayed
 
- 
setTickLabelsVisiblepublic final void setTickLabelsVisible(boolean value)Sets the value of the property tickLabelsVisible.- Property description:
- true if tick mark labels should be displayed
 
- 
tickLabelsVisiblePropertytrue if tick mark labels should be displayed
- 
getTickLengthpublic final double getTickLength()Gets the value of the property tickLength.- Property description:
- The length of tick mark lines
 
- 
setTickLengthpublic final void setTickLength(double value)Sets the value of the property tickLength.- Property description:
- The length of tick mark lines
 
- 
tickLengthPropertyThe length of tick mark lines- See Also:
- getTickLength(),- setTickLength(double)
 
- 
isAutoRangingpublic final boolean isAutoRanging()Gets the value of the property autoRanging.- Property description:
- This is true when the axis determines its range from the data automatically
 
- 
setAutoRangingpublic final void setAutoRanging(boolean value)Sets the value of the property autoRanging.- Property description:
- This is true when the axis determines its range from the data automatically
 
- 
autoRangingPropertyThis is true when the axis determines its range from the data automatically- See Also:
- isAutoRanging(),- setAutoRanging(boolean)
 
- 
getTickLabelFontGets the value of the property tickLabelFont.- Property description:
- The font for all tick labels
 
- 
setTickLabelFontSets the value of the property tickLabelFont.- Property description:
- The font for all tick labels
 
- 
tickLabelFontPropertyThe font for all tick labels- See Also:
- getTickLabelFont(),- setTickLabelFont(Font)
 
- 
getTickLabelFillGets the value of the property tickLabelFill.- Property description:
- The fill for all tick labels
 
- 
setTickLabelFillSets the value of the property tickLabelFill.- Property description:
- The fill for all tick labels
 
- 
tickLabelFillPropertyThe fill for all tick labels- See Also:
- getTickLabelFill(),- setTickLabelFill(Paint)
 
- 
getTickLabelGappublic final double getTickLabelGap()Gets the value of the property tickLabelGap.- Property description:
- The gap between tick labels and the tick mark lines
 
- 
setTickLabelGappublic final void setTickLabelGap(double value)Sets the value of the property tickLabelGap.- Property description:
- The gap between tick labels and the tick mark lines
 
- 
tickLabelGapPropertyThe gap between tick labels and the tick mark lines- See Also:
- getTickLabelGap(),- setTickLabelGap(double)
 
- 
getAnimatedpublic final boolean getAnimated()Indicates whether the changes to axis range will be animated or not.- Returns:
- true if axis range changes will be animated and false otherwise
 
- 
setAnimatedpublic final void setAnimated(boolean value)Sets the value of the property animated.- Property description:
- When true any changes to the axis and its range will be animated.
 
- 
animatedPropertyWhen true any changes to the axis and its range will be animated.- See Also:
- getAnimated(),- setAnimated(boolean)
 
- 
getTickLabelRotationpublic final double getTickLabelRotation()Gets the value of the property tickLabelRotation.- Property description:
- Rotation in degrees of tick mark labels from their normal horizontal.
 
- 
setTickLabelRotationpublic final void setTickLabelRotation(double value)Sets the value of the property tickLabelRotation.- Property description:
- Rotation in degrees of tick mark labels from their normal horizontal.
 
- 
tickLabelRotationPropertyRotation in degrees of tick mark labels from their normal horizontal.
- 
isRangeValidprotected final boolean isRangeValid()See if the current range is valid, if it is not then any range dependent calulcations need to redone on the next layout pass- Returns:
- true if current range calculations are valid
 
- 
invalidateRangeprotected final void invalidateRange()Mark the current range invalid, this will cause anything that depends on the range to be recalculated on the next layout.
- 
shouldAnimateprotected final boolean shouldAnimate()This is used to check if any given animation should run. It returns true if animation is enabled and the node is visible and in a scene.- Returns:
- true if animations should happen
 
- 
requestLayoutpublic void requestLayout()We suppress requestLayout() calls here by doing nothing as we don't want changes to our children to cause layout. If you really need to request layout then call requestAxisLayout().- Overrides:
- requestLayoutin class- Parent
 
- 
requestAxisLayoutpublic 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 optimization 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.
- 
invalidateRangeCalled 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
 
- 
autoRangeThis calculates the upper and lower bound based on the data provided to invalidateRange() method. This must not effect the state of the axis, changing any properties of the axis. Any results of the auto-ranging should be returned in the range object. This will we passed to setRange() if it has been decided to adopt this range for this axis.- Parameters:
- length- The length of the axis in screen coordinates
- Returns:
- Range information, this is implementation dependent
 
- 
setRangeCalled to set the current axis range to the given range. If isAnimating() is true then this method should animate the range to the new range.- Parameters:
- range- A range object returned from autoRange()
- animate- If true animate the change in range
 
- 
getRangeCalled to get the current axis range.- Returns:
- A range object that can be passed to setRange() and calculateTickValues()
 
- 
getZeroPositionpublic abstract 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;
 
- 
getDisplayPositionGet 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
 
- 
getValueForDisplayGet 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;
 
- 
isValueOnAxisChecks 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
 
- 
toNumericValueAll axis values must be representable by some numeric value. This gets the numeric value for a given data value.- Parameters:
- value- The data value to convert
- Returns:
- Numeric value for the given data value
 
- 
toRealValueAll axis values must be representable by some numeric value. This gets the data value for a given numeric value.- Parameters:
- value- The numeric value to convert
- Returns:
- Data value for given numeric value
 
- 
calculateTickValuesCalculate a list of all the data values for each tick mark in range- Parameters:
- length- The length of the axis in display units
- range- A range object returned from autoRange()
- Returns:
- A list of tick marks that fit along the axis if it was the given length
 
- 
computePrefHeightprotected double computePrefHeight(double width)Computes the preferred height of this axis for the given width. If axis orientation is horizontal, it takes into account the tick mark length, tick label gap and label height.- Overrides:
- computePrefHeightin class- Region
- Parameters:
- width- the width that should be used if preferred height depends on it
- Returns:
- the computed preferred width for this axis
 
- 
computePrefWidthprotected double computePrefWidth(double height)Computes the preferred width of this axis for the given height. If axis orientation is vertical, it takes into account the tick mark length, tick label gap and label height.- Overrides:
- computePrefWidthin class- Region
- Parameters:
- height- the height that should be used if preferred width depends on it
- Returns:
- the computed preferred width for this axis
 
- 
tickMarksUpdatedprotected void tickMarksUpdated()Called during layout if the tickmarks have been updated, allowing subclasses to do anything they need to in reaction.
- 
layoutChildrenprotected void layoutChildren()Invoked during the layout pass to layout this axis and all its content.- Overrides:
- layoutChildrenin class- Parent
 
- 
getTickMarkLabelGet 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
 
- 
measureTickMarkLabelSizeMeasure the size of the label for given tick mark value. This uses the font that is set for the tick marks- Parameters:
- labelText- tick mark label text
- rotation- The text rotation
- Returns:
- size of tick mark label for given value
 
- 
measureTickMarkSizeMeasure the size of the label for given tick mark value. This uses the font that is set for the tick marks- Parameters:
- value- tick mark value
- rotation- The text rotation
- Returns:
- size of tick mark label for given value
 
- 
measureTickMarkSizeMeasure the size of the label for given tick mark value. This uses the font that is set for the tick marks- Parameters:
- value- tick mark value
- range- range to use during calculations
- Returns:
- size of tick mark label for given value
 
- 
getClassCssMetaData- Returns:
- The CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
- Since:
- JavaFX 8.0
 
- 
getCssMetaDataThis method should delegate toNode.getClassCssMetaData()so that a Node's CssMetaData can be accessed without the need for reflection.- Specified by:
- getCssMetaDatain interface- Styleable
- Overrides:
- getCssMetaDatain class- Region
- Returns:
- The CssMetaData associated with this node, which may include the CssMetaData of its superclasses.
- Since:
- JavaFX 8.0
 
 
-