当前位置: 首页>>代码示例>>Java>>正文


Java ChartCanvas.clearLiveHandler方法代码示例

本文整理汇总了Java中org.jfree.chart.fx.ChartCanvas.clearLiveHandler方法的典型用法代码示例。如果您正苦于以下问题:Java ChartCanvas.clearLiveHandler方法的具体用法?Java ChartCanvas.clearLiveHandler怎么用?Java ChartCanvas.clearLiveHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.fx.ChartCanvas的用法示例。


在下文中一共展示了ChartCanvas.clearLiveHandler方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleMousePressed

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
/**
 * Handles a mouse pressed event by recording the initial mouse pointer
 * location.
 * 
 * @param canvas  the JavaFX canvas ({@code null} not permitted).
 * @param e  the mouse event ({@code null} not permitted).
 */
@Override
public void handleMousePressed(ChartCanvas canvas, MouseEvent e) {
    Plot plot = canvas.getChart().getPlot();
    if (!(plot instanceof Pannable)) {
        canvas.clearLiveHandler();
        return;
    }
    Pannable pannable = (Pannable) plot;
    if (pannable.isDomainPannable() || pannable.isRangePannable()) {
        Point2D point = new Point2D.Double(e.getX(), e.getY());
        Rectangle2D dataArea = canvas.findDataArea(point);
        if (dataArea != null && dataArea.contains(point)) {
            this.panW = dataArea.getWidth();
            this.panH = dataArea.getHeight();
            this.panLast = point;
            canvas.setCursor(javafx.scene.Cursor.MOVE);
        }
    }
    // the actual panning occurs later in the mouseDragged() method
}
 
开发者ID:jfree,项目名称:jfreechart-fx,代码行数:28,代码来源:PanHandlerFX.java

示例2: handleMousePressed

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
/**
 * Handles a mouse pressed event by recording the initial mouse pointer
 * location.
 * 
 * @param canvas  the JavaFX canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMousePressed(ChartCanvas canvas, MouseEvent e) {
    Plot plot = canvas.getChart().getPlot();
    if (!(plot instanceof Pannable)) {
        canvas.clearLiveHandler();
        return;
    }
    Pannable pannable = (Pannable) plot;
    if (pannable.isDomainPannable() || pannable.isRangePannable()) {
        Point2D point = new Point2D.Double(e.getX(), e.getY());
        Rectangle2D dataArea = canvas.findDataArea(point);
        if (dataArea != null && dataArea.contains(point)) {
            this.panW = dataArea.getWidth();
            this.panH = dataArea.getHeight();
            this.panLast = point;
            canvas.setCursor(javafx.scene.Cursor.MOVE);
        }
    }
    // the actual panning occurs later in the mouseDragged() method
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:28,代码来源:PanHandlerFX.java

示例3: handleMouseDragged

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
/**
 * Handles a mouse dragged event by calculating the distance panned and
 * updating the axes accordingly.
 * 
 * @param canvas  the JavaFX canvas ({@code null} not permitted).
 * @param e  the mouse event ({@code null} not permitted).
 */
@Override
public void handleMouseDragged(ChartCanvas canvas, MouseEvent e) {
    if (this.panLast == null) {
        //handle panning if we have a start point else unregister
        canvas.clearLiveHandler();
        return;
    }

    JFreeChart chart = canvas.getChart();
    double dx = e.getX() - this.panLast.getX();
    double dy = e.getY() - this.panLast.getY();
    if (dx == 0.0 && dy == 0.0) {
        return;
    }
    double wPercent = -dx / this.panW;
    double hPercent = dy / this.panH;
    boolean old = chart.getPlot().isNotify();
    chart.getPlot().setNotify(false);
    Pannable p = (Pannable) chart.getPlot();
    PlotRenderingInfo info = canvas.getRenderingInfo().getPlotInfo();
    if (p.getOrientation().isVertical()) {
        p.panDomainAxes(wPercent, info, this.panLast);
        p.panRangeAxes(hPercent, info, this.panLast);
    }
    else {
        p.panDomainAxes(hPercent, info, this.panLast);
        p.panRangeAxes(wPercent, info, this.panLast);
    }
    this.panLast = new Point2D.Double(e.getX(), e.getY());
    chart.getPlot().setNotify(old);
}
 
