本文整理汇总了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;
}