Home » openjdk-7 » javax » swing » [javadoc | source]
javax.swing
public class: DebugGraphics [javadoc | source]
java.lang.Object
   java.awt.Graphics
      javax.swing.DebugGraphics
Graphics subclass supporting graphics debugging. Overrides most methods from Graphics. DebugGraphics objects are rarely created by hand. They are most frequently created automatically when a JComponent's debugGraphicsOptions are changed using the setDebugGraphicsOptions() method.

NOTE: You must turn off double buffering to use DebugGraphics: RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false);

Field Summary
 Graphics graphics     
 Image buffer     
 int debugOptions     
 int graphicsID     
 int xOffset     
 int yOffset     
public static final  int LOG_OPTION    Log graphics operations. 
public static final  int FLASH_OPTION    Flash graphics operations. 
public static final  int BUFFERED_OPTION    Show buffered operations in a separate Frame
public static final  int NONE_OPTION    Don't debug graphics operations. 
Constructor:
 public DebugGraphics() 
 public DebugGraphics(Graphics graphics) 
    Constructs a debug graphics context from an existing graphics context that supports slowed down drawing.
    Parameters:
    graphics - the Graphics context to slow down
 public DebugGraphics(Graphics graphics,
    JComponent component) 
    Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component.
    Parameters:
    graphics - the Graphics context to slow down
    component - the JComponent to draw slowly
