Java Code Examples for org.jfree.chart.fx.ChartCanvas#setAnchor()

The following examples show how to use org.jfree.chart.fx.ChartCanvas#setAnchor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnchorHandlerFX.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Handles a mouse clicked event by setting the anchor point for the
 * canvas and redrawing the chart (the anchor point is a reference point
 * used by the chart to determine crosshair lines).
 * 
 * @param canvas  the chart canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMouseClicked(ChartCanvas canvas, MouseEvent e) {
    if (this.mousePressedPoint == null) {
        return;
    }
    Point2D currPt = new Point2D.Double(e.getX(), e.getY());
    if (this.mousePressedPoint.distance(currPt) < 2) {
        canvas.setAnchor(currPt);
    }
    this.mousePressedPoint = null;
}
 
Example 2
Source File: AnchorHandlerFX.java    From jfreechart-fx with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Handles a mouse clicked event by setting the anchor point for the
 * canvas and redrawing the chart (the anchor point is a reference point
 * used by the chart to determine crosshair lines).
 * 
 * @param canvas  the chart canvas ({@code null} not permitted).
 * @param e  the mouse event ({@code null} not permitted).
 */
@Override
public void handleMouseClicked(ChartCanvas canvas, MouseEvent e) {
    if (this.mousePressedPoint == null) {
        return;
    }
    Point2D currPt = new Point2D.Double(e.getX(), e.getY());
    if (this.mousePressedPoint.distance(currPt) < 2) {
        canvas.setAnchor(currPt);
    }
    this.mousePressedPoint = null;
}
 
Example 3
Source File: AnchorHandlerFX.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Handles a mouse clicked event by setting the anchor point for the
 * canvas and redrawing the chart (the anchor point is a reference point
 * used by the chart to determine crosshair lines).
 * 
 * @param canvas  the chart canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMouseClicked(ChartCanvas canvas, MouseEvent e) {
    if (this.mousePressedPoint == null) {
        return;
    }
    Point2D currPt = new Point2D.Double(e.getX(), e.getY());
    if (this.mousePressedPoint.distance(currPt) < 2) {
        canvas.setAnchor(currPt);
    }
    this.mousePressedPoint = null;
}
 
Example 4
Source File: AnchorHandlerFX.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Handles a mouse clicked event by setting the anchor point for the
 * canvas and redrawing the chart (the anchor point is a reference point
 * used by the chart to determine crosshair lines).
 * 
 * @param canvas  the chart canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMouseClicked(ChartCanvas canvas, MouseEvent e) {
    if (this.mousePressedPoint == null) {
        return;
    }
    Point2D currPt = new Point2D.Double(e.getX(), e.getY());
    if (this.mousePressedPoint.distance(currPt) < 2) {
        canvas.setAnchor(currPt);
    }
    this.mousePressedPoint = null;
}
 
Example 5
Source File: AnchorHandlerFX.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Handles a mouse clicked event by setting the anchor point for the
 * canvas and redrawing the chart (the anchor point is a reference point
 * used by the chart to determine crosshair lines).
 * 
 * @param canvas  the chart canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMouseClicked(ChartCanvas canvas, MouseEvent e) {
    if (this.mousePressedPoint == null) {
        return;
    }
    Point2D currPt = new Point2D.Double(e.getX(), e.getY());
    if (this.mousePressedPoint.distance(currPt) < 2) {
        canvas.setAnchor(currPt);
    }
    this.mousePressedPoint = null;
}
 
Example 6
Source File: AnchorHandlerFX.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Handles a mouse clicked event by setting the anchor point for the
 * canvas and redrawing the chart (the anchor point is a reference point
 * used by the chart to determine crosshair lines).
 * 
 * @param canvas  the chart canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMouseClicked(ChartCanvas canvas, MouseEvent e) {
    if (this.mousePressedPoint == null) {
        return;
    }
    Point2D currPt = new Point2D.Double(e.getX(), e.getY());
    if (this.mousePressedPoint.distance(currPt) < 2) {
        canvas.setAnchor(currPt);
    }
    this.mousePressedPoint = null;
}
 
Example 7
Source File: AnchorHandlerFX.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Handles a mouse clicked event by setting the anchor point for the
 * canvas and redrawing the chart (the anchor point is a reference point
 * used by the chart to determine crosshair lines).
 * 
 * @param canvas  the chart canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMouseClicked(ChartCanvas canvas, MouseEvent e) {
    if (this.mousePressedPoint == null) {
        return;
    }
    Point2D currPt = new Point2D.Double(e.getX(), e.getY());
    if (this.mousePressedPoint.distance(currPt) < 2) {
        canvas.setAnchor(currPt);
    }
    this.mousePressedPoint = null;
}