public class JFXChartUtil extends Object
Constructor and Description |
---|
JFXChartUtil() |
Modifier and Type | Method and Description |
---|---|
static javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
addDoublePrimaryClickAutoRangeHandler(javafx.scene.chart.XYChart<?,?> chart)
Calls
addDoublePrimaryClickAutoRangeHandler(XYChart, Node) with the chart as the target. |
static javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
addDoublePrimaryClickAutoRangeHandler(javafx.scene.chart.XYChart<?,?> chart,
javafx.scene.Node target)
Adds a handler that sets X and/or Y axis auto ranging when the primary mouse button is double-clicked.
|
static javafx.event.EventHandler<javafx.scene.input.MouseEvent> |
getDoublePrimaryClickAutoRangeHandler(XYChartInfo chartInfo)
Returns an
EventHandler that sets X and/or Y axis auto ranging when the primary mouse button is
double-clicked. |
static javafx.scene.layout.Region |
setupZooming(javafx.scene.chart.XYChart<?,?> chart)
Sets up zooming via the
setupZooming(XYChart, EventHandler) method by using the
ChartZoomManager 's default filter . |
static javafx.scene.layout.Region |
setupZooming(javafx.scene.chart.XYChart<?,?> chart,
javafx.event.EventHandler<? super javafx.scene.input.MouseEvent> mouseFilter)
Convenience method for simple and default setup of zooming on an
XYChart via a
ChartZoomManager . |
public static javafx.scene.layout.Region setupZooming(javafx.scene.chart.XYChart<?,?> chart)
setupZooming(XYChart, EventHandler)
method by using the
ChartZoomManager
's default filter
.public static javafx.scene.layout.Region setupZooming(javafx.scene.chart.XYChart<?,?> chart, javafx.event.EventHandler<? super javafx.scene.input.MouseEvent> mouseFilter)
XYChart
via a
ChartZoomManager
. Wraps the chart in the components required to implement zooming. The
current implementation wraps the chart in a StackPane, which has the chart and a blue
translucent rectangle as children. Returns the top level of the created components.
If the chart already has a parent, that parent must be a Pane
, and the chart is
replaced with the wrapping region, and the return value could be ignored. If the chart does
not have a parent, the same wrapping node is returned, which will need to be added to some
parent.
The chart's axes must both be a type of ValueAxis.
The wrapping logic does not seem to be perfect, in fact there is a special case to handle
BorderPane
s. If it's not found to be reliable, then create the wrapping components
yourself (such as in the FXML), or setup zooming before adding it to a parent.
mouseFilter
- EventHandler that consumes events that should not trigger a zoom actionpublic static javafx.event.EventHandler<javafx.scene.input.MouseEvent> addDoublePrimaryClickAutoRangeHandler(javafx.scene.chart.XYChart<?,?> chart)
addDoublePrimaryClickAutoRangeHandler(XYChart, Node)
with the chart as the target.public static javafx.event.EventHandler<javafx.scene.input.MouseEvent> addDoublePrimaryClickAutoRangeHandler(javafx.scene.chart.XYChart<?,?> chart, javafx.scene.Node target)
chart
- chart whose axes to auto rangetarget
- handler listens for MouseEvent
s on this Node
EventHandler
added to 'target' for MouseEvent
.public static javafx.event.EventHandler<javafx.scene.input.MouseEvent> getDoublePrimaryClickAutoRangeHandler(XYChartInfo chartInfo)
EventHandler
that sets X and/or Y axis auto ranging when the primary mouse button is
double-clicked. If the click occurs inside the X axis area auto range only the X axis and similarly for Y axis. But
if the event is in the plot area or anywhere else, auto range both axes.Copyright © 2013–2016 Jason Winnebeck. All rights reserved.