Method from javax.swing.DebugGraphics Summary:
clearRect,   clipRect,   copyArea,   create,   create,   debugBuffered,   debugComponentCount,   debugFlash,   debugLog,   dispose,   draw3DRect,   drawArc,   drawBytes,   drawChars,   drawImage,   drawImage,   drawImage,   drawImage,   drawImage,   drawImage,   drawLine,   drawOval,   drawPolygon,   drawPolyline,   drawRect,   drawRoundRect,   drawString,   drawString,   fill3DRect,   fillArc,   fillOval,   fillPolygon,   fillRect,   fillRoundRect,   flashColor,   flashCount,   flashTime,   getClip,   getClipBounds,   getColor,   getDebugOptions,   getDebugOptions,   getFont,   getFontMetrics,   getFontMetrics,   info,   isDrawingBuffer,   loadImage,   logStream,   pointToString,   setClip,   setClip,   setColor,   setDebugOptions,   setDebugOptions,   setFlashColor,   setFlashCount,   setFlashTime,   setFont,   setLogStream,   setPaintMode,   setXORMode,   shouldComponentDebug,   sleep,   toShortString,   translate
Methods from java.awt.Graphics:
clearRect,   clipRect,   copyArea,   create,   create,   dispose,   draw3DRect,   drawArc,   drawBytes,   drawChars,   drawImage,   drawImage,   drawImage,   drawImage,   drawImage,   drawImage,   drawLine,   drawOval,   drawPolygon,   drawPolygon,   drawPolyline,   drawRect,   drawRoundRect,   drawString,   drawString,   fill3DRect,   fillArc,   fillOval,   fillPolygon,   fillPolygon,   fillRect,   fillRoundRect,   finalize,   getClip,   getClipBounds,   getClipBounds,   getClipRect,   getColor,   getFont,   getFontMetrics,   getFontMetrics,   hitClip,   setClip,   setClip,   setColor,   setFont,   setPaintMode,   setXORMode,   toString,   translate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.DebugGraphics Detail:
 public  void clearRect(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.clearRect.
 public  void clipRect(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.clipRect.
 public  void copyArea(int x,
    int y,
    int width,
    int height,
    int destX,
    int destY) 
    Overrides Graphics.copyArea.
 public Graphics create() 
    Overrides Graphics.create to return a DebugGraphics object.
 public Graphics create(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.create to return a DebugGraphics object.
 boolean debugBuffered() 
 static int debugComponentCount() 
    Returns the number of JComponents that have debugging options turned on.
 boolean debugFlash() 
 boolean debugLog() 
 public  void dispose() 
    Overrides Graphics.dispose.
 public  void draw3DRect(int x,
    int y,
    int width,
    int height,
    boolean raised) 
    Overrides Graphics.draw3DRect.
 public  void drawArc(int x,
    int y,
    int width,
    int height,
    int startAngle,
    int arcAngle) 
    Overrides Graphics.drawArc.
 public  void drawBytes(byte[] data,
    int offset,
    int length,
    int x,
    int y) 
    Overrides Graphics.drawBytes.
 public  void drawChars(char[] data,
    int offset,
    int length,
    int x,
    int y) 
    Overrides Graphics.drawChars.
 public boolean drawImage(Image img,
    int x,
    int y,
    ImageObserver observer) 
    Overrides Graphics.drawImage.
 public boolean drawImage(Image img,
    int x,
    int y,
    Color bgcolor,
    ImageObserver observer) 
    Overrides Graphics.drawImage.
 public boolean drawImage(Image img,
    int x,
    int y,
    int width,
    int height,
    ImageObserver observer) 
    Overrides Graphics.drawImage.
 public boolean drawImage(Image img,
    int x,
    int y,
    int width,
    int height,
    Color bgcolor,
    ImageObserver observer) 
    Overrides Graphics.drawImage.
 public boolean drawImage(Image img,
    int dx1,
    int dy1,
    int dx2,
    int dy2,
    int sx1,
    int sy1,
    int sx2,
    int sy2,
    ImageObserver observer) 
    Overrides Graphics.drawImage.
 public boolean drawImage(Image img,
    int dx1,
    int dy1,
    int dx2,
    int dy2,
    int sx1,
    int sy1,
    int sx2,
    int sy2,
    Color bgcolor,
    ImageObserver observer) 
    Overrides Graphics.drawImage.
 public  void drawLine(int x1,
    int y1,
    int x2,
    int y2) 
    Overrides Graphics.drawLine.
 public  void drawOval(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.drawOval.
 public  void drawPolygon(int[] xPoints,
    int[] yPoints,
    int nPoints) 
    Overrides Graphics.drawPolygon.
 public  void drawPolyline(int[] xPoints,
    int[] yPoints,
    int nPoints) 
    Overrides Graphics.drawPolyline.
 public  void drawRect(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.drawRect.
 public  void drawRoundRect(int x,
    int y,
    int width,
    int height,
    int arcWidth,
    int arcHeight) 
    Overrides Graphics.drawRoundRect.
 public  void drawString(String aString,
    int x,
    int y) 
    Overrides Graphics.drawString.
 public  void drawString(AttributedCharacterIterator iterator,
    int x,
    int y) 
    Overrides Graphics.drawString.
 public  void fill3DRect(int x,
    int y,
    int width,
    int height,
    boolean raised) 
    Overrides Graphics.fill3DRect.
 public  void fillArc(int x,
    int y,
    int width,
    int height,
    int startAngle,
    int arcAngle) 
    Overrides Graphics.fillArc.
 public  void fillOval(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.fillOval.
 public  void fillPolygon(int[] xPoints,
    int[] yPoints,
    int nPoints) 
    Overrides Graphics.fillPolygon.
 public  void fillRect(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.fillRect.
 public  void fillRoundRect(int x,
    int y,
    int width,
    int height,
    int arcWidth,
    int arcHeight) 
    Overrides Graphics.fillRoundRect.
 public static Color flashColor() 
    Returns the Color used to flash drawing operations.
 public static int flashCount() 
    Returns the number of times that drawing operations will flash.
 public static int flashTime() 
    Returns the time delay of drawing operation flashing.
 public Shape getClip() 
    Overrides Graphics.getClip.
 public Rectangle getClipBounds() 
    Overrides Graphics.getClipBounds.
 public Color getColor() 
    Returns the Color used for text drawing operations.
 public int getDebugOptions() 
    Returns the current debugging options for this DebugGraphics.
 static int getDebugOptions(JComponent component) 
    Static wrapper method for DebugGraphicsInfo.getDebugOptions().
 public Font getFont() 
    Returns the Font used for text drawing operations.
 public FontMetrics getFontMetrics() 
    Overrides Graphics.getFontMetrics.
 public FontMetrics getFontMetrics(Font f) 
    Overrides Graphics.getFontMetrics.
 static DebugGraphicsInfo info() 
    Returns DebugGraphicsInfo, or creates one if none exists.
 public boolean isDrawingBuffer() 
    Returns the drawingBuffer value.
 static  void loadImage(Image img) 
 public static PrintStream logStream() 
    Returns the stream to which the DebugGraphics logs drawing operations.
 String pointToString(int x,
    int y) 
 public  void setClip(Shape clip) 
    Overrides Graphics.setClip.
 public  void setClip(int x,
    int y,
    int width,
    int height) 
    Overrides Graphics.setClip.
 public  void setColor(Color aColor) 
    Sets the color to be used for drawing and filling lines and shapes.
 public  void setDebugOptions(int options) 
    Enables/disables diagnostic information about every graphics operation. The value of options indicates how this information should be displayed. LOG_OPTION causes a text message to be printed. FLASH_OPTION causes the drawing to flash several times. BUFFERED_OPTION creates a new Frame that shows each operation on an offscreen buffer. The value of options is bitwise OR'd into the current value. To disable debugging use NONE_OPTION.
 static  void setDebugOptions(JComponent component,
    int options) 
    Static wrapper method for DebugGraphicsInfo.setDebugOptions(). Stores options on a per component basis.
 public static  void setFlashColor(Color flashColor) 
    Sets the Color used to flash drawing operations.
 public static  void setFlashCount(int flashCount) 
    Sets the number of times that drawing operations will flash.
 public static  void setFlashTime(int flashTime) 
    Sets the time delay of drawing operation flashing.
 public  void setFont(Font aFont) 
    Sets the Font used for text drawing operations.
 public static  void setLogStream(PrintStream stream) 
    Sets the stream to which the DebugGraphics logs drawing operations.
 public  void setPaintMode() 
    Overrides Graphics.setPaintMode.
 public  void setXORMode(Color aColor) 
    Overrides Graphics.setXORMode.
 static int shouldComponentDebug(JComponent component) 
    Returns non-zero if component should display with DebugGraphics, zero otherwise. Walks the JComponent's parent tree to determine if any debugging options have been set.
 final  void sleep(int mSecs) 
 String toShortString() 
 public  void translate(int x,
    int y) 
    Overrides Graphics.translate.