Package de.gsi.chart.plugins
Class ChartOverlay
- java.lang.Object
-
- de.gsi.chart.plugins.ChartPlugin
-
- de.gsi.chart.plugins.ChartOverlay
-
public class ChartOverlay extends ChartPlugin
Plugin that overlayschart paneor chart'splot areawith given node i.e. the bounds of the node are set to cover the indicated area.Typically the node would be a an instance of
Panecontaining child nodes. The example below shows how to add a Label to the chart pane, located in the left top corner of the plot area:XYChartPane<Number, Number> chartPane = ...; Label label = new Label("Info about chart data"); AnchorPane.setTopAnchor(label, 5.0); AnchorPane.setLeftAnchor(label, 5.0); AnchorPane anchorPane = new AnchorPane(label); // Pass any mouse events to the underlying chart anchorPane.setMouseTransparent(true); chartPane.getPlugins().add(new ChartOverlay<>(OverlayArea.PLOT_AREA, anchorPane));- Author:
- Grzegorz Kruk
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classChartOverlay.OverlayAreaDefines possible areas to be overlaid.
-
Constructor Summary
Constructors Constructor Description ChartOverlay(ChartOverlay.OverlayArea area)Creates a new, emptyChartOverlay, initialized to overlay the specified area.ChartOverlay(ChartOverlay.OverlayArea area, javafx.scene.Node node)Creates a newChartOverlay, initialized to overlay the specified area with given node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.scene.NodegetNode()Returns the value of thenodeProperty().ChartOverlay.OverlayAreagetOverlayArea()Returns the value of theoverlayAreaProperty().voidlayoutChildren()Optional method that allows the plug-in to react in case the size of the chart that it belongs to has changed.javafx.beans.property.ObjectProperty<javafx.scene.Node>nodeProperty()The node to be overlaid on top of theoverlay area.javafx.beans.property.ObjectProperty<ChartOverlay.OverlayArea>overlayAreaProperty()Specifies theChartOverlay.OverlayAreato be covered by thenode.voidsetNode(javafx.scene.Node newNode)Sets the value of thenodeProperty().voidsetOverlayArea(ChartOverlay.OverlayArea area)Sets the value of theoverlayAreaProperty().-
Methods inherited from class de.gsi.chart.plugins.ChartPlugin
addButtonsToToolBarProperty, chartProperty, getChart, getChartChildren, getLocationInPlotArea, isAddButtonsToToolBar, registerInputEventHandler, setAddButtonsToToolBar, setChart, toDataPoint, toDisplayPoint
-
-
-
-
Constructor Detail
-
ChartOverlay
public ChartOverlay(ChartOverlay.OverlayArea area)
Creates a new, emptyChartOverlay, initialized to overlay the specified area.- Parameters:
area- value ofoverlayAreaProperty()
-
ChartOverlay
public ChartOverlay(ChartOverlay.OverlayArea area, javafx.scene.Node node)
Creates a newChartOverlay, initialized to overlay the specified area with given node.- Parameters:
area- value ofoverlayAreaProperty()node- value of thenodeProperty()
-
-
Method Detail
-
getNode
public final javafx.scene.Node getNode()
Returns the value of thenodeProperty().- Returns:
- the node to be overlaid
-
getOverlayArea
public final ChartOverlay.OverlayArea getOverlayArea()
Returns the value of theoverlayAreaProperty().- Returns:
- the overlay area to be covered by the node
-
layoutChildren
public void layoutChildren()
Description copied from class:ChartPluginOptional method that allows the plug-in to react in case the size of the chart that it belongs to has changed.- Overrides:
layoutChildrenin classChartPlugin
-
nodeProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> nodeProperty()
The node to be overlaid on top of theoverlay area.- Returns:
- the node property
-
overlayAreaProperty
public final javafx.beans.property.ObjectProperty<ChartOverlay.OverlayArea> overlayAreaProperty()
Specifies theChartOverlay.OverlayAreato be covered by thenode.- Returns:
- overlayArea property
-
setNode
public final void setNode(javafx.scene.Node newNode)
Sets the value of thenodeProperty().- Parameters:
newNode- the node to overlaid
-
setOverlayArea
public final void setOverlayArea(ChartOverlay.OverlayArea area)
Sets the value of theoverlayAreaProperty().- Parameters:
area- the area to be covered
-
-