Jazz API Documentation

edu.umd.cs.jazz.util
Class ZDebug

java.lang.Object
  |
  +--edu.umd.cs.jazz.util.ZDebug
All Implemented Interfaces:
java.io.Serializable

public class ZDebug
extends java.lang.Object
implements java.io.Serializable

ZDebug provides static methods for maintaining/setting/retrieving global debugging state. It is not inteneded to be instantiated.

See Also:
ZNode, Serialized Form

Field 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 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 @link{#setShowBounds}.
 
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)
          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 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 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

debug

public static final boolean debug
Flag denoting whether debugging in general should be enabled. Settig thisto false will cause all debugging code will be optimized out of Jazz during compilation.

showBounds

public static boolean showBounds
Flag denoting whether the bounds of each object are being rendered Don't set this directly - rather call @link{#setShowBounds}.

debugRegionMgmt

public static boolean debugRegionMgmt
Flag denoting whether there is a display to help debug region management

debugRender

public static boolean debugRender
Flag denoting whether to print debugging info related to render operations

debugRepaint

public static boolean debugRepaint
Flag denoting whether to print debugging info related to repaint operations

debugTiming

public static boolean debugTiming
Flag denoting whether to print debugging info related to timing

debugPick

public static boolean debugPick
Flag denoting whether to print debugging info related to picking
Constructor Detail

ZDebug

public ZDebug()
Method Detail

setShowBounds

public static void setShowBounds(boolean showBounds,
                                 ZCamera camera)
Controls whether the bounds of each object should be drawn as a debugging aid. Caller must also specify the camera that should be used in computing how to display bounds.
Parameters:
showBounds - true to show bounds, or false to hide bounds
camera - The camera the bounds should be scaled for.

clearPaintCount

public static void clearPaintCount()
Clears the paint count. This method should be called at the begining of each render
See Also:
incPaintCount(), getPaintCount()

incPaintCount

public static void incPaintCount()
Call this method whenever a node paints itself
See Also:
clearPaintCount(), getPaintCount()

getPaintCount

public static int getPaintCount()
Returns the number of nodes that painted themselves during the last render
See Also:
clearPaintCount(), incPaintCount()

dump

public static void dump(ZNode node)
Debugging function to dump the scenegraph rooted at the specified node to stdout. It uses @link{ZSceneGraphObject#dump} to display each object, and descends the hierarchy.
Parameters:
node - The root of the subtree to display

dump

protected static void dump(ZSceneGraphObject sgo,
                           int level)
Internal method for dump(ZNode node). This method handles pretty indenting of each level as it recurses down the tree.
Parameters:
node -  
level -  

dumpElement

protected static void dumpElement(java.lang.String space,
                                  java.lang.String origHeader,
                                  java.lang.String element)
Print the element for the scenegraph dump. Parse the element, and if there are any newlines, space out each line with the 'space' parameter. Also, print the header for the first line, and a matching number of spaces for ensuing lines.

Jazz API Documentation