當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。