|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
edu.umd.cs.piccolox.swt.PSWTCanvas
public class PSWTCanvas
PCanvas is a simple Swing component that can be used to embed Piccolo into a Java Swing application. Canvas's view the Piccolo scene graph through a camera. The canvas manages screen updates coming from this camera, and forwards swing mouse and keyboard events to the camera.
Field Summary | |
---|---|
static PSWTCanvas |
CURRENT_CANVAS
|
Fields inherited from class org.eclipse.swt.widgets.Control |
---|
handle |
Constructor Summary | |
---|---|
PSWTCanvas(org.eclipse.swt.widgets.Composite parent,
int style)
Construct a canvas with the basic scene graph consisting of a root, camera, and layer. |
Method Summary | |
---|---|
void |
addInputEventListener(PInputEventListener listener)
Add an input listener to the camera associated with this canvas. |
PCamera |
createBasicSceneGraph()
|
boolean |
getAnimating()
Return true if any activities that respond with true to the method isAnimating were run in the last PRoot.processInputs() loop. |
PCamera |
getCamera()
Return the camera associated with this canvas. |
boolean |
getDoubleBuffered()
Get whether this canvas should use double buffering - the default is no double buffering |
boolean |
getInteracting()
Return true if this canvas has been marked as interacting. |
PLayer |
getLayer()
Return layer for this canvas. |
PPanEventHandler |
getPanEventHandler()
Get the pan event handler associated with this canvas. |
PRoot |
getRoot()
Return root for this canvas. |
PZoomEventHandler |
getZoomEventHandler()
Get the zoom event handler associated with this canvas. |
protected void |
installInputSources()
This method installs mouse and key listeners on the canvas that forward those events to piccolo. |
void |
paintComponent(org.eclipse.swt.graphics.GC gc,
int x,
int y,
int w,
int h)
|
void |
paintImmediately()
|
void |
popCursor()
Pop the cursor on top of the cursorStack and set it as the canvas cursor. |
void |
pushCursor(java.awt.Cursor cursor)
Set the canvas cursor, and remember the previous cursor on the cursor stack. |
void |
removeInputEventListener(PInputEventListener listener)
Remove an input listener to the camera associated with this canvas. |
void |
repaint()
|
void |
repaint(PBounds bounds)
|
protected void |
sendInputEventToInputManager(java.awt.event.InputEvent e,
int type)
|
void |
setAnimatingRenderQuality(int requestedQuality)
Set the render quality that should be used when rendering this canvas when it is animating. |
void |
setBounds(int x,
int y,
int w,
int h)
|
void |
setCamera(PCamera newCamera)
Set the camera associated with this canvas. |
void |
setDefaultRenderQuality(int requestedQuality)
Set the render quality that should be used when rendering this canvas. |
void |
setDoubleBuffered(boolean dBuffered)
Set whether this canvas should use double buffering - the default is no double buffering |
void |
setInteracting(boolean isInteracting)
Set if this canvas is interacting. |
void |
setInteractingRenderQuality(int requestedQuality)
Set the render quality that should be used when rendering this canvas when it is interacting. |
Methods inherited from class org.eclipse.swt.widgets.Composite |
---|
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList |
Methods inherited from class org.eclipse.swt.widgets.Scrollable |
---|
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
Methods inherited from class org.eclipse.swt.widgets.Control |
---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getDisplay, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isDisposed, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toDisplay, traverse, update |
Methods inherited from class org.eclipse.swt.widgets.Widget |
---|
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getStyle, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static PSWTCanvas CURRENT_CANVAS
Constructor Detail |
---|
public PSWTCanvas(org.eclipse.swt.widgets.Composite parent, int style)
Method Detail |
---|
public PPanEventHandler getPanEventHandler()
public PZoomEventHandler getZoomEventHandler()
public PCamera getCamera()
public void setCamera(PCamera newCamera)
public PRoot getRoot()
public PLayer getLayer()
public void addInputEventListener(PInputEventListener listener)
public void removeInputEventListener(PInputEventListener listener)
public PCamera createBasicSceneGraph()
public boolean getInteracting()
public boolean getAnimating()
public void setInteracting(boolean isInteracting)
setInteracting
in interface PComponent
public boolean getDoubleBuffered()
public void setDoubleBuffered(boolean dBuffered)
public void setDefaultRenderQuality(int requestedQuality)
requestedQuality
- supports PPaintContext.HIGH_QUALITY_RENDERING or PPaintContext.LOW_QUALITY_RENDERINGpublic void setAnimatingRenderQuality(int requestedQuality)
requestedQuality
- supports PPaintContext.HIGH_QUALITY_RENDERING or PPaintContext.LOW_QUALITY_RENDERINGpublic void setInteractingRenderQuality(int requestedQuality)
requestedQuality
- supports PPaintContext.HIGH_QUALITY_RENDERING or PPaintContext.LOW_QUALITY_RENDERINGpublic void pushCursor(java.awt.Cursor cursor)
pushCursor
in interface PComponent
public void popCursor()
popCursor
in interface PComponent
protected void installInputSources()
protected void sendInputEventToInputManager(java.awt.event.InputEvent e, int type)
public void setBounds(int x, int y, int w, int h)
setBounds
in class org.eclipse.swt.widgets.Control
public void repaint()
public void repaint(PBounds bounds)
repaint
in interface PComponent
public void paintComponent(org.eclipse.swt.graphics.GC gc, int x, int y, int w, int h)
public void paintImmediately()
paintImmediately
in interface PComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |