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


Java ZoomHandlerFX类代码示例

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


ZoomHandlerFX类属于org.jfree.chart.fx.interaction包,在下文中一共展示了ZoomHandlerFX类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ChartViewer

import org.jfree.chart.fx.interaction.ZoomHandlerFX; //导入依赖的package包/类
/**
 * Creates a new viewer instance.
 * 
 * @param chart  the chart ({@code null} permitted).
 * @param contextMenuEnabled  enable the context menu?
 */
public ChartViewer(JFreeChart chart, boolean contextMenuEnabled) {
    this.canvas = new ChartCanvas(chart);
    this.canvas.setTooltipEnabled(true);
    this.canvas.addMouseHandler(new ZoomHandlerFX("zoom", this));
    setFocusTraversable(true);
    getChildren().add(this.canvas);
    
    this.zoomRectangle = new Rectangle(0, 0, new Color(0, 0, 1, 0.25));
    this.zoomRectangle.setManaged(false);
    this.zoomRectangle.setVisible(false);
    getChildren().add(this.zoomRectangle);
    
    this.contextMenu = createContextMenu();
    setOnContextMenuRequested((ContextMenuEvent event) -> {
        contextMenu.show(ChartViewer.this.getScene().getWindow(),
                event.getScreenX(), event.getScreenY());
    });
    this.contextMenu.setOnShowing(
            e -> ChartViewer.this.getCanvas().setTooltipEnabled(false));
    this.contextMenu.setOnHiding(
            e -> ChartViewer.this.getCanvas().setTooltipEnabled(true));
}
 
开发者ID:jfree,项目名称:jfreechart-fx,代码行数:29,代码来源:ChartViewer.java

示例2: createNode

import org.jfree.chart.fx.interaction.ZoomHandlerFX; //导入依赖的package包/类
/** 
 * Creates the node representing this control.
 * 
 * @return The node.
 */
private BorderPane createNode(ChartViewer control) {
    BorderPane borderPane = new BorderPane();
    borderPane.setPrefSize(800, 500);
    StackPane sp = new StackPane();
    sp.setMinSize(10, 10);
    sp.setPrefSize(600, 400);
    this.canvas = new ChartCanvas(getSkinnable().getChart());
    this.canvas.setTooltipEnabled(control.isTooltipEnabled());
    this.canvas.addChartMouseListener(control);
    this.canvas.widthProperty().bind(sp.widthProperty());
    this.canvas.heightProperty().bind(sp.heightProperty());
 
    this.canvas.addMouseHandler(new ZoomHandlerFX("zoom", control));
    sp.getChildren().add(this.canvas);
    
    borderPane.setCenter(sp);
    return borderPane;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:24,代码来源:ChartViewerSkin.java


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