开发者ID:jfree,项目名称:jfreechart-fx,代码行数:39,代码来源:PanHandlerFX.java

示例4: handleMouseReleased

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
@Override
public void handleMouseReleased(ChartCanvas canvas, MouseEvent e) {  
    //if we have been panning reset the cursor
    //unregister in any case
    if (this.panLast != null) {
        canvas.setCursor(javafx.scene.Cursor.DEFAULT);
    }
    this.panLast = null;
    canvas.clearLiveHandler();
}
 
开发者ID:jfree,项目名称:jfreechart-fx,代码行数:11,代码来源:PanHandlerFX.java

示例5: handleMousePressed

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
/**
 * Handles a mouse pressed event by recording the initial mouse pointer
 * location.
 * 
 * @param canvas  the JavaFX canvas ({@code null} not permitted).
 * @param e  the mouse event ({@code null} not permitted).
 */
@Override
public void handleMousePressed(ChartCanvas canvas, MouseEvent e) {
    Point2D pt = new Point2D.Double(e.getX(), e.getY());
    Rectangle2D dataArea = canvas.findDataArea(pt);
    if (dataArea != null) {
        this.startPoint = ShapeUtils.getPointInRectangle(e.getX(),
                e.getY(), dataArea);
    } else {
        this.startPoint = null;
        canvas.clearLiveHandler();
    }
}
 
开发者ID:jfree,项目名称:jfreechart-fx,代码行数:20,代码来源:ZoomHandlerFX.java

示例6: handleMouseDragged

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
/**
 * Handles a mouse dragged event by calculating the distance panned and
 * updating the axes accordingly.
 * 
 * @param canvas  the JavaFX canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
public void handleMouseDragged(ChartCanvas canvas, MouseEvent e) {
    if (this.panLast == null) {
        //handle panning if we have a start point else unregister
        canvas.clearLiveHandler();
        return;
    }

    JFreeChart chart = canvas.getChart();
    double dx = e.getX() - this.panLast.getX();
    double dy = e.getY() - this.panLast.getY();
    if (dx == 0.0 && dy == 0.0) {
        return;
    }
    double wPercent = -dx / this.panW;
    double hPercent = dy / this.panH;
    boolean old = chart.getPlot().isNotify();
    chart.getPlot().setNotify(false);
    Pannable p = (Pannable) chart.getPlot();
    PlotRenderingInfo info = canvas.getRenderingInfo().getPlotInfo();
    if (p.getOrientation().isVertical()) {
        p.panDomainAxes(wPercent, info, this.panLast);
        p.panRangeAxes(hPercent, info, this.panLast);
    }
    else {
        p.panDomainAxes(hPercent, info, this.panLast);
        p.panRangeAxes(wPercent, info, this.panLast);
    }
    this.panLast = new Point2D.Double(e.getX(), e.getY());
    chart.getPlot().setNotify(old);
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:38,代码来源:PanHandlerFX.java

示例7: handleMouseReleased

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
public void handleMouseReleased(ChartCanvas canvas, MouseEvent e) {  
    //if we have been panning reset the cursor
    //unregister in any case
    if (this.panLast != null) {
        canvas.setCursor(javafx.scene.Cursor.DEFAULT);
    }
    this.panLast = null;
    canvas.clearLiveHandler();
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:10,代码来源:PanHandlerFX.java

示例8: handleMousePressed

import org.jfree.chart.fx.ChartCanvas; //导入方法依赖的package包/类
/**
 * Handles a mouse pressed event by recording the initial mouse pointer
 * location.
 * 
 * @param canvas  the JavaFX canvas (<code>null</code> not permitted).
 * @param e  the mouse event (<code>null</code> not permitted).
 */
@Override
public void handleMousePressed(ChartCanvas canvas, MouseEvent e) {
    Point2D pt = new Point2D.Double(e.getX(), e.getY());
    Rectangle2D dataArea = canvas.findDataArea(pt);
    if (dataArea != null) {
        this.startPoint = ShapeUtilities.getPointInRectangle(e.getX(),
                e.getY(), dataArea);
    } else {
        this.startPoint = null;
        canvas.clearLiveHandler();
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:20,代码来源:ZoomHandlerFX.java


注:本文中的org.jfree.chart.fx.ChartCanvas.clearLiveHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。