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);
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);
Static Constant.
Show buffered operations in a separate Frame.
type: int
Static Constant. Show buffered operations in a separate Frame. type: int
Static Constant.
Flash graphics operations.
type: int
Static Constant. Flash graphics operations. type: int
Static Constant.
Log graphics operations.
type: int
Static Constant. Log graphics operations. type: int
Static Constant.
Don't debug graphics operations.
type: int
Static Constant. Don't debug graphics operations. type: int
(*flash-color)
Returns the Color used to flash drawing operations.
returns: java.awt.Color
Returns the Color used to flash drawing operations. returns: `java.awt.Color`
(*flash-count)
Returns the number of times that drawing operations will flash.
returns: int
Returns the number of times that drawing operations will flash. returns: `int`
(*flash-time)
Returns the time delay of drawing operation flashing.
returns: int
Returns the time delay of drawing operation flashing. returns: `int`
(*log-stream)
Returns the stream to which the DebugGraphics logs drawing operations.
returns: java.io.PrintStream
Returns the stream to which the DebugGraphics logs drawing operations. returns: `java.io.PrintStream`
(*set-flash-color flash-color)
Sets the Color used to flash drawing operations.
flash-color - java.awt.Color
Sets the Color used to flash drawing operations. flash-color - `java.awt.Color`
(*set-flash-count flash-count)
Sets the number of times that drawing operations will flash.
flash-count - int
Sets the number of times that drawing operations will flash. flash-count - `int`
(*set-flash-time flash-time)
Sets the time delay of drawing operation flashing.
flash-time - int
Sets the time delay of drawing operation flashing. flash-time - `int`
(*set-log-stream stream)
Sets the stream to which the DebugGraphics logs drawing operations.
stream - java.io.PrintStream
Sets the stream to which the DebugGraphics logs drawing operations. stream - `java.io.PrintStream`
(->debug-graphics)
(->debug-graphics graphics)
(->debug-graphics graphics component)
Constructor.
Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component.
graphics - the Graphics context to slow down - java.awt.Graphics
component - the JComponent to draw slowly - javax.swing.JComponent
Constructor. Constructs a debug graphics context from an existing graphics context that slows down drawing for the specified component. graphics - the Graphics context to slow down - `java.awt.Graphics` component - the JComponent to draw slowly - `javax.swing.JComponent`
(clear-rect this x y width height)
Overrides Graphics.clearRect.
x - the x coordinate of the rectangle to clear. - int
y - the y coordinate of the rectangle to clear. - int
width - the width of the rectangle to clear. - int
height - the height of the rectangle to clear. - int
Overrides Graphics.clearRect. x - the x coordinate of the rectangle to clear. - `int` y - the y coordinate of the rectangle to clear. - `int` width - the width of the rectangle to clear. - `int` height - the height of the rectangle to clear. - `int`
(clip-rect this x y width height)
Overrides Graphics.clipRect.
x - the x coordinate of the rectangle to intersect the clip with - int
y - the y coordinate of the rectangle to intersect the clip with - int
width - the width of the rectangle to intersect the clip with - int
height - the height of the rectangle to intersect the clip with - int
Overrides Graphics.clipRect. x - the x coordinate of the rectangle to intersect the clip with - `int` y - the y coordinate of the rectangle to intersect the clip with - `int` width - the width of the rectangle to intersect the clip with - `int` height - the height of the rectangle to intersect the clip with - `int`
(copy-area this x y width height dest-x dest-y)
Overrides Graphics.copyArea.
x - the x coordinate of the source rectangle. - int
y - the y coordinate of the source rectangle. - int
width - the width of the source rectangle. - int
height - the height of the source rectangle. - int
dest-x - the horizontal distance to copy the pixels. - int
dest-y - the vertical distance to copy the pixels. - int
Overrides Graphics.copyArea. x - the x coordinate of the source rectangle. - `int` y - the y coordinate of the source rectangle. - `int` width - the width of the source rectangle. - `int` height - the height of the source rectangle. - `int` dest-x - the horizontal distance to copy the pixels. - `int` dest-y - the vertical distance to copy the pixels. - `int`
(create this)
(create this x y width height)
Overrides Graphics.create to return a DebugGraphics object.
x - the x coordinate. - int
y - the y coordinate. - int
width - the width of the clipping rectangle. - int
height - the height of the clipping rectangle. - int
returns: a new graphics context. - java.awt.Graphics
Overrides Graphics.create to return a DebugGraphics object. x - the x coordinate. - `int` y - the y coordinate. - `int` width - the width of the clipping rectangle. - `int` height - the height of the clipping rectangle. - `int` returns: a new graphics context. - `java.awt.Graphics`
(draw-3-d-rect this x y width height raised)
Overrides Graphics.draw3DRect.
x - the x coordinate of the rectangle to be drawn. - int
y - the y coordinate of the rectangle to be drawn. - int
width - the width of the rectangle to be drawn. - int
height - the height of the rectangle to be drawn. - int
raised - a boolean that determines whether the rectangle appears to be raised above the surface or sunk into the surface. - boolean
Overrides Graphics.draw3DRect. x - the x coordinate of the rectangle to be drawn. - `int` y - the y coordinate of the rectangle to be drawn. - `int` width - the width of the rectangle to be drawn. - `int` height - the height of the rectangle to be drawn. - `int` raised - a boolean that determines whether the rectangle appears to be raised above the surface or sunk into the surface. - `boolean`
(draw-arc this x y width height start-angle arc-angle)
Overrides Graphics.drawArc.
x - the x coordinate of the upper-left corner of the arc to be drawn. - int
y - the y coordinate of the upper-left corner of the arc to be drawn. - int
width - the width of the arc to be drawn. - int
height - the height of the arc to be drawn. - int
start-angle - the beginning angle. - int
arc-angle - the angular extent of the arc, relative to the start angle. - int
Overrides Graphics.drawArc. x - the x coordinate of the upper-left corner of the arc to be drawn. - `int` y - the y coordinate of the upper-left corner of the arc to be drawn. - `int` width - the width of the arc to be drawn. - `int` height - the height of the arc to be drawn. - `int` start-angle - the beginning angle. - `int` arc-angle - the angular extent of the arc, relative to the start angle. - `int`
(draw-bytes this data offset length x y)
Overrides Graphics.drawBytes.
data - the data to be drawn - byte[]
offset - the start offset in the data - int
length - the number of bytes that are drawn - int
x - the x coordinate of the baseline of the text - int
y - the y coordinate of the baseline of the text - int
Overrides Graphics.drawBytes. data - the data to be drawn - `byte[]` offset - the start offset in the data - `int` length - the number of bytes that are drawn - `int` x - the x coordinate of the baseline of the text - `int` y - the y coordinate of the baseline of the text - `int`
(draw-chars this data offset length x y)
Overrides Graphics.drawChars.
data - the array of characters to be drawn - char[]
offset - the start offset in the data - int
length - the number of characters to be drawn - int
x - the x coordinate of the baseline of the text - int
y - the y coordinate of the baseline of the text - int
Overrides Graphics.drawChars. data - the array of characters to be drawn - `char[]` offset - the start offset in the data - `int` length - the number of characters to be drawn - `int` x - the x coordinate of the baseline of the text - `int` y - the y coordinate of the baseline of the text - `int`
(draw-image this img x y observer)
(draw-image this img x y bgcolor observer)
(draw-image this img x y width height observer)
(draw-image this img x y width height bgcolor observer)
(draw-image this img dx-1 dy-1 dx-2 dy-2 sx-1 sy-1 sx-2 sy-2 observer)
(draw-image this img dx-1 dy-1 dx-2 dy-2 sx-1 sy-1 sx-2 sy-2 bgcolor observer)
Overrides Graphics.drawImage.
img - the specified image to be drawn. This method does nothing if img is null. - java.awt.Image
dx-1 - the x coordinate of the first corner of the destination rectangle. - int
dy-1 - the y coordinate of the first corner of the destination rectangle. - int
dx-2 - the x coordinate of the second corner of the destination rectangle. - int
dy-2 - the y coordinate of the second corner of the destination rectangle. - int
sx-1 - the x coordinate of the first corner of the source rectangle. - int
sy-1 - the y coordinate of the first corner of the source rectangle. - int
sx-2 - the x coordinate of the second corner of the source rectangle. - int
sy-2 - the y coordinate of the second corner of the source rectangle. - int
bgcolor - the background color to paint under the non-opaque portions of the image. - java.awt.Color
observer - object to be notified as more of the image is scaled and converted. - java.awt.image.ImageObserver
returns: false if the image pixels are still changing;
true otherwise. - boolean
Overrides Graphics.drawImage. img - the specified image to be drawn. This method does nothing if img is null. - `java.awt.Image` dx-1 - the x coordinate of the first corner of the destination rectangle. - `int` dy-1 - the y coordinate of the first corner of the destination rectangle. - `int` dx-2 - the x coordinate of the second corner of the destination rectangle. - `int` dy-2 - the y coordinate of the second corner of the destination rectangle. - `int` sx-1 - the x coordinate of the first corner of the source rectangle. - `int` sy-1 - the y coordinate of the first corner of the source rectangle. - `int` sx-2 - the x coordinate of the second corner of the source rectangle. - `int` sy-2 - the y coordinate of the second corner of the source rectangle. - `int` bgcolor - the background color to paint under the non-opaque portions of the image. - `java.awt.Color` observer - object to be notified as more of the image is scaled and converted. - `java.awt.image.ImageObserver` returns: false if the image pixels are still changing; true otherwise. - `boolean`
(draw-line this x-1 y-1 x-2 y-2)
Overrides Graphics.drawLine.
x-1 - the first point's x coordinate. - int
y-1 - the first point's y coordinate. - int
x-2 - the second point's x coordinate. - int
y-2 - the second point's y coordinate. - int
Overrides Graphics.drawLine. x-1 - the first point's x coordinate. - `int` y-1 - the first point's y coordinate. - `int` x-2 - the second point's x coordinate. - `int` y-2 - the second point's y coordinate. - `int`
(draw-oval this x y width height)
Overrides Graphics.drawOval.
x - the x coordinate of the upper left corner of the oval to be drawn. - int
y - the y coordinate of the upper left corner of the oval to be drawn. - int
width - the width of the oval to be drawn. - int
height - the height of the oval to be drawn. - int
Overrides Graphics.drawOval. x - the x coordinate of the upper left corner of the oval to be drawn. - `int` y - the y coordinate of the upper left corner of the oval to be drawn. - `int` width - the width of the oval to be drawn. - `int` height - the height of the oval to be drawn. - `int`
(draw-polygon this x-points y-points n-points)
Overrides Graphics.drawPolygon.
x-points - a an array of x coordinates. - int[]
y-points - a an array of y coordinates. - int[]
n-points - a the total number of points. - int
Overrides Graphics.drawPolygon. x-points - a an array of x coordinates. - `int[]` y-points - a an array of y coordinates. - `int[]` n-points - a the total number of points. - `int`
(draw-polyline this x-points y-points n-points)
Overrides Graphics.drawPolyline.
x-points - an array of x points - int[]
y-points - an array of y points - int[]
n-points - the total number of points - int
Overrides Graphics.drawPolyline. x-points - an array of x points - `int[]` y-points - an array of y points - `int[]` n-points - the total number of points - `int`
(draw-rect this x y width height)
Overrides Graphics.drawRect.
x - the x coordinate of the rectangle to be drawn. - int
y - the y coordinate of the rectangle to be drawn. - int
width - the width of the rectangle to be drawn. - int
height - the height of the rectangle to be drawn. - int
Overrides Graphics.drawRect. x - the x coordinate of the rectangle to be drawn. - `int` y - the y coordinate of the rectangle to be drawn. - `int` width - the width of the rectangle to be drawn. - `int` height - the height of the rectangle to be drawn. - `int`
(draw-round-rect this x y width height arc-width arc-height)
Overrides Graphics.drawRoundRect.
x - the x coordinate of the rectangle to be drawn. - int
y - the y coordinate of the rectangle to be drawn. - int
width - the width of the rectangle to be drawn. - int
height - the height of the rectangle to be drawn. - int
arc-width - the horizontal diameter of the arc at the four corners. - int
arc-height - the vertical diameter of the arc at the four corners. - int
Overrides Graphics.drawRoundRect. x - the x coordinate of the rectangle to be drawn. - `int` y - the y coordinate of the rectangle to be drawn. - `int` width - the width of the rectangle to be drawn. - `int` height - the height of the rectangle to be drawn. - `int` arc-width - the horizontal diameter of the arc at the four corners. - `int` arc-height - the vertical diameter of the arc at the four corners. - `int`
(draw-string this a-string x y)
Overrides Graphics.drawString.
a-string - the string to be drawn. - java.lang.String
x - the x coordinate. - int
y - the y coordinate. - int
Overrides Graphics.drawString. a-string - the string to be drawn. - `java.lang.String` x - the x coordinate. - `int` y - the y coordinate. - `int`
(drawing-buffer? this)
Returns the drawingBuffer value.
returns: true if this object is drawing from a Buffer - boolean
Returns the drawingBuffer value. returns: true if this object is drawing from a Buffer - `boolean`
(fill-3-d-rect this x y width height raised)
Overrides Graphics.fill3DRect.
x - the x coordinate of the rectangle to be filled. - int
y - the y coordinate of the rectangle to be filled. - int
width - the width of the rectangle to be filled. - int
height - the height of the rectangle to be filled. - int
raised - a boolean value that determines whether the rectangle appears to be raised above the surface or etched into the surface. - boolean
Overrides Graphics.fill3DRect. x - the x coordinate of the rectangle to be filled. - `int` y - the y coordinate of the rectangle to be filled. - `int` width - the width of the rectangle to be filled. - `int` height - the height of the rectangle to be filled. - `int` raised - a boolean value that determines whether the rectangle appears to be raised above the surface or etched into the surface. - `boolean`
(fill-arc this x y width height start-angle arc-angle)
Overrides Graphics.fillArc.
x - the x coordinate of the upper-left corner of the arc to be filled. - int
y - the y coordinate of the upper-left corner of the arc to be filled. - int
width - the width of the arc to be filled. - int
height - the height of the arc to be filled. - int
start-angle - the beginning angle. - int
arc-angle - the angular extent of the arc, relative to the start angle. - int
Overrides Graphics.fillArc. x - the x coordinate of the upper-left corner of the arc to be filled. - `int` y - the y coordinate of the upper-left corner of the arc to be filled. - `int` width - the width of the arc to be filled. - `int` height - the height of the arc to be filled. - `int` start-angle - the beginning angle. - `int` arc-angle - the angular extent of the arc, relative to the start angle. - `int`
(fill-oval this x y width height)
Overrides Graphics.fillOval.
x - the x coordinate of the upper left corner of the oval to be filled. - int
y - the y coordinate of the upper left corner of the oval to be filled. - int
width - the width of the oval to be filled. - int
height - the height of the oval to be filled. - int
Overrides Graphics.fillOval. x - the x coordinate of the upper left corner of the oval to be filled. - `int` y - the y coordinate of the upper left corner of the oval to be filled. - `int` width - the width of the oval to be filled. - `int` height - the height of the oval to be filled. - `int`
(fill-polygon this x-points y-points n-points)
Overrides Graphics.fillPolygon.
x-points - a an array of x coordinates. - int[]
y-points - a an array of y coordinates. - int[]
n-points - a the total number of points. - int
Overrides Graphics.fillPolygon. x-points - a an array of x coordinates. - `int[]` y-points - a an array of y coordinates. - `int[]` n-points - a the total number of points. - `int`
(fill-rect this x y width height)
Overrides Graphics.fillRect.
x - the x coordinate of the rectangle to be filled. - int
y - the y coordinate of the rectangle to be filled. - int
width - the width of the rectangle to be filled. - int
height - the height of the rectangle to be filled. - int
Overrides Graphics.fillRect. x - the x coordinate of the rectangle to be filled. - `int` y - the y coordinate of the rectangle to be filled. - `int` width - the width of the rectangle to be filled. - `int` height - the height of the rectangle to be filled. - `int`
(fill-round-rect this x y width height arc-width arc-height)
Overrides Graphics.fillRoundRect.
x - the x coordinate of the rectangle to be filled. - int
y - the y coordinate of the rectangle to be filled. - int
width - the width of the rectangle to be filled. - int
height - the height of the rectangle to be filled. - int
arc-width - the horizontal diameter of the arc at the four corners. - int
arc-height - the vertical diameter of the arc at the four corners. - int
Overrides Graphics.fillRoundRect. x - the x coordinate of the rectangle to be filled. - `int` y - the y coordinate of the rectangle to be filled. - `int` width - the width of the rectangle to be filled. - `int` height - the height of the rectangle to be filled. - `int` arc-width - the horizontal diameter of the arc at the four corners. - `int` arc-height - the vertical diameter of the arc at the four corners. - `int`
(get-clip this)
Overrides Graphics.getClip.
returns: a Shape object representing the
current clipping area, or null if
no clip is set. - java.awt.Shape
Overrides Graphics.getClip. returns: a Shape object representing the current clipping area, or null if no clip is set. - `java.awt.Shape`
(get-clip-bounds this)
Overrides Graphics.getClipBounds.
returns: the bounding rectangle of the current clipping area,
or null if no clip is set. - java.awt.Rectangle
Overrides Graphics.getClipBounds. returns: the bounding rectangle of the current clipping area, or null if no clip is set. - `java.awt.Rectangle`
(get-color this)
Returns the Color used for text drawing operations.
returns: this graphics context's current color. - java.awt.Color
Returns the Color used for text drawing operations. returns: this graphics context's current color. - `java.awt.Color`
(get-debug-options this)
Returns the current debugging options for this DebugGraphics.
returns: int
Returns the current debugging options for this DebugGraphics. returns: `int`
(get-font this)
Returns the Font used for text drawing operations.
returns: this graphics context's current font. - java.awt.Font
Returns the Font used for text drawing operations. returns: this graphics context's current font. - `java.awt.Font`
(get-font-metrics this)
(get-font-metrics this f)
Overrides Graphics.getFontMetrics.
f - the specified font - java.awt.Font
returns: the font metrics for the specified font. - java.awt.FontMetrics
Overrides Graphics.getFontMetrics. f - the specified font - `java.awt.Font` returns: the font metrics for the specified font. - `java.awt.FontMetrics`
(set-clip this clip)
(set-clip this x y width height)
Overrides Graphics.setClip.
x - the x coordinate of the new clip rectangle. - int
y - the y coordinate of the new clip rectangle. - int
width - the width of the new clip rectangle. - int
height - the height of the new clip rectangle. - int
Overrides Graphics.setClip. x - the x coordinate of the new clip rectangle. - `int` y - the y coordinate of the new clip rectangle. - `int` width - the width of the new clip rectangle. - `int` height - the height of the new clip rectangle. - `int`
(set-color this a-color)
Sets the color to be used for drawing and filling lines and shapes.
a-color - the new rendering color. - java.awt.Color
Sets the color to be used for drawing and filling lines and shapes. a-color - the new rendering color. - `java.awt.Color`
(set-debug-options this 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.
options - int
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. options - `int`
(set-font this a-font)
Sets the Font used for text drawing operations.
a-font - the font. - java.awt.Font
Sets the Font used for text drawing operations. a-font - the font. - `java.awt.Font`
(set-paint-mode this)
Overrides Graphics.setPaintMode.
Overrides Graphics.setPaintMode.
(set-xor-mode this a-color)
Overrides Graphics.setXORMode.
a-color - the XOR alternation color - java.awt.Color
Overrides Graphics.setXORMode. a-color - the XOR alternation color - `java.awt.Color`
(translate this x y)
Overrides Graphics.translate.
x - the x coordinate. - int
y - the y coordinate. - int
Overrides Graphics.translate. x - the x coordinate. - `int` y - the y coordinate. - `int`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close