Spec-Zone .ru
спецификации, руководства, описания, API
|
public abstract class Axis<T> extends Region
Some examples of concrete subclasses include NumberAxis
whose axis plots data
in numbers and CategoryAxis
whose values / ticks represent string
categories along its axis.
Type | Property and Description |
---|---|
BooleanProperty |
animated
When true any changes to the axis and its range will be animated.
|
BooleanProperty |
autoRanging
This is true when the axis determines its range from the data automatically
|
ObjectProperty<java.lang.String> |
label
The axis label
|
ObjectProperty<Side> |
side
The side of the plot which this axis is being drawn on
|
ObjectProperty<Paint> |
tickLabelFill
The fill for all tick labels
|
ObjectProperty<Font> |
tickLabelFont
The font for all tick labels
|
DoubleProperty |
tickLabelGap
The gap between tick labels and the tick mark lines
|
DoubleProperty |
tickLabelRotation
Rotation in degrees of tick mark labels from their normal horizontal.
|
BooleanProperty |
tickLabelsVisible
true if tick mark labels should be displayed
|
DoubleProperty |
tickLength
The length of tick mark lines
|
BooleanProperty |
tickMarkVisible
true if tick marks should be displayed
|
height, maxHeight, maxWidth, minHeight, minWidth, padding, prefHeight, prefWidth, snapToPixel, width
needsLayout
blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, 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, visible
Modifier and Type | Class and Description |
---|---|
static class |
Axis.TickMark<T>
TickMark represents the label text, its associated properties for each tick
along the Axis.
|
USE_COMPUTED_SIZE, USE_PREF_SIZE
Constructor and Description |
---|
Axis()
Creates and initializes a new instance of the Axis class.
|
Modifier and Type | Method and Description |
---|---|
BooleanProperty |
animatedProperty()
When true any changes to the axis and its range will be animated.
|
protected abstract java.lang.Object |
autoRange(double length)
This calculates the upper and lower bound based on the data provided to invalidateRange() method.
|
BooleanProperty |
autoRangingProperty()
This is true when the axis determines its range from the data automatically
|
protected abstract java.util.List<T> |
calculateTickValues(double length,
java.lang.Object range)
Calculate a list of all the data values for each tick mark in range
|
protected double |
computePrefHeight(double width)
Computes the preferred height of this axis for the given width.
|
protected double |
computePrefWidth(double height)
Computes the preferred width of this axis for the given height.
|
boolean |
getAnimated()
Indicates whether the changes to axis range will be animated or not.
|
abstract double |
getDisplayPosition(T value)
Get the display position along this axis for a given value
|
java.lang.String |
getLabel()
Gets the value of the property label.
|
protected abstract java.lang.Object |
getRange()
Called to get the current axis range.
|
Side |
getSide()
Gets the value of the property side.
|
Paint |
getTickLabelFill()
Gets the value of the property tickLabelFill.
|
Font |
getTickLabelFont()
Gets the value of the property tickLabelFont.
|
double |
getTickLabelGap()
Gets the value of the property tickLabelGap.
|
double |
getTickLabelRotation()
Gets the value of the property tickLabelRotation.
|
double |
getTickLength()
Gets the value of the property tickLength.
|
protected abstract java.lang.String |
getTickMarkLabel(T value)
Get the string label name for a tick mark with the given value
|
ObservableList<Axis.TickMark<T>> |
getTickMarks()
Unmodifiable observable list of tickmarks, each TickMark directly representing a tickmark on this axis.
|
abstract T |
getValueForDisplay(double displayPosition)
Get the data value for the given display position on this axis.
|
abstract double |
getZeroPosition()
Get the display position of the zero line along this axis.
|
protected void |
invalidateRange()
Mark the current range invalid, this will cause anything that depends on the range to be recalculated on the
next layout.
|
void |
invalidateRange(java.util.List<T> data)
Called when data has changed and the range may not be valid any more.
|
boolean |
isAutoRanging()
Gets the value of the property autoRanging.
|
protected 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
|
boolean |
isTickLabelsVisible()
Gets the value of the property tickLabelsVisible.
|
boolean |
isTickMarkVisible()
Gets the value of the property tickMarkVisible.
|
abstract boolean |
isValueOnAxis(T value)
Checks if the given value is plottable on this axis
|
ObjectProperty<java.lang.String> |
labelProperty()
The axis label
|
protected void |
layoutChildren()
Invoked during the layout pass to layout this axis and all its content.
|
protected Dimension2D |
measureTickMarkLabelSize(java.lang.String labelText,
double rotation)
Measure the size of the label for given tick mark value.
|
protected Dimension2D |
measureTickMarkSize(T value,
double rotation)
Measure the size of the label for given tick mark value.
|
protected Dimension2D |
measureTickMarkSize(T value,
java.lang.Object range)
Measure the size of the label for given tick mark value.
|
void |
requestAxisLayout()
Request that the axis is laid out in the next layout pass.
|
void |
requestLayout()
We suppress requestLayout() calls here by doing nothing as we don't want changes to our children to cause
layout.
|
void |
setAnimated(boolean value)
Sets the value of the property animated.
|
void |
setAutoRanging(boolean value)
Sets the value of the property autoRanging.
|
void |
setLabel(java.lang.String value)
Sets the value of the property label.
|
protected abstract void |
setRange(java.lang.Object range,
boolean animate)
Called to set the current axis range to the given range.
|
void |
setSide(Side value)
Sets the value of the property side.
|
void |
setTickLabelFill(Paint value)
Sets the value of the property tickLabelFill.
|
void |
setTickLabelFont(Font value)
Sets the value of the property tickLabelFont.
|
void |
setTickLabelGap(double value)
Sets the value of the property tickLabelGap.
|
void |
setTickLabelRotation(double value)
Sets the value of the property tickLabelRotation.
|
void |
setTickLabelsVisible(boolean value)
Sets the value of the property tickLabelsVisible.
|
void |
setTickLength(double value)
Sets the value of the property tickLength.
|
void |
setTickMarkVisible(boolean value)
Sets the value of the property tickMarkVisible.
|
protected boolean |
shouldAnimate()
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 on
|
ObjectProperty<Paint> |
tickLabelFillProperty()
The fill for all tick labels
|
ObjectProperty<Font> |
tickLabelFontProperty()
The font for all tick labels
|
DoubleProperty |
tickLabelGapProperty()
The gap between tick labels and the tick mark lines
|
DoubleProperty |
tickLabelRotationProperty()
Rotation in degrees of tick mark labels from their normal horizontal.
|
BooleanProperty |
tickLabelsVisibleProperty()
true if tick mark labels should be displayed
|
DoubleProperty |
tickLengthProperty()
The length of tick mark lines
|
protected void |
tickMarksUpdated()
Called during layout if the tickmarks have been updated, allowing subclasses to do anything they need to
in reaction.
|
BooleanProperty |
tickMarkVisibleProperty()
true if tick marks should be displayed
|
abstract double |
toNumericValue(T value)
All axis values must be representable by some numeric value.
|
abstract T |
toRealValue(double value)
All axis values must be representable by some numeric value.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPadding, getPrefHeight, getPrefWidth, getWidth, heightProperty, isResizable, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setSnapToPixel, setWidth, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthProperty
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, 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, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToSceneTransformProperty, lookupAll, managedProperty, mouseTransparentProperty, 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, pickOnBoundsProperty, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, visibleProperty
public final ObjectProperty<Side> sideProperty
getSide()
,
setSide(Side)
public final ObjectProperty<java.lang.String> labelProperty
getLabel()
,
setLabel(String)
public final BooleanProperty tickMarkVisibleProperty
public final BooleanProperty tickLabelsVisibleProperty
public final DoubleProperty tickLengthProperty
getTickLength()
,
setTickLength(double)
public final BooleanProperty autoRangingProperty
isAutoRanging()
,
setAutoRanging(boolean)
public final ObjectProperty<Font> tickLabelFontProperty
getTickLabelFont()
,
setTickLabelFont(Font)
public final ObjectProperty<Paint> tickLabelFillProperty
getTickLabelFill()
,
setTickLabelFill(Paint)
public final DoubleProperty tickLabelGapProperty
getTickLabelGap()
,
setTickLabelGap(double)
public final BooleanProperty animatedProperty
setAnimated(boolean)
public final DoubleProperty tickLabelRotationProperty
public ObservableList<Axis.TickMark<T>> getTickMarks()
public final Side getSide()
public final void setSide(Side value)
public final ObjectProperty<Side> sideProperty()
getSide()
,
setSide(Side)
public final java.lang.String getLabel()
public final void setLabel(java.lang.String value)
public final ObjectProperty<java.lang.String> labelProperty()
getLabel()
,
setLabel(String)
public final boolean isTickMarkVisible()
public final void setTickMarkVisible(boolean value)
public final BooleanProperty tickMarkVisibleProperty()
public final boolean isTickLabelsVisible()
public final void setTickLabelsVisible(boolean value)
public final BooleanProperty tickLabelsVisibleProperty()
public final double getTickLength()
public final void setTickLength(double value)
public final DoubleProperty tickLengthProperty()
getTickLength()
,
setTickLength(double)
public final boolean isAutoRanging()
public final void setAutoRanging(boolean value)
public final BooleanProperty autoRangingProperty()
isAutoRanging()
,
setAutoRanging(boolean)
public final Font getTickLabelFont()
public final void setTickLabelFont(Font value)
public final ObjectProperty<Font> tickLabelFontProperty()
getTickLabelFont()
,
setTickLabelFont(Font)
public final Paint getTickLabelFill()
public final void setTickLabelFill(Paint value)
public final ObjectProperty<Paint> tickLabelFillProperty()
getTickLabelFill()
,
setTickLabelFill(Paint)
public final double getTickLabelGap()
public final void setTickLabelGap(double value)
public final DoubleProperty tickLabelGapProperty()
getTickLabelGap()
,
setTickLabelGap(double)
public final boolean getAnimated()
public final void setAnimated(boolean value)
public final BooleanProperty animatedProperty()
setAnimated(boolean)
public final double getTickLabelRotation()
public final void setTickLabelRotation(double value)
public final DoubleProperty tickLabelRotationProperty()
protected final boolean isRangeValid()
protected final void invalidateRange()
protected final boolean shouldAnimate()
public void requestLayout()
requestLayout
in class Parent
public void requestAxisLayout()
public void invalidateRange(java.util.List<T> data)
data
- The current set of all data that needs to be plotted on this axisprotected abstract java.lang.Object autoRange(double length)
length
- The length of the axis in screen coordinatesprotected abstract void setRange(java.lang.Object range, boolean animate)
range
- A range object returned from autoRange()animate
- If true animate the change in rangeprotected abstract java.lang.Object getRange()
public abstract double getZeroPosition()
public abstract double getDisplayPosition(T value)
value
- The data value to work out display position forpublic abstract T getValueForDisplay(double displayPosition)
displayPosition
- A pixel position on this axispublic abstract boolean isValueOnAxis(T value)
value
- The value to check if its on axispublic abstract double toNumericValue(T value)
value
- The data value to convertpublic abstract T toRealValue(double value)
value
- The numeric value to convertprotected abstract java.util.List<T> calculateTickValues(double length, java.lang.Object range)
length
- The length of the axis in display unitsrange
- A range object returned from autoRange()protected double computePrefHeight(double width)
computePrefHeight
in class Region
width
- the width that should be used if preferred height depends
on itprotected double computePrefWidth(double height)
computePrefWidth
in class Region
height
- the height that should be used if preferred width depends
on itprotected void tickMarksUpdated()
protected void layoutChildren()
layoutChildren
in class Parent
protected abstract java.lang.String getTickMarkLabel(T value)
value
- The value to format into a tick label stringprotected final Dimension2D measureTickMarkLabelSize(java.lang.String labelText, double rotation)
labelText
- tick mark label textrotation
- The text rotationprotected final Dimension2D measureTickMarkSize(T value, double rotation)
value
- tick mark valuerotation
- The text rotationprotected Dimension2D measureTickMarkSize(T value, java.lang.Object range)
value
- tick mark valuerange
- range to use during calculationsCopyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to