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


Java PZoomEventHandler类代码示例

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


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

示例1: PSWTCanvas

import org.piccolo2d.event.PZoomEventHandler; //导入依赖的package包/类
/**
 * Construct a canvas with the basic scene graph consisting of a root,
 * camera, and layer. Event handlers for zooming and panning are
 * automatically installed.
 * 
 * @param parent component onto which the canvas is installed
 * @param style component style for the PSWTCanvas
 */
public PSWTCanvas(final Composite parent, final int style) {
    super(parent, style | SWT.NO_BACKGROUND | SWT.NO_REDRAW_RESIZE);

    CURRENT_CANVAS = this;
    cursorStack = new PStack();
    setCamera(createBasicSceneGraph());
    installInputSources();
    setDefaultRenderQuality(PPaintContext.HIGH_QUALITY_RENDERING);
    setAnimatingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setInteractingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    panEventHandler = new PPanEventHandler();
    zoomEventHandler = new PZoomEventHandler();
    addInputEventListener(panEventHandler);
    addInputEventListener(zoomEventHandler);

    installPaintListener();
    installDisposeListener();
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:27,代码来源:PSWTCanvas.java

示例2: PCanvas

import org.piccolo2d.event.PZoomEventHandler; //导入依赖的package包/类
/**
 * Construct a canvas with the basic scene graph consisting of a root,
 * camera, and layer. Zooming and panning are automatically installed.
 */
public PCanvas() {
    cursorStack = new PStack();
    setCamera(createDefaultCamera());
    setDefaultRenderQuality(PPaintContext.HIGH_QUALITY_RENDERING);
    setAnimatingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setInteractingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setPanEventHandler(new PPanEventHandler());
    setZoomEventHandler(new PZoomEventHandler());
    setBackground(Color.WHITE);
    setOpaque(true);

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(final HierarchyEvent e) {
            if (e.getComponent() == PCanvas.this) {
                if (getParent() == null) {
                    removeInputSources();
                }
                else if (isEnabled()) {
                    installInputSources();
                }
            }
        }
    });
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:29,代码来源:PCanvas.java

示例3: testZoomEventListenerIsInstalledByDefault

import org.piccolo2d.event.PZoomEventHandler; //导入依赖的package包/类
public void testZoomEventListenerIsInstalledByDefault() {
    PZoomEventHandler handler = canvas.getZoomEventHandler();
    assertNotNull(handler);

    int handlerIndex = getHandlerIndex(handler);
    assertFalse("Zoom Event Handler not installed", handlerIndex == -1);
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:8,代码来源:PSWTCanvasTest.java

示例4: setZoomEventHandler

import org.piccolo2d.event.PZoomEventHandler; //导入依赖的package包/类
/**
 * Set the zoom event handler associated with this canvas.
 * 
 * @param handler the new zoom event handler
 */
public void setZoomEventHandler(final PZoomEventHandler handler) {
    if (zoomEventHandler != null) {
        removeInputEventListener(zoomEventHandler);
    }

    zoomEventHandler = handler;

    if (zoomEventHandler != null) {
        addInputEventListener(zoomEventHandler);
    }
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:17,代码来源:PCanvas.java

示例5: testToString

import org.piccolo2d.event.PZoomEventHandler; //导入依赖的package包/类
public void testToString() {
    final PZoomEventHandler zoomEventHandler = new PZoomEventHandler();
    assertNotNull(zoomEventHandler.toString());
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:5,代码来源:PZoomEventHandlerTest.java

示例6: getZoomEventHandler

import org.piccolo2d.event.PZoomEventHandler; //导入依赖的package包/类
/**
 * Get the zoom event handler associated with this canvas. This event
 * handler is set up to get events from the camera associated with this
 * canvas by default.
 * 
 * @return the event handler installed to handle zooming
 */
public PZoomEventHandler getZoomEventHandler() {
    return zoomEventHandler;
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:11,代码来源:PSWTCanvas.java

示例7: getZoomEventHandler

import org.piccolo2d.event.PZoomEventHandler; //导入依赖的package包/类
/**
 * Get the zoom event handler associated with this canvas. This event
 * handler is set up to get events from the camera associated with this
 * canvas by default.
 * 
 * @return the current zoom event handler, may be null
 */
public PZoomEventHandler getZoomEventHandler() {
    return zoomEventHandler;
}
 
开发者ID:piccolo2d,项目名称:piccolo2d.java,代码行数:11,代码来源:PCanvas.java


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