Class Cursor
java.lang.Object
java.awt.event.MouseAdapter
org.knowm.xchart.internal.chartpart.Cursor
- All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener, ChartPart
Cursor movement to display matching point data information.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Chartprivate final List<Cursor.DataPoint> private static final intprivate final List<Cursor.DataPoint> private static final intprivate doubleprivate doubleprivate doubleprivate doubleprivate final XYStylerprivate doubleFields inherited from interface ChartPart
SOLID_STROKE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidprivate voidOne DataPoint per series, keep the DataPoint closest to mouseXprivate booleanvoidvoidpaint(Graphics2D g) private voidpaintBackGround(Graphics2D g, TextLayout xValueTextLayout) private voidpaintDataPointInfo(Graphics2D g, TextLayout xValueTextLayout) private voidpaintVerticalLine(Graphics2D g, Cursor.DataPoint dataPoint) Methods inherited from class MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased, mouseWheelMoved
-
Field Details
-
LINE_SPACING
private static final int LINE_SPACING- See Also:
-
MOUSE_SPACING
private static final int MOUSE_SPACING- See Also:
-
dataPointList
-
matchingDataPointList
-
chart
-
styler
-
seriesMap
-
mouseX
private double mouseX -
mouseY
private double mouseY -
startX
private double startX -
startY
private double startY -
textHeight
private double textHeight
-
-
Constructor Details
-
Cursor
-
-
Method Details
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classMouseAdapter
-
isMouseOutOfPlotContent
private boolean isMouseOutOfPlotContent() -
getBounds
-
paint
-
paintVerticalLine
-
paintBackGround
-
paintDataPointInfo
-
addData
-
calculateMatchingDataPoints
private void calculateMatchingDataPoints()One DataPoint per series, keep the DataPoint closest to mouseX
-