|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.util.ZDebug
ZDebug provides static methods for maintaining/setting/retrieving global debugging state. It is not inteneded to be instantiated.
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 boolean |
debug
Flag denoting whether debugging in general should be enabled. |
static boolean |
debugPick
Flag denoting whether to print debugging info related to picking |
static boolean |
debugRegionMgmt
Flag denoting whether there is a display to help debug region management |
static boolean |
debugRender
Flag denoting whether to print debugging info related to render operations |
static boolean |
debugRepaint
Flag denoting whether to print debugging info related to repaint operations |
static boolean |
debugSpatialIndexing
Flag denoting whether to print debugging info related to spatial indexing. |
static boolean |
debugTiming
Flag denoting whether to print debugging info related to timing |
static boolean |
showBounds
Flag denoting whether the bounds of each object are being rendered Don't set this directly - rather call setShowBounds(boolean, edu.umd.cs.jazz.ZCamera) . |
Constructor Summary | |
ZDebug()
|
Method Summary | |
static void |
clearPaintCount()
Clears the paint count. |
static void |
dump(ZNode node)
Debugging function to dump the scenegraph rooted at the specified node to stdout. |
protected static void |
dump(ZSceneGraphObject sgo,
int level,
boolean includeChildren)
Internal method for dump(ZNode node). |
protected static void |
dumpElement(java.lang.String space,
java.lang.String origHeader,
java.lang.String element)
Print the element for the scenegraph dump. |
static java.lang.String |
dumpString(ZSceneGraphObject obj,
boolean includeChildren)
Debugging function to dump the scenegraph rooted at the specified node to a String. |
static int |
getPaintCount()
Returns the number of nodes that painted themselves during the last render. |
static void |
incPaintCount()
Call this method whenever a node paints itself. |
static boolean |
isEventThread()
In general, both Swing and Jazz are not thread safe. |
static void |
setShowBounds(boolean showBounds,
ZCamera camera)
Controls whether the bounds of each object should be drawn as a debugging aid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final boolean debug
public static boolean showBounds
setShowBounds(boolean, edu.umd.cs.jazz.ZCamera)
.public static boolean debugRegionMgmt
public static boolean debugRender
public static boolean debugRepaint
public static boolean debugTiming
public static boolean debugPick
public static boolean debugSpatialIndexing
Constructor Detail |
public ZDebug()
Method Detail |
public static void setShowBounds(boolean showBounds, ZCamera camera)
showBounds
- true to show bounds, or false to hide boundscamera
- The camera the bounds should be scaled for.public static void clearPaintCount()
incPaintCount()
,
getPaintCount()
public static void incPaintCount()
clearPaintCount()
,
getPaintCount()
public static boolean isEventThread()
invokeLater
and
invokeAndWait
(see javax.swing.SwingUtilities).
Some common Jazz programming violations of this policy are modifying
Jazz objects in an animation thread or modifying Jazz objects from the
main thread (ie. public static void main(String[] main)).
Modifications to the Jazz scenegraph CAN be made in a
thread BEFORE the Window containing a ZCanvas is shown.
Not coincidently, this is when events start being generated for a
Jazz ZCanvas.
For code that will modify a Jazz scenegraph, the following function
reports whether the code has been called from the event thread. This
function is provided as a convenience to verify that Jazz scenegraph
modifications are occuring on the appropriate thread.SwingUtilities.invokeLater(java.lang.Runnable)
,
SwingUtilities.invokeAndWait(java.lang.Runnable)
,
SwingUtilities.isEventDispatchThread()
public static int getPaintCount()
clearPaintCount()
,
incPaintCount()
public static void dump(ZNode node)
ZSceneGraphObject.dump()
to display each object, and descends the hierarchy.node
- The root of the subtree to display.public static java.lang.String dumpString(ZSceneGraphObject obj, boolean includeChildren)
ZSceneGraphObject.dump()
to display each object, and descends the hierarchy.obj
- The scenegraph object being dumped.includeChildren
- true if children nodes should be dumped.protected static void dump(ZSceneGraphObject sgo, int level, boolean includeChildren)
sgo
- the scenegraph object being dumped.level
- a count of recursion level for indenting.includeChildren
- true if children nodes should be dumped.protected static void dumpElement(java.lang.String space, java.lang.String origHeader, java.lang.String element)
space
- space to indent the header.origHeader
- text header for the first line.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |