edu.umd.cs.jazz.util
Class ZDebug

java.lang.Object
  |
  +--edu.umd.cs.jazz.util.ZDebug

public class ZDebug
extends java.lang.Object

The ZDebug class is not inteneded to be instantiated. Rather it provides static methods for maintaining/setting/retrieving global debugging state.

See Also:
ZNode

Field Summary
protected static ZCamera boundsCamera
          Camera that is associated with bounds.
protected static int debug
          Flag denoting the current debug state.
static int DEBUG_ALL
           
static int DEBUG_DAMAGE
           
static int DEBUG_NONE
           
static int DEBUG_PAINT
           
static int DEBUG_TIME
           
protected static boolean debugRegionMgmt
          Flag denoting whether there is a display to help debug region management
protected static int paintCount
          Tally of the number of ZNodes (that contain a visual) that have been painted
protected static boolean showBounds
          Flag denoting whether the bounds of each object are being rendered
protected static boolean trackNodePaint
          Flag denoting whether a counter should be kept and incremented each time a ZNode (that contains a visual) is painted
 
Constructor Summary
ZDebug()
           
 
Method Summary
static void clearPaintCount(java.lang.Object g)
          Clears the paint count.
static void dump(ZNode subGraph)
          Dump the subGraph passed in to stdout
protected static void dump(ZNode subGraph, int level)
          Helper method for Dump(ZNode subGraph).
protected static void dumpElement(java.lang.String space, java.lang.String origHeader, java.lang.String element)
          Print the element for the scenegraph dump.
static ZCamera getBoundsCamera()
          Returns the camera associated with the bounds.
static int getDebug()
          Returns the current state of debugging output
static boolean getDebugRegionMgmt()
          Returns the current state of debugRegionMgmt
static int getPaintCount(java.lang.Object g)
          Returns the number of nodes that painted themselves during the last render
static boolean getShowBounds()
          Returns the current state of showBounds
static void incPaintCount(java.lang.Object g)
          Call this method whenever a node paints itself
static void setDebug(int value)
          Controls whether debug statements should be sent to stdout for various kinds of internal debugging.
static void setDebugRegionMgmt(boolean value)
          Controls whether the region currently being painted should be indicated with a shadowed area on the screen.
static void setShowBounds(boolean showBounds, ZCamera camera)
          Controls whether the bounds of each object should be drawn as a debugging aid.
static void setTrackNodePaint(boolean value)
          Pass true to this method to enable gathering info relating to how many nodes are painted each render.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_NONE

public static final int DEBUG_NONE

DEBUG_ALL

public static final int DEBUG_ALL

DEBUG_DAMAGE

public static final int DEBUG_DAMAGE

DEBUG_PAINT

public static final int DEBUG_PAINT

DEBUG_TIME

public static final int DEBUG_TIME

debug

protected static int debug
Flag denoting the current debug state.

showBounds

protected static boolean showBounds
Flag denoting whether the bounds of each object are being rendered

boundsCamera

protected static ZCamera boundsCamera
Camera that is associated with bounds. It is used show that when damaging nodes and displaying bounds, we know what magnification we are at so we can compute appropriate thin bounds.

debugRegionMgmt

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

trackNodePaint

protected static boolean trackNodePaint
Flag denoting whether a counter should be kept and incremented each time a ZNode (that contains a visual) is painted

paintCount

protected static int paintCount
Tally of the number of ZNodes (that contain a visual) that have been painted
Constructor Detail

ZDebug

public ZDebug()
Method Detail

setDebug

public static void setDebug(int value)
Controls whether debug statements should be sent to stdout for various kinds of internal debugging. The legal kinds of debugging are: DEBUG_NONE - No Debugging DEBUG_ALL - Debug everything DEBUG_DAMAGE - Debug damage() DEBUG_PAINT - Debug paint() DEBUG_TIME - Debug render timing
Parameters:
value -  

getDebug

public static int getDebug()
Returns the current state of debugging output
Returns:
the thing being debugged. See setDebug for legal values

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.

getShowBounds

public static boolean getShowBounds()
Returns the current state of showBounds
Returns:
true if showBounds is on, or false otherwise

getBoundsCamera

public static ZCamera getBoundsCamera()
Returns the camera associated with the bounds. It is used to compute the bounds line thickness.
Returns:
The camera associated with the bounds.

setDebugRegionMgmt

public static void setDebugRegionMgmt(boolean value)
Controls whether the region currently being painted should be indicated with a shadowed area on the screen.
Parameters:
value -  

getDebugRegionMgmt

public static boolean getDebugRegionMgmt()
Returns the current state of debugRegionMgmt
Returns:
true if debugRegionMgmt is on, or false otherwise

dump

public static void dump(ZNode subGraph)
Dump the subGraph passed in to stdout
Parameters:
subGraph -  

dump

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

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.

setTrackNodePaint

public static void setTrackNodePaint(boolean value)
Pass true to this method to enable gathering info relating to how many nodes are painted each render.
Parameters:
value -  
See Also:
clearPaintCount(Object), incPaintCount(Object), getPaintCount(Object)

clearPaintCount

public static void clearPaintCount(java.lang.Object g)
Clears the paint count. This method should be called at the begining of each render
Parameters:
g -  
See Also:
setTrackNodePaint(boolean), incPaintCount(java.lang.Object), getPaintCount(java.lang.Object)

incPaintCount

public static void incPaintCount(java.lang.Object g)
Call this method whenever a node paints itself
Parameters:
g -  
See Also:
setTrackNodePaint(boolean), clearPaintCount(java.lang.Object), getPaintCount(java.lang.Object)

getPaintCount

public static int getPaintCount(java.lang.Object g)
Returns the number of nodes that painted themselves during the last render
Parameters:
g -  
See Also:
setTrackNodePaint(boolean), clearPaintCount(java.lang.Object), incPaintCount(java.lang.Object)