Package de.gsi.chart.plugins
Class DataPointTooltip
- java.lang.Object
-
- de.gsi.chart.plugins.ChartPlugin
-
- de.gsi.chart.plugins.AbstractDataFormattingPlugin
-
- de.gsi.chart.plugins.DataPointTooltip
-
public class DataPointTooltip extends AbstractDataFormattingPlugin
A tool tip label appearing next to the mouse cursor when placed over a data point's symbol. If symbols are not created/shown for given plot, the tool tip is shown for the closest data point that is within thepickingDistanceProperty()from the mouse cursor.CSS style class name: "chart-datapoint-tooltip-label"
- Author:
- Grzegorz Kruk TODO: extend so that label = new Label(); is a generic object and can also be overwritten with another implementation (<-> advanced interactor) additional add/remove listener are needed to edit/update the custom object based on DataPoint (for the time being private class)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classDataPointTooltip.DataPoint
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PICKING_DISTANCEThe default distance between the data point coordinates and mouse cursor that triggers showing the tool tip label.static java.lang.StringSTYLE_CLASS_LABELName of the CSS class of the tool tip label.
-
Constructor Summary
Constructors Constructor Description DataPointTooltip()Creates a new instance of DataPointTooltip class with {picking distanceinitialized to 5.DataPointTooltip(double pickingDistance)Creates a new instance of DataPointTooltip class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringformatLabel(DataPointTooltip.DataPoint dataPoint)doublegetPickingDistance()Returns the value of thepickingDistanceProperty().javafx.beans.property.DoublePropertypickingDistanceProperty()Distance of the mouse cursor from the data point (expressed in display units) that should trigger showing the tool tip.voidsetPickingDistance(double distance)Sets the value ofpickingDistanceProperty().-
Methods inherited from class de.gsi.chart.plugins.AbstractDataFormattingPlugin
formatData, getXValueFormatter, getYValueFormatter, setXValueFormatter, setYValueFormatter, xValueFormatterProperty, yValueFormatterProperty
-
Methods inherited from class de.gsi.chart.plugins.ChartPlugin
addButtonsToToolBarProperty, chartProperty, getChart, getChartChildren, getLocationInPlotArea, isAddButtonsToToolBar, layoutChildren, registerInputEventHandler, setAddButtonsToToolBar, setChart, toDataPoint, toDisplayPoint
-
-
-
-
Field Detail
-
STYLE_CLASS_LABEL
public static final java.lang.String STYLE_CLASS_LABEL
Name of the CSS class of the tool tip label.- See Also:
- Constant Field Values
-
DEFAULT_PICKING_DISTANCE
public static final int DEFAULT_PICKING_DISTANCE
The default distance between the data point coordinates and mouse cursor that triggers showing the tool tip label.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DataPointTooltip
public DataPointTooltip()
Creates a new instance of DataPointTooltip class with {picking distanceinitialized to 5.
-
DataPointTooltip
public DataPointTooltip(double pickingDistance)
Creates a new instance of DataPointTooltip class.- Parameters:
pickingDistance- the initial value for thepickingDistanceproperty
-
-
Method Detail
-
pickingDistanceProperty
public final javafx.beans.property.DoubleProperty pickingDistanceProperty()
Distance of the mouse cursor from the data point (expressed in display units) that should trigger showing the tool tip. By default initialized to 5.- Returns:
- the picking distance property
-
getPickingDistance
public final double getPickingDistance()
Returns the value of thepickingDistanceProperty().- Returns:
- the current picking distance
-
setPickingDistance
public final void setPickingDistance(double distance)
Sets the value ofpickingDistanceProperty().- Parameters:
distance- the new picking distance
-
formatLabel
protected java.lang.String formatLabel(DataPointTooltip.DataPoint dataPoint)
-
-