Package de.gsi.chart.plugins
Class AbstractValueIndicator
- java.lang.Object
-
- de.gsi.chart.plugins.ChartPlugin
-
- de.gsi.chart.plugins.AbstractValueIndicator
-
- Direct Known Subclasses:
AbstractRangeValueIndicator,AbstractSingleValueIndicator
public abstract class AbstractValueIndicator extends ChartPlugin
Base class for plugins indicating a specific value or range of values on aChartwith an optionaltext labeldescription.- Author:
- mhrabia
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractValueIndicator.Delta
-
Field Summary
Fields Modifier and Type Field Description protected AbstractValueIndicator.DeltadragDeltaprotected javafx.beans.property.BooleanPropertyeditableIndicatorprotected javafx.scene.control.Labellabel
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractValueIndicator(Axis axis, java.lang.String text)Creates a new instance of the indicator.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddChildNodeIfNotPresent(javafx.scene.Node node)javafx.beans.property.BooleanPropertyeditableIndicatorProperty()whether this plugin is editablejavafx.geometry.HPosgetLabelHorizontalAnchor()Returns the value of thelabelHorizontalAnchorProperty().javafx.geometry.VPosgetLabelVerticalAnchor()Returns the value of thelabelVerticalAnchorProperty().protected AxisgetNumericAxis()Returns the ValueAxis that this indicator is associated with.java.lang.StringgetText()Returns the value of thetextProperty().booleanisEditable()javafx.beans.property.ObjectProperty<javafx.geometry.HPos>labelHorizontalAnchorProperty()Specifies anchor of thetext labelwith respect to the horizontal label position i.e.javafx.beans.property.ObjectProperty<javafx.geometry.VPos>labelVerticalAnchorProperty()Specifies anchor of thetext labelwith respect to the vertical label position i.e.protected voidlayoutLabel(javafx.geometry.Bounds bounds, double hPos, double vPos)Layouts the label within specified bounds and given horizontal and vertical position, taking into accounthorizontalandverticalanchor.voidsetEditable(boolean newState)Sets the state whether this plugin is editablevoidsetLabelHorizontalAnchor(javafx.geometry.HPos anchor)Sets the value of thelabelHorizontalAnchorProperty().voidsetLabelVerticalAnchor(javafx.geometry.VPos anchor)Sets the value of thelabelVerticalAnchorProperty().voidsetStyleClasses(javafx.scene.Node node, java.lang.String prefix, java.lang.String root)voidsetText(java.lang.String text)Sets the value of thetextProperty().javafx.beans.property.StringPropertytextProperty()Text to be displayed by the label.abstract voidupdateStyleClass()There might be several instances of a given indicator class.-
Methods inherited from class de.gsi.chart.plugins.ChartPlugin
addButtonsToToolBarProperty, chartProperty, getChart, getChartChildren, getLocationInPlotArea, isAddButtonsToToolBar, layoutChildren, registerInputEventHandler, setAddButtonsToToolBar, setChart, toDataPoint, toDisplayPoint
-
-
-
-
Field Detail
-
label
protected final javafx.scene.control.Label label
-
dragDelta
protected final AbstractValueIndicator.Delta dragDelta
-
editableIndicator
protected final javafx.beans.property.BooleanProperty editableIndicator
-
-
Constructor Detail
-
AbstractValueIndicator
protected AbstractValueIndicator(Axis axis, java.lang.String text)
Creates a new instance of the indicator.- Parameters:
axis- the axis this indicator is associated withtext- the text to be shown by the label. Value oftextProperty().
-
-
Method Detail
-
addChildNodeIfNotPresent
protected void addChildNodeIfNotPresent(javafx.scene.Node node)
-
editableIndicatorProperty
public final javafx.beans.property.BooleanProperty editableIndicatorProperty()
whether this plugin is editable- Returns:
- boolean property
-
getLabelHorizontalAnchor
public final javafx.geometry.HPos getLabelHorizontalAnchor()
Returns the value of thelabelHorizontalAnchorProperty().- Returns:
- value of the labelHorizontalAnchor property
-
getLabelVerticalAnchor
public final javafx.geometry.VPos getLabelVerticalAnchor()
Returns the value of thelabelVerticalAnchorProperty().- Returns:
- value of the labelVerticalAnchor property
-
getNumericAxis
protected Axis getNumericAxis()
Returns the ValueAxis that this indicator is associated with.- Returns:
- associated ValueAxis
-
getText
public final java.lang.String getText()
Returns the value of thetextProperty().- Returns:
- text displayed within or next to the indicator
-
isEditable
public final boolean isEditable()
- Returns:
- whether this plugin is editable
-
labelHorizontalAnchorProperty
public final javafx.beans.property.ObjectProperty<javafx.geometry.HPos> labelHorizontalAnchorProperty()
Specifies anchor of thetext labelwith respect to the horizontal label position i.e. it describes whether the position is related to the LEFT, CENTER or RIGHT side of the label. The position itself should be specified by the extending classes.Default value:
HPos.CENTER- Returns:
- labelHorizontalAnchor property
-
labelVerticalAnchorProperty
public final javafx.beans.property.ObjectProperty<javafx.geometry.VPos> labelVerticalAnchorProperty()
Specifies anchor of thetext labelwith respect to the vertical label position i.e. it describes whether the position is related to the TOP, CENTER, BASELINE or BOTTOM of of the label. The position itself should be specified by the extending classes.Default value:
VPos.CENTER- Returns:
- labelVerticalAnchor property
-
layoutLabel
protected final void layoutLabel(javafx.geometry.Bounds bounds, double hPos, double vPos)Layouts the label within specified bounds and given horizontal and vertical position, taking into accounthorizontalandverticalanchor.- Parameters:
bounds- the bounding rectangle with respect to which the label should be positionedhPos- relative [0, 1] horizontal position of the label within the boundsvPos- relative [0, 1] vertical position of the label within the bounds
-
setEditable
public final void setEditable(boolean newState)
Sets the state whether this plugin is editable- Parameters:
newState- true: edits are allowed
-
setLabelHorizontalAnchor
public final void setLabelHorizontalAnchor(javafx.geometry.HPos anchor)
Sets the value of thelabelHorizontalAnchorProperty().- Parameters:
anchor- new anchor
-
setLabelVerticalAnchor
public final void setLabelVerticalAnchor(javafx.geometry.VPos anchor)
Sets the value of thelabelVerticalAnchorProperty().- Parameters:
anchor- new anchor
-
setStyleClasses
public void setStyleClasses(javafx.scene.Node node, java.lang.String prefix, java.lang.String root)
-
setText
public final void setText(java.lang.String text)
Sets the value of thetextProperty().- Parameters:
text- the new text. Ifnull, the label will be hidden.
-
textProperty
public final javafx.beans.property.StringProperty textProperty()
Text to be displayed by the label. If set tonull, the label is not shown.- Returns:
- text of the indicator's label
-
updateStyleClass
public abstract void updateStyleClass()
There might be several instances of a given indicator class. If one wants to specify different CSS for each instance - we need a unique class name for each, so whenever the list of plugins changes, this method should update name of it's CSS class.
-
-