Package de.gsi.chart.axes.spi
Class CategoryAxis
- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.layout.Pane
-
- de.gsi.chart.axes.spi.AbstractAxisParameter
-
- de.gsi.chart.axes.spi.AbstractAxis
-
- de.gsi.chart.axes.spi.DefaultNumericAxis
-
- de.gsi.chart.axes.spi.CategoryAxis
-
- All Implemented Interfaces:
Axis,de.gsi.dataset.AxisDescription,de.gsi.dataset.event.EventSource,javafx.css.Styleable,javafx.event.EventTarget
public final class CategoryAxis extends DefaultNumericAxis
A axis implementation that will works on string categories where each value as a unique category(tick mark) along the axis.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.gsi.chart.axes.spi.DefaultNumericAxis
DefaultNumericAxis.Cache
-
-
Field Summary
-
Fields inherited from class de.gsi.chart.axes.spi.DefaultNumericAxis
DEFAULT_LOG_MIN_VALUE, isLogAxis, isUpdating
-
Fields inherited from class de.gsi.chart.axes.spi.AbstractAxis
animator, BURST_LIMIT_CSS_MS, cachedOffset, currentLowerBound, labelOverlap, lock, MAX_NARROW_FONT_SCALE, maxLabelHeight, maxLabelWidth, MIN_NARROW_FONT_SCALE, RANGE_ANIMATION_DURATION_MS, scaleFont, tickMarkDoubleCache, tickMarkSizeCache, tickMarkStringCache
-
Fields inherited from class de.gsi.chart.axes.spi.AbstractAxisParameter
autoRange, axisLabel, DEFAULT_MINOR_TICK_COUNT, isInvertedAxis, isTimeAxis, majorTickMarks, majorTickStyle, maxProp, measureInvalid, minorTickMarks, minorTickStyle, minProp, oldAxisLength, rangeValid, scaleBinding, tickLabelRotation, tickLabelsVisibleInvalid, tickUnit, userRange
-
-
Constructor Summary
Constructors Constructor Description CategoryAxis()Create a auto-ranging category axis with an empty list of categories.CategoryAxis(java.lang.String axisLabel)Create anon-auto-rangingAxis with the given upper bound, lower bound and tick unit.CategoryAxis(java.lang.String axisLabel, javafx.collections.ObservableList<java.lang.String> categories)Create anon-auto-rangingAxis with the given upper bound, lower bound and tick unit.CategoryAxis(javafx.collections.ObservableList<java.lang.String> categories)Create a category axis with the given categories.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AxisRangeautoRange(double minValue, double maxValue, double length, double labelSize)We suppress requestLayout() calls here by doing nothing as we don't want changes to our children to cause layout.protected java.util.List<java.lang.Double>calculateMinorTickValues()Calculate a list of the data values for every minor tick markprotected doublecomputeTickUnit(double rawTickUnit)javafx.collections.ObservableList<java.lang.String>getCategories()Returns aObservableListof categories plotted on this axis.voidsetCategories(java.util.List<java.lang.String> categories)voidsetCategories(javafx.collections.ObservableList<java.lang.String> categoryList)The ordered list of categories plotted on this axis.booleanupdateCategories(de.gsi.dataset.DataSet dataSet)Update the categories based on the data labels attached to the DataSet values-
Methods inherited from class de.gsi.chart.axes.spi.DefaultNumericAxis
calculateMajorTickValues, clampBoundToZero, computePreferredTickUnit, computeRange, forceZeroInRangeProperty, getAxisTransform, getDisplayPosition, getEffectiveRange, getLogarithmBase, getLogAxisType, getValueForDisplay, getZeroPosition, isForceZeroInRange, isLogAxis, isValueOnAxis, logarithmBaseProperty, logAxisProperty, requestAxisLayout, setForceZeroInRange, setLogarithmBase, setLogAxis, setRange, updateCachedVariables
-
Methods inherited from class de.gsi.chart.axes.spi.AbstractAxis
autoRange, axisLabelFormatterProperty, calculateNewScale, clearAxisCanvas, computePrefHeight, computePrefWidth, computeTickMarks, drawAxis, drawAxisLabel, drawAxisLabel, drawAxisLine, drawAxisPost, drawAxisPre, drawTickLabels, drawTickMarkLabel, drawTickMarks, fireInvalidated, forceRedraw, getAxisLabelFormatter, getAxisRange, getCanvas, getGraphicsContext, getMaxTickLabelHeight, getMaxTickLabelWidth, getNewTickMark, getTickMarkLabel, invalidateRange, invalidateRange, isLabelOverlapping, isRangeValid, layoutChildren, measureTickMarkLength, recomputeTickMarks, recomputeTickMarks, setAxisLabelFormatter, setMax, setMin, shouldAnimate, snap, tickMarksUpdated, updateCSS
-
Methods inherited from class de.gsi.chart.axes.spi.AbstractAxisParameter
add, add, animatedProperty, animationDurationProperty, autoGrowRangingProperty, autoNotification, autoRangePaddingProperty, autoRangeRoundingProperty, autoRangingProperty, autoUnitScalingProperty, axisLabelGapProperty, axisLabelTextAlignmentProperty, axisPaddingProperty, centerAxisPositionProperty, clear, contains, decadeRange, getaAxisLabelTextAlignment, getAnimationDuration, getAutoRange, getAutoRangePadding, getAxisLabel, getAxisLabelGap, getAxisPadding, getCenterAxisPosition, getClassCssMetaData, getCssMetaData, getLength, getMajorTickStyle, getMax, getMaxMaxjorTickLabelCount, getMin, getMinorTickCount, getMinorTickLength, getMinorTickMarks, getMinorTickStyle, getName, getOverlapPolicy, getRange, getScale, getSide, getTickLabelFill, getTickLabelFont, getTickLabelFormatter, getTickLabelGap, getTickLabelRotation, getTickLength, getTickMarks, getTickUnit, getUnit, getUnitScaling, getUserRange, invertAxis, invertAxisProperty, invokeListener, isAnimated, isAutoGrowRanging, isAutoRangeRounding, isAutoRanging, isAutoUnitScaling, isDefined, isInvertedAxis, isMinorTickVisible, isTickLabelsVisible, isTickMarkVisible, isTimeAxis, maxMajorTickLabelCountProperty, maxProperty, minorTickCountProperty, minorTickLengthProperty, minorTickVisibleProperty, minProperty, nameProperty, overlapPolicyProperty, scaleProperty, set, set, set, setAnimated, setAnimationDuration, setAutoGrowRanging, setAutoRangePadding, setAutoRangeRounding, setAutoRanging, setAutoUnitScaling, setAxisCentrePosition, setAxisLabelAlignment, setAxisLabelGap, setAxisPadding, setMaxMajorTickLabelCount, setMinorTickCount, setMinorTickLength, setMinorTickVisible, setName, setOverlapPolicy, setScale, setSide, setTickLabelFill, setTickLabelFont, setTickLabelFormatter, setTickLabelGap, setTickLabelRotation, setTickLabelsVisible, setTickLength, setTickMarkVisible, setTickUnit, setTimeAxis, setUnit, setUnitScaling, setUnitScaling, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelFormatterProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty, tickUnitProperty, timeAxisProperty, unitProperty, unitScalingProperty, updateAxisLabelAndUnit, updateEventListener, updateScaleAndUnitPrefix
-
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 class javafx.scene.Parent
getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
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 interface de.gsi.chart.axes.Axis
autoGrowRangingProperty, autoRangingProperty, autoUnitScalingProperty, drawAxis, forceRedraw, getAutoRange, getHeight, getLength, getMinorTickCount, getMinorTickMarks, getRange, getSide, getTickLabelFill, getTickLabelFont, getTickLabelFormatter, getTickLabelGap, getTickMarkLabel, getTickMarks, getTickUnit, getUnitScaling, getUserRange, getWidth, invalidateRange, invertAxis, invertAxisProperty, invokeListener, isAutoGrowRanging, isAutoRanging, isAutoUnitScaling, isInvertedAxis, isTimeAxis, maxProperty, minProperty, nameProperty, setAnimated, setAutoGrowRanging, setAutoRanging, setAutoUnitScaling, setName, setSide, setTickUnit, setTimeAxis, setUnit, setUnitScaling, setUnitScaling, sideProperty, tickUnitProperty, timeAxisProperty, unitProperty, unitScalingProperty
-
Methods inherited from interface de.gsi.dataset.AxisDescription
add, add, add, clear, contains, getMax, getMin, getName, getUnit, isDefined, set, set, set, set, setMax, setMin
-
-
-
-
Constructor Detail
-
CategoryAxis
public CategoryAxis()
Create a auto-ranging category axis with an empty list of categories.
-
CategoryAxis
public CategoryAxis(javafx.collections.ObservableList<java.lang.String> categories)
Create a category axis with the given categories. This will not auto-range but be fixed with the given categories.- Parameters:
categories- List of the categories for this axis
-
CategoryAxis
public CategoryAxis(java.lang.String axisLabel)
Create anon-auto-rangingAxis with the given upper bound, lower bound and tick unit.- Parameters:
axisLabel- the axislabel
-
CategoryAxis
public CategoryAxis(java.lang.String axisLabel, javafx.collections.ObservableList<java.lang.String> categories)Create anon-auto-rangingAxis with the given upper bound, lower bound and tick unit.- Parameters:
axisLabel- the axislabelcategories- List of the categories for this axis
-
-
Method Detail
-
autoRange
protected AxisRange autoRange(double minValue, double maxValue, double length, double labelSize)
Description copied from class:AbstractAxisWe 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(). TODO: re-enable- Overrides:
autoRangein classDefaultNumericAxis
-
calculateMinorTickValues
protected java.util.List<java.lang.Double> calculateMinorTickValues()
Description copied from class:AbstractAxisCalculate a list of the data values for every minor tick mark- Overrides:
calculateMinorTickValuesin classDefaultNumericAxis- Returns:
- List of data values where to draw minor tick marks
-
computeTickUnit
protected double computeTickUnit(double rawTickUnit)
- Overrides:
computeTickUnitin classDefaultNumericAxis
-
getCategories
public javafx.collections.ObservableList<java.lang.String> getCategories()
Returns aObservableListof categories plotted on this axis.- Returns:
- ObservableList of categories for this axis.
- See Also:
categories
-
setCategories
public void setCategories(java.util.List<java.lang.String> categories)
- Parameters:
categories- list of strings
-
setCategories
public void setCategories(javafx.collections.ObservableList<java.lang.String> categoryList)
The ordered list of categories plotted on this axis. This is set automatically based on the charts data if autoRanging is true. If the application sets the categories then auto ranging is turned off. If there is an attempt to add duplicate entry into this list, anIllegalArgumentExceptionis thrown. setting the category via axis forces the axis' category, setting the axis categories to null forces the dataset's category- Parameters:
categoryList- the category list
-
updateCategories
public boolean updateCategories(de.gsi.dataset.DataSet dataSet)
Update the categories based on the data labels attached to the DataSet values- Parameters:
dataSet- data set from which the data labels are used as category- Returns:
- true is categories were modified, false, false otherwise
-
-