Package de.gsi.chart.renderer.spi
Class GridRenderer
- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.layout.Pane
-
- de.gsi.chart.renderer.spi.GridRenderer
-
-
Constructor Summary
Constructors Constructor Description GridRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static void
applyGraphicsStyleFromLineStyle(javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Line style)
protected void
drawEuclideanGrid(javafx.scene.canvas.GraphicsContext gc, XYChart xyChart)
protected void
drawHorizontalMajorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis yAxis, double xAxisWidthSnapped, double yAxisHeight)
protected void
drawHorizontalMinorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis yAxis, double xAxisWidthSnapped, double yAxisHeight)
javafx.scene.canvas.Canvas
drawLegendSymbol(de.gsi.dataset.DataSet dataSet, int dsIndex, int width, int height)
javafx.beans.property.BooleanProperty
drawOnTopProperty()
Indicates whether grid lines should be drawn on top or beneath graphsprotected void
drawPolarCircle(javafx.scene.canvas.GraphicsContext gc, Axis yAxis, double yRange, double xCentre, double yCentre, double maxRadius)
protected void
drawPolarGrid(javafx.scene.canvas.GraphicsContext gc, XYChart xyChart)
protected void
drawVerticalMajorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis xAxis, double xAxisWidth, double yAxisHeightSnapped)
protected void
drawVerticalMinorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis xAxis, double xAxisWidth, double yAxisHeightSnapped)
javafx.collections.ObservableList<Axis>
getAxes()
java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>>
getCssMetaData()
javafx.collections.ObservableList<de.gsi.dataset.DataSet>
getDatasets()
javafx.collections.ObservableList<de.gsi.dataset.DataSet>
getDatasetsCopy()
javafx.scene.shape.Line
getHorizontalMajorGrid()
modify this to change drawing of horizontal major grid linesjavafx.scene.shape.Line
getHorizontalMinorGrid()
modify this to change drawing of horizontal minor grid linesjavafx.scene.shape.Line
getVerticalMajorGrid()
modify this to change drawing of vertical major grid linesjavafx.scene.shape.Line
getVerticalMinorGrid()
modify this to change drawing of vertical minor grid linesjavafx.beans.property.BooleanProperty
horizontalGridLinesVisibleProperty()
Indicates whether horizontal major grid lines are visible or not.javafx.beans.property.BooleanProperty
horizontalMinorGridLinesVisibleProperty()
Indicates whether horizontal minor grid lines are visible or not.boolean
isDrawOnTop()
Indicates whether grid lines should be drawn on top or beneath graphsjava.util.List<de.gsi.dataset.DataSet>
render(javafx.scene.canvas.GraphicsContext gc, Chart chart, int dataSetOffset, javafx.collections.ObservableList<de.gsi.dataset.DataSet> datasets)
void
setDrawOnTop(boolean state)
Indicates whether grid lines should be drawn on top or beneath graphsRenderer
setShowInLegend(boolean state)
Sets whether DataSets attached to this renderer shall be shown in the legendboolean
showInLegend()
Sets whether DataSets attached to this renderer shall be shown in the legendjavafx.beans.property.BooleanProperty
showInLegendProperty()
Sets whether DataSets attached to this renderer shall be shown in the legendjavafx.beans.property.BooleanProperty
verticalGridLinesVisibleProperty()
Indicates whether vertical major grid lines are visible or not.javafx.beans.property.BooleanProperty
verticalMinorGridLinesVisibleProperty()
Indicates whether vertical minor grid lines are visible or not.-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBackground, getBorder, getClassCssMetaData, 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, layoutChildren, 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
-
-
-
-
Field Detail
-
axesList
protected final javafx.collections.ObservableList<Axis> axesList
-
-
Method Detail
-
drawEuclideanGrid
protected void drawEuclideanGrid(javafx.scene.canvas.GraphicsContext gc, XYChart xyChart)
-
drawHorizontalMajorGridLines
protected void drawHorizontalMajorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis yAxis, double xAxisWidthSnapped, double yAxisHeight)
-
drawHorizontalMinorGridLines
protected void drawHorizontalMinorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis yAxis, double xAxisWidthSnapped, double yAxisHeight)
-
drawLegendSymbol
public javafx.scene.canvas.Canvas drawLegendSymbol(de.gsi.dataset.DataSet dataSet, int dsIndex, int width, int height)
- Specified by:
drawLegendSymbol
in interfaceRenderer
- Parameters:
dataSet
- the data set for which the representative icon should be generateddsIndex
- index within renderer setwidth
- requested width of the returning Canvasheight
- requested height of the returning Canvas- Returns:
- a graphical icon representation of the given data sets
-
drawOnTopProperty
public final javafx.beans.property.BooleanProperty drawOnTopProperty()
Indicates whether grid lines should be drawn on top or beneath graphs- Returns:
- drawOnTop property
-
drawPolarCircle
protected void drawPolarCircle(javafx.scene.canvas.GraphicsContext gc, Axis yAxis, double yRange, double xCentre, double yCentre, double maxRadius)
-
drawPolarGrid
protected void drawPolarGrid(javafx.scene.canvas.GraphicsContext gc, XYChart xyChart)
-
drawVerticalMajorGridLines
protected void drawVerticalMajorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis xAxis, double xAxisWidth, double yAxisHeightSnapped)
-
drawVerticalMinorGridLines
protected void drawVerticalMinorGridLines(javafx.scene.canvas.GraphicsContext gc, Axis xAxis, double xAxisWidth, double yAxisHeightSnapped)
-
getAxes
public javafx.collections.ObservableList<Axis> getAxes()
-
getCssMetaData
public java.util.List<javafx.css.CssMetaData<? extends javafx.css.Styleable,?>> getCssMetaData()
- Specified by:
getCssMetaData
in interfacejavafx.css.Styleable
- Overrides:
getCssMetaData
in classjavafx.scene.layout.Region
-
getDatasets
public javafx.collections.ObservableList<de.gsi.dataset.DataSet> getDatasets()
- Specified by:
getDatasets
in interfaceRenderer
-
getDatasetsCopy
public javafx.collections.ObservableList<de.gsi.dataset.DataSet> getDatasetsCopy()
- Specified by:
getDatasetsCopy
in interfaceRenderer
-
getHorizontalMajorGrid
public javafx.scene.shape.Line getHorizontalMajorGrid()
modify this to change drawing of horizontal major grid lines- Returns:
- the Line node to be styled
-
getHorizontalMinorGrid
public javafx.scene.shape.Line getHorizontalMinorGrid()
modify this to change drawing of horizontal minor grid lines- Returns:
- the Line node to be styled
-
getVerticalMajorGrid
public javafx.scene.shape.Line getVerticalMajorGrid()
modify this to change drawing of vertical major grid lines- Returns:
- the Line node to be styled
-
getVerticalMinorGrid
public javafx.scene.shape.Line getVerticalMinorGrid()
modify this to change drawing of vertical minor grid lines- Returns:
- the Line node to be styled
-
horizontalGridLinesVisibleProperty
public final javafx.beans.property.BooleanProperty horizontalGridLinesVisibleProperty()
Indicates whether horizontal major grid lines are visible or not.- Returns:
- verticalGridLinesVisible property
-
horizontalMinorGridLinesVisibleProperty
public final javafx.beans.property.BooleanProperty horizontalMinorGridLinesVisibleProperty()
Indicates whether horizontal minor grid lines are visible or not.- Returns:
- verticalGridLinesVisible property
-
isDrawOnTop
public final boolean isDrawOnTop()
Indicates whether grid lines should be drawn on top or beneath graphs- Returns:
- drawOnTop state
-
render
public java.util.List<de.gsi.dataset.DataSet> render(javafx.scene.canvas.GraphicsContext gc, Chart chart, int dataSetOffset, javafx.collections.ObservableList<de.gsi.dataset.DataSet> datasets)
- Specified by:
render
in interfaceRenderer
- Parameters:
gc
- the Canvas' GraphicsContext the renderer should draw uponchart
- the corresponding chartdataSetOffset
- global offset of the last drawn DataSetdatasets
- list of globally (ie. in Chart) stored DataSets- Returns:
- List of drawn DataSets (N.B. return '0' in case
Renderer.showInLegend()
is false)
-
setDrawOnTop
public final void setDrawOnTop(boolean state)
Indicates whether grid lines should be drawn on top or beneath graphs- Parameters:
state
- true: draw on top
-
setShowInLegend
public Renderer setShowInLegend(boolean state)
Description copied from interface:Renderer
Sets whether DataSets attached to this renderer shall be shown in the legend- Specified by:
setShowInLegend
in interfaceRenderer
- Parameters:
state
- true (default) if data sets are supposed to be drawn- Returns:
- the renderer class
-
showInLegend
public boolean showInLegend()
Description copied from interface:Renderer
Sets whether DataSets attached to this renderer shall be shown in the legend- Specified by:
showInLegend
in interfaceRenderer
- Returns:
- true (default) if data sets are supposed to be drawn
-
showInLegendProperty
public javafx.beans.property.BooleanProperty showInLegendProperty()
Description copied from interface:Renderer
Sets whether DataSets attached to this renderer shall be shown in the legend- Specified by:
showInLegendProperty
in interfaceRenderer
- Returns:
- true (default) if data sets are supposed to be drawn
-
verticalGridLinesVisibleProperty
public final javafx.beans.property.BooleanProperty verticalGridLinesVisibleProperty()
Indicates whether vertical major grid lines are visible or not.- Returns:
- verticalGridLinesVisible property
-
verticalMinorGridLinesVisibleProperty
public final javafx.beans.property.BooleanProperty verticalMinorGridLinesVisibleProperty()
Indicates whether vertical minor grid lines are visible or not.- Returns:
- verticalGridLinesVisible property
-
applyGraphicsStyleFromLineStyle
protected static void applyGraphicsStyleFromLineStyle(javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Line style)
-
-