- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.chart.Axis<T>
-
- javafx.scene.chart.ValueAxis<Number>
-
- javafx.scene.chart.NumberAxis
-
- All Implemented Interfaces:
-
Styleable
,EventTarget
public final class NumberAxis extends ValueAxis<Number>
一个轴类,用于在每个tickUnit中绘制主要刻度线的数字范围。 您可以使用此轴的任何数字类型。- 从以下版本开始:
- JavaFX 2.0
-
-
Property Summary
Properties Type Property 描述 BooleanProperty
forceZeroInRange
当真实零值始终包含在可见范围内时。DoubleProperty
tickUnit
数据单位中每个主要刻度线之间的值。-
Properties inherited from class javafx.scene.chart.Axis
animated, autoRanging, label, side, tickLabelFill, tickLabelFont, tickLabelGap, tickLabelRotation, tickLabelsVisible, tickLength, tickMarkVisible
-
Properties inherited from class javafx.scene.Node
accessibleHelp, 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
-
Properties inherited from class javafx.scene.Parent
needsLayout
-
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
-
Properties inherited from class javafx.scene.chart.ValueAxis
lowerBound, minorTickCount, minorTickLength, minorTickVisible, scale, tickLabelFormatter, upperBound
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 描述 static class
NumberAxis.DefaultFormatter
NumberAxis的默认数字格式化程序,与自动量程保持同步,并适当地格式化值。-
Nested classes/interfaces inherited from class javafx.scene.chart.Axis
Axis.TickMark<T>
-
-
Field Summary
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
Fields inherited from class javafx.scene.chart.ValueAxis
currentLowerBound
-
-
构造方法摘要
构造方法 Constructor 描述 NumberAxis()
创建自动范围NumberAxis。NumberAxis(double lowerBound, double upperBound, double tickUnit)
使用给定的上限,下限和滴答单位创建非自动范围的NumberAxis。NumberAxis(String axisLabel, double lowerBound, double upperBound, double tickUnit)
用给定的下限,上限和滴答单位创建非自动范围的NumberAxis。
-
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 protected Object
autoRange(double minValue, double maxValue, double length, double labelSize)
被要求设置上限和下限以及需要自动调整的任何其他内容。protected List<Number>
calculateMinorTickMarks()
计算每个小刻度线的数据值列表protected List<Number>
calculateTickValues(double length, Object range)
计算范围内每个刻度线的所有数据值的列表BooleanProperty
forceZeroInRangeProperty()
当真实零值始终包含在可见范围内时。static List<CssMetaData<? extends Styleable,?>>
getClassCssMetaData()
List<CssMetaData<? extends Styleable,?>>
getCssMetaData()
该方法应该委托给Node.getClassCssMetaData()
,以便可以访问节点的CssMetaData而不需要反射。protected Object
getRange()
被称为获取当前的轴范围。protected String
getTickMarkLabel(Number value)
获取具有给定值的刻度线的字符串标签名称。double
getTickUnit()
获取属性tickUnit的值。boolean
isForceZeroInRange()
获取属性forceZeroInRange的值。protected Dimension2D
measureTickMarkSize(Number value, Object range)
测量给定刻度标记值的标签尺寸。void
setForceZeroInRange(boolean value)
设置属性forceZeroInRange的值。protected void
setRange(Object range, boolean animate)
调用将当前轴范围设置为给定范围。void
setTickUnit(double value)
设置属性tickUnit的值。DoubleProperty
tickUnitProperty()
数据单位中每个主要刻度线之间的值。-
Methods inherited from class javafx.scene.chart.Axis
animatedProperty, autoRangingProperty, computePrefHeight, computePrefWidth, getAnimated, getLabel, getSide, getTickLabelFill, getTickLabelFont, getTickLabelGap, getTickLabelRotation, getTickLength, getTickMarks, invalidateRange, isAutoRanging, isRangeValid, isTickLabelsVisible, isTickMarkVisible, labelProperty, measureTickMarkLabelSize, measureTickMarkSize, requestAxisLayout, requestLayout, setAnimated, setAutoRanging, setLabel, setSide, setTickLabelFill, setTickLabelFont, setTickLabelGap, setTickLabelRotation, setTickLabelsVisible, setTickLength, setTickMarkVisible, shouldAnimate, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty
-
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, 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, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setNeedsLayout, updateBounds
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, 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, widthProperty
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Methods inherited from class javafx.scene.chart.ValueAxis
autoRange, calculateNewScale, getDisplayPosition, getLowerBound, getMinorTickCount, getMinorTickLength, getScale, getTickLabelFormatter, getUpperBound, getValueForDisplay, getZeroPosition, invalidateRange, isMinorTickVisible, isValueOnAxis, layoutChildren, lowerBoundProperty, minorTickCountProperty, minorTickLengthProperty, minorTickVisibleProperty, scaleProperty, setLowerBound, setMinorTickCount, setMinorTickLength, setMinorTickVisible, setScale, setTickLabelFormatter, setUpperBound, tickLabelFormatterProperty, tickMarksUpdated, toNumericValue, toRealValue, upperBoundProperty
-
-
-
-
Property Detail
-
forceZeroInRange
public final BooleanProperty forceZeroInRangeProperty
当真实零值始终包含在可见范围内时。 这只有在自动量程打开时才有效果。
-
tickUnit
public final DoubleProperty tickUnitProperty
数据单位中每个主要刻度线之间的值。 如果我们是自动量程,这是自动设置的。- 另请参见:
-
getTickUnit()
,setTickUnit(double)
-
-
构造方法详细信息
-
NumberAxis
public NumberAxis()
创建自动范围NumberAxis。
-
NumberAxis
public NumberAxis(double lowerBound, double upperBound, double tickUnit)
使用给定的上限,下限和滴答单位创建非自动范围的NumberAxis。- 参数
-
lowerBound
- 该轴的下限,即最小可绘图值 -
upperBound
- 该轴的上限,即最大可绘图值 -
tickUnit
- 刻度单位,即刻度之间的空格
-
NumberAxis
public NumberAxis(String axisLabel, double lowerBound, double upperBound, double tickUnit)
用给定的下限,上限和滴答单位创建非自动范围的NumberAxis。- 参数
-
axisLabel
- 要显示此轴的名称 -
lowerBound
- 该轴的下限,即最小可绘图值 -
upperBound
- 此轴的上限,即最大可绘图值 -
tickUnit
- 刻度单位,即刻度之间的空格
-
-
方法详细信息
-
isForceZeroInRange
public final boolean isForceZeroInRange()
获取属性forceZeroInRange的值。- Property description:
- 当真实零值始终包含在可见范围内时。 这只有在自动量程打开时才有效果。
-
setForceZeroInRange
public final void setForceZeroInRange(boolean value)
设置属性forceZeroInRange的值。- Property description:
- 当真实零值始终包含在可见范围内时。 这只有在自动量程打开时才有效果。
-
forceZeroInRangeProperty
public final BooleanProperty forceZeroInRangeProperty()
当真实零值始终包含在可见范围内时。 这只有在自动量程打开时才有效果。
-
getTickUnit
public final double getTickUnit()
获取属性tickUnit的值。- Property description:
- 数据单位中每个主要刻度线之间的值。 如果我们是自动量程,这是自动设置的。
-
setTickUnit
public final void setTickUnit(double value)
设置属性tickUnit的值。- Property description:
- 数据单位中每个主要刻度线之间的值。 如果我们是自动量程,这是自动设置的。
-
tickUnitProperty
public final DoubleProperty tickUnitProperty()
数据单位中每个主要刻度线之间的值。 如果我们是自动量程,这是自动设置的。- 另请参见:
-
getTickUnit()
,setTickUnit(double)
-
getTickMarkLabel
protected String getTickMarkLabel(Number value)
获取具有给定值的刻度线的字符串标签名称。- Specified by:
-
getTickMarkLabel
在Axis<Number>
- 参数
-
value
- 要格式化为刻度标签字符串的值 - 结果
- 给定值的格式化字符串
-
getRange
protected Object getRange()
被称为获取当前的轴范围。
-
setRange
protected void setRange(Object range, boolean animate)
调用将当前轴范围设置为给定范围。 如果isAnimating()为true,那么此方法应将范围设置为新范围。
-
calculateTickValues
protected List<Number> calculateTickValues(double length, Object range)
计算范围内每个刻度线的所有数据值的列表- Specified by:
-
calculateTickValues
在Axis<Number>
- 参数
-
length
- 显示单位中轴的长度 -
range
- 从autoRange()返回的范围对象 - 结果
- 如果是给定长度,则可以沿轴线拟合的刻度线列表
-
calculateMinorTickMarks
protected List<Number> calculateMinorTickMarks()
计算每个小刻度线的数据值列表- Specified by:
-
calculateMinorTickMarks
在ValueAxis<Number>
- 结果
- 数据值列表,用于绘制小刻度线
-
measureTickMarkSize
protected Dimension2D measureTickMarkSize(Number value, Object range)
测量给定刻度标记值的标签尺寸。 这使用为刻度线设置的字体。- 重写:
-
measureTickMarkSize
在Axis<Number>
- 参数
-
value
- 刻度值 -
range
- 计算期间使用的范围 - 结果
- 给定值的刻度标签的大小
-
autoRange
protected Object autoRange(double minValue, double maxValue, double length, double labelSize)
被要求设置上限和下限以及需要自动调整的任何其他内容。
-
getClassCssMetaData
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
- 结果
- 与此类相关联的CssMetaData可能包括其类的CssMetaData。
- 从以下版本开始:
- JavaFX 8.0
-
getCssMetaData
public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
该方法应该委托给Node.getClassCssMetaData()
,以便可以访问Node的CssMetaData而不需要反射。- Specified by:
-
getCssMetaData
在接口Styleable
- 重写:
-
getCssMetaData
在ValueAxis<Number>
- 结果
- 与该节点相关联的CssMetaData,其可以包括其超类的CssMetaData。
- 从以下版本开始:
- JavaFX 8.0
-
-