Package de.gsi.chart.axes.spi
Class ColorGradientAxis
- 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.ColorGradientAxis
-
- All Implemented Interfaces:
Axis,de.gsi.dataset.AxisDescription,de.gsi.dataset.event.EventSource,java.io.Serializable,javafx.css.Styleable,javafx.event.EventTarget
public class ColorGradientAxis extends DefaultNumericAxis
An Axis with a color gradient e.g. for use with HeatMap plots. By default this axis is excluded from the Zoomer Plugin. TODO: - Fix LEFT, CENTER_HOR/VERT - Reduce Boilerplate Code - Allow free Positioning? e.g legend style, outside of chart, ...- Author:
- Alexander Krimm
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.gsi.chart.axes.spi.DefaultNumericAxis
DefaultNumericAxis.Cache
-
-
Field Summary
Fields Modifier and Type Field Description protected javafx.scene.shape.RectanglegradientRect-
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
BURST_LIMIT_CSS_MS, labelOverlap, lock, MAX_NARROW_FONT_SCALE, maxLabelHeight, maxLabelWidth, MIN_NARROW_FONT_SCALE, RANGE_ANIMATION_DURATION_MS, scaleFont, tickMarkDoubleCache, tickMarkStringCache
-
Fields inherited from class de.gsi.chart.axes.spi.AbstractAxisParameter
cachedOffset, DEFAULT_MINOR_TICK_COUNT, isInvertedAxis, isTimeAxis, majorTickMarks, majorTickMarkValues, maxProp, minorTickMarks, minorTickMarkValues, minProp, oldAxisLength, oldAxisMax, oldAxisMin, oldTickUnit, scaleChangeListener, tickLabelRotation, tickUnit, valid
-
-
Constructor Summary
Constructors Constructor Description ColorGradientAxis(double lowerBound, double upperBound, double tickUnit)ColorGradientAxis(double lowerBound, double upperBound, double tickUnit, ColorGradient colorGradient)ColorGradientAxis(java.lang.String axisLabel)ColorGradientAxis(java.lang.String axisLabel, double lowerBound, double upperBound, double tickUnit)ColorGradientAxis(java.lang.String axisLabel, double lowerBound, double upperBound, double tickUnit, ColorGradient colorGradient)ColorGradientAxis(java.lang.String axisLabel, ColorGradient colorGradient)ColorGradientAxis(java.lang.String axisLabel, java.lang.String unit)ColorGradientAxis(java.lang.String axisLabel, java.lang.String unit, ColorGradient colorGradient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.property.ObjectProperty<ColorGradient>colorGradientProperty()Color gradient (linear) used to encode data point values.protected 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.voiddrawAxis(javafx.scene.canvas.GraphicsContext gc, double axisWidth, double axisHeight)Function allows custom drawing of axes outside the Axis environment (ie.protected voiddrawAxisLine(javafx.scene.canvas.GraphicsContext gc, double axisLength, double axisWidth, double axisHeight)javafx.scene.paint.ColorgetColor(double value)ColorGradientgetColorGradient()Returns the value of thecolorGradientProperty().doublegetGradientWidth()intgetIntColor(double value)Return the color for a value as an integer with the color values in its bytes.javafx.beans.property.DoublePropertygradientWidthProperty()voidsetColorGradient(ColorGradient value)Sets the value of thecolorGradientProperty().voidsetGradientWidth(double newGradientWidth)-
Methods inherited from class de.gsi.chart.axes.spi.DefaultNumericAxis
autoRange, calculateMajorTickValues, calculateMinorTickValues, clampBoundToZero, computePreferredTickUnit, computeRange, computeTickUnit, forceZeroInRangeProperty, getAxisTransform, getDisplayPosition, getEffectiveRange, getLogarithmBase, getLogAxisType, getValueForDisplay, getZeroPosition, isForceZeroInRange, isLogAxis, isValueOnAxis, logarithmBaseProperty, logAxisProperty, requestAxisLayout, setForceZeroInRange, setLogarithmBase, setLogAxis, updateCachedVariables
-
Methods inherited from class de.gsi.chart.axes.spi.AbstractAxis
autoRange, axisLabelFormatterProperty, calculateNewScale, clearAxisCanvas, computeTickMarks, drawAxisLabel, drawAxisLabel, drawAxisPost, drawAxisPre, drawTickLabels, drawTickMarkLabel, drawTickMarks, fireInvalidated, forceRedraw, getAxisLabelFormatter, getAxisRange, getCanvas, getGraphicsContext, getNewTickMark, getTickMarkLabel, invalidateCaches, invalidateRange, isLabelOverlapping, 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, axisCenterPositionProperty, axisLabelGapProperty, axisLabelTextAlignmentProperty, axisPaddingProperty, clear, contains, dimIndexProperty, equalString, getAnimationDuration, getAutoRange, getAutoRangePadding, getAxisCenterPosition, getAxisLabel, getAxisLabelGap, getAxisLabelTextAlignment, getAxisPadding, getClassCssMetaData, getCssMetaData, getDimIndex, getLength, getMajorTickStyle, getMax, getMaxMajorTickLabelCount, getMin, getMinorTickCount, getMinorTickLength, getMinorTickMarks, getMinorTickMarkValues, getMinorTickStyle, getName, getOverlapPolicy, getRange, getScale, getSide, getTickLabelFill, getTickLabelFont, getTickLabelFormatter, getTickLabelGap, getTickLabelRotation, getTickLabelSpacing, getTickLength, getTickMarks, getTickMarkValues, getTickUnit, getUnit, getUnitScaling, getUserRange, invalidate, invertAxis, invertAxisProperty, invokeListener, isAnimated, isAutoGrowRanging, isAutoRangeRounding, isAutoRanging, isAutoUnitScaling, isDefined, isInvertedAxis, isMinorTickVisible, isTickLabelsVisible, isTickMarkVisible, isTimeAxis, isValid, maxMajorTickLabelCountProperty, maxProperty, minorTickCountProperty, minorTickLengthProperty, minorTickVisibleProperty, minProperty, nameProperty, overlapPolicyProperty, scaleProperty, set, set, set, setAnimated, setAnimationDuration, setAutoGrowRanging, setAutoRangePadding, setAutoRangeRounding, setAutoRanging, setAutoUnitScaling, setAxisCenterPosition, setAxisLabelGap, setAxisLabelTextAlignment, setAxisPadding, setDimIndex, setMaxMajorTickLabelCount, setMinorTickCount, setMinorTickLength, setMinorTickVisible, setName, setOverlapPolicy, setScale, setSide, setTickLabelFill, setTickLabelFont, setTickLabelFormatter, setTickLabelGap, setTickLabelRotation, setTickLabelSpacing, setTickLabelsVisible, setTickLength, setTickMarkVisible, setTickUnit, setTimeAxis, setUnit, setUnitScaling, setUnitScaling, sideProperty, tickLabelFillProperty, tickLabelFontProperty, tickLabelFormatterProperty, tickLabelGapProperty, tickLabelRotationProperty, tickLabelSpacingProperty, tickLabelsVisibleProperty, tickLengthProperty, tickMarkVisibleProperty, tickUnitProperty, timeAxisProperty, unitProperty, unitScalingProperty, updateAxisLabelAndUnit, updateEventListener, updateScaleAndUnitPrefix, validProperty
-
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, forceRedraw, getAutoRange, getCanvas, getHeight, getLength, getMinorTickCount, getMinorTickMarks, getRange, getSide, getTickLabelFill, getTickLabelFont, getTickLabelFormatter, getTickLabelGap, getTickLabelSpacing, 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, getDimIndex, getMax, getMin, getName, getUnit, isDefined, set, set, set, set, setMax, setMin
-
-
-
-
Constructor Detail
-
ColorGradientAxis
public ColorGradientAxis(double lowerBound, double upperBound, double tickUnit)- Parameters:
lowerBound- the mininum axis valueupperBound- the maximum axis valuetickUnit- the default user-defined tick-unit
-
ColorGradientAxis
public ColorGradientAxis(double lowerBound, double upperBound, double tickUnit, ColorGradient colorGradient)
-
ColorGradientAxis
public ColorGradientAxis(java.lang.String axisLabel)
- Parameters:
axisLabel- axis title
-
ColorGradientAxis
public ColorGradientAxis(java.lang.String axisLabel, ColorGradient colorGradient)
-
ColorGradientAxis
public ColorGradientAxis(java.lang.String axisLabel, double lowerBound, double upperBound, double tickUnit)- Parameters:
axisLabel- the axis titlelowerBound- the minimum axis rangeupperBound- the maximum axis rangetickUnit- the user-defined tick-unit
-
ColorGradientAxis
public ColorGradientAxis(java.lang.String axisLabel, double lowerBound, double upperBound, double tickUnit, ColorGradient colorGradient)
-
ColorGradientAxis
public ColorGradientAxis(java.lang.String axisLabel, java.lang.String unit)- Parameters:
axisLabel- the axis titleunit- the unit label, e.g. 'm' or 's' please use SI-style units
-
ColorGradientAxis
public ColorGradientAxis(java.lang.String axisLabel, java.lang.String unit, ColorGradient colorGradient)
-
-
Method Detail
-
colorGradientProperty
public javafx.beans.property.ObjectProperty<ColorGradient> colorGradientProperty()
Color gradient (linear) used to encode data point values.- Returns:
- gradient property
-
computePrefHeight
protected double computePrefHeight(double width)
Description copied from class:AbstractAxisComputes 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 classAbstractAxis- Returns:
- the computed preferred width for this axis
-
computePrefWidth
protected double computePrefWidth(double height)
Description copied from class:AbstractAxisComputes 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 classAbstractAxis- Returns:
- the computed preferred width for this axis
-
drawAxis
public void drawAxis(javafx.scene.canvas.GraphicsContext gc, double axisWidth, double axisHeight)Description copied from interface:AxisFunction allows custom drawing of axes outside the Axis environment (ie. on another canvas)- Specified by:
drawAxisin interfaceAxis- Overrides:
drawAxisin classAbstractAxis- Parameters:
gc- the graphic context on which the axis is to be drawnaxisWidth- the axis width in pixel (N.B. padding is being added)axisHeight- the axis height in pixel (N.B. padding is being added)
-
drawAxisLine
protected void drawAxisLine(javafx.scene.canvas.GraphicsContext gc, double axisLength, double axisWidth, double axisHeight)- Overrides:
drawAxisLinein classAbstractAxis
-
getColor
public javafx.scene.paint.Color getColor(double value)
- Parameters:
value- z-Value, values outside of the visible limit are clamped to the extrema- Returns:
- the color representing the input value on the z-Axis
-
getColorGradient
public ColorGradient getColorGradient()
Returns the value of thecolorGradientProperty().- Returns:
- the color gradient used for encoding data values
-
getGradientWidth
public double getGradientWidth()
-
getIntColor
public int getIntColor(double value)
Return the color for a value as an integer with the color values in its bytes. For use e.g. with an IntBuffer backed PixelBuffer.- Parameters:
value- z-Value- Returns:
- integer with one byte each set to alpha, red, green, blue
-
gradientWidthProperty
public javafx.beans.property.DoubleProperty gradientWidthProperty()
-
setColorGradient
public void setColorGradient(ColorGradient value)
Sets the value of thecolorGradientProperty().- Parameters:
value- the gradient to be used
-
setGradientWidth
public void setGradientWidth(double newGradientWidth)
-
-