本文整理匯總了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();
}
示例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();
}
}
}
});
}
示例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);
}
示例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);
}
}
示例5: testToString
import org.piccolo2d.event.PZoomEventHandler; //導入依賴的package包/類
public void testToString() {
final PZoomEventHandler zoomEventHandler = new PZoomEventHandler();
assertNotNull(zoomEventHandler.toString());
}
示例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;
}
示例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;
}