|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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 |
debugPrintFrameRate Flag denoting whether to print debugging info related to the frame rate. |
static boolean |
debugPrintUsedMemory Flag denoting whether to print debugging info related to the memory usage. |
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 int |
printResultsFrameRate Specifies the rate that totals should be calculated and printed to the console when debugPrintFrameRate or debugPrintUsedMemory are true. |
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 void |
endProcessingInput() |
static void |
endProcessingOutput() |
static long |
getApproximateUsedMemory() |
long |
getFramesProcessed() Return the number of frames that have been processed since the last time resetFPSTiming was called. |
static double |
getInputFPS() Return the frames per second used to process input events and activities. |
static double |
getOutputFPS() Return the frames per seconds used to paint graphics to the screen. |
static int |
getPaintCount() Returns the number of nodes that painted themselves during the last render. |
static double |
getTotalFPS() Return how many frames are processed and painted per second. |
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 |
resetFPSTiming() Reset the variables used to track FPS. |
static void |
setShowBounds(boolean showBounds, ZCamera camera) Controls whether the bounds of each object should be drawn as a debugging aid. |
static void |
startProcessingInput() |
static void |
startProcessingOutput() |
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
public static boolean debugPrintFrameRate
public static boolean debugPrintUsedMemory
public static int printResultsFrameRate
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 startProcessingOutput()
public static void endProcessingOutput()
public static void startProcessingInput()
public static void endProcessingInput()
public static double getTotalFPS()
public static double getInputFPS()
public static double getOutputFPS()
public long getFramesProcessed()
public static void resetFPSTiming()
public static long getApproximateUsedMemory()
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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |