|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.ZDrawingSurface
ZDrawingSurface represents the thing the camera renders onto. Typically, a drawing surface will be associated with a ZCanvas window. However, a drawing surface can also represent a printer, and thus rendering to a window and printer is implemented in the same way. The drawing surface is associated with a window or printer by specifying which Graphics2D to render onto.
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
ZNode
, Serialized FormField Summary | |
static int |
DEFAULT_HALO
Number of pixels a point can miss an object and still pick it. |
static int |
RENDER_QUALITY_HIGH
|
static int |
RENDER_QUALITY_LOW
|
static int |
RENDER_QUALITY_MEDIUM
|
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
ZDrawingSurface()
Constructs a new Surface. |
|
ZDrawingSurface(ZCamera camera,
ZNode cameraNode)
Constructs a new Surface, containing the given camera and associated camera node. |
|
ZDrawingSurface(ZCamera camera,
ZNode cameraNode,
javax.swing.JComponent aComponent)
Constructs a new Surface, containing the given camera and associated camera node, along with a JComponent this surface is connected to. |
Method Summary | |
java.lang.String |
dump()
Generate a string that represents this object for debugging. |
java.util.ArrayList |
findNodes(ZFindFilter filter)
Return the list of nodes that are accepted by the specified filter in the portion of the scenegraph visible within the camera attached to this surface. |
ZCamera |
getCamera()
Get the camera this surface is associated with. |
ZNode |
getCameraNode()
Get the camera node this surface is associated with. |
javax.swing.JComponent |
getComponent()
Get the component that this surface is attached to, or null if none. |
int |
getInteractingRenderQuality()
Determine the render quality that is used during interaction and animation. |
int |
getRenderQuality()
Determine the render quality that is used when not interacting or animating. |
boolean |
isInteracting()
Determine if the user interacting with the surface |
void |
paint(java.awt.Graphics g)
Paints the camera this surface sees. |
void |
paintImmediately()
Force this surface to immediately paint any regions that are out of date and marked for future repainting. |
ZSceneGraphPath |
pick(int x,
int y)
Returns the path to the first object intersecting the specified rectangle within DEFAULT_HALO pixels as searched in reverse (front-to-back) order, or null if no objects satisfy criteria. |
ZSceneGraphPath |
pick(int x,
int y,
int halo)
Returns the path to the first object intersecting the specified rectangle within halo pixels as searched in reverse (front-to-back) order, or null if no objects satisfy criteria. |
int |
print(java.awt.Graphics graphics,
java.awt.print.PageFormat pageFormat,
int pageIndex)
Prints the surface into the specified Graphics context in the specified format. |
void |
printSurface()
Constructs a new PrinterJob, allows the user to select which printer to print to, and prints the surface. |
void |
repaint()
A utility function to repaint the entire component. |
void |
setCamera(ZCamera cam,
ZNode camNode)
Sets the camera that this surface is rendered with. |
void |
setComponent(javax.swing.JComponent aComponent)
Set the component that this surface is attached to, or null if none. |
void |
setInteracting(boolean v)
Specify if the user is interacting with the surface or not. |
void |
setInteractingRenderQuality(int qualityRequested)
Specify the render quality to be used during interaction and animation. |
void |
setRenderQuality(int qualityRequested)
Specify that future rendering should occur at the specified quality. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int RENDER_QUALITY_LOW
public static final int RENDER_QUALITY_MEDIUM
public static final int RENDER_QUALITY_HIGH
public static final int DEFAULT_HALO
Constructor Detail |
public ZDrawingSurface()
public ZDrawingSurface(ZCamera camera, ZNode cameraNode)
setComponent(javax.swing.JComponent)
node
- The part of the scenegraph this camera sees.cameraNode
- The node the camera is attached topublic ZDrawingSurface(ZCamera camera, ZNode cameraNode, javax.swing.JComponent aComponent)
node
- The part of the scenegraph this camera sees.cameraNode
- The node the camera is attached toaComponent
- The component this surface is connected toMethod Detail |
public void setRenderQuality(int qualityRequested)
qualityRequested
- Can be RENDER_QUALITY_LOW
,
RENDER_QUALITY_MEDIUM
or RENDER_QUALITY_HIGH
.setInteractingRenderQuality(int)
public int getRenderQuality()
RENDER_QUALITY_LOW
,
RENDER_QUALITY_MEDIUM
or RENDER_QUALITY_HIGH
.public void setInteractingRenderQuality(int qualityRequested)
qualityRequested
- Can be RENDER_QUALITY_LOW
,
RENDER_QUALITY_MEDIUM
or RENDER_QUALITY_HIGH
.public int getInteractingRenderQuality()
public javax.swing.JComponent getComponent()
public void setComponent(javax.swing.JComponent aComponent)
aComponent
- The component this surface is attached to, or null if none.public void setCamera(ZCamera cam, ZNode camNode)
cam
- The new cameracamNode
- The camera's nodepublic ZCamera getCamera()
public ZNode getCameraNode()
public boolean isInteracting()
public void setInteracting(boolean v)
v
- true if the user is interacting with the surface, false otherwise.public void repaint()
public void paint(java.awt.Graphics g)
Graphics
- The graphics to use for rendering.public void paintImmediately()
public ZSceneGraphPath pick(int x, int y)
x
- X-coord of pick point in window coordinates.y
- Y-coord of pick point in window coordinates.public ZSceneGraphPath pick(int x, int y, int halo)
x
- X-coord of pick point in window coordinates.y
- Y-coord of pick point in window coordinates.halo
- The amount the point can miss an object and still pick itpublic java.util.ArrayList findNodes(ZFindFilter filter)
filter
- The filter that decides whether or not to include individual nodes in the find listZNode.isFindable()
,
ZFindFilter
public void printSurface()
public int print(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int pageIndex)
print
in interface java.awt.print.Printable
graphics
- the context into which the page is drawnpageFormat
- the size and orientation of the page being drawnpageIndex
- the zero based index of the page to be drawnpublic java.lang.String dump()
ZDebug.dump(edu.umd.cs.jazz.ZNode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |