|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Graphics | +--sub_arctic.output.drawable | +--sub_arctic.output.drawable_wrapper | +--sub_arctic.output.trace_drawable
This class creates a drawable_wrapper object which does a debugging trace print of its operations as it draws (then forwards the actual drawing operation to its wrapped drawable).
Field Summary | |
protected boolean |
_trace_enabled
Flag to indicate that tracing is enabled (starts off true). |
protected java.io.PrintStream |
_trace_out
PrintStream object we write trace lines to. |
Fields inherited from class sub_arctic.output.drawable_wrapper |
_wrappee |
Fields inherited from class sub_arctic.output.drawable |
_ignore,
g |
Constructor Summary | |
trace_drawable(drawable rappee)
Constructor that defaults its trace output to System.out. |
|
trace_drawable(drawable rappee,
java.io.PrintStream outfile)
Simple constructor |
|
trace_drawable(java.awt.Graphics rappee,
java.io.PrintStream outfile)
Constructor working from a Graphics. |
Method Summary | |
void |
arrowhead_bound(int x1,
int y1,
int x2,
int y2,
int arrow_head_len,
int arrow_head_angle,
double arrow_inset,
java.awt.Point min_pt,
java.awt.Point max_pt)
Find the min and max points bounding the arrowhead that would be drawn at the second point on the given line. |
void |
clearRect(int x,
int y,
int w,
int h)
|
void |
clipRect(int x,
int y,
int w,
int h)
|
void |
copyArea(int x,
int y,
int w,
int h,
int dx,
int dy)
|
java.awt.Graphics |
create()
Override create() to create the properly typed wrapper around a copy of the object we wrap. |
java.awt.Graphics |
create(int x,
int y,
int w,
int h)
Override create() to create the properly typed wrapper around a copy of the object we wrap. |
void |
dispose()
|
void |
draw_arrowhead(int x1,
int y1,
int x2,
int y2,
int arrow_head_len,
int arrow_head_angle,
double arrow_inset)
Draw a hollow arrowhead (as lines) at the second end of the given line (this does not draw the line). |
void |
draw3DRect(int x,
int y,
int w,
int h,
boolean raised)
|
void |
drawArc(int x,
int y,
int w,
int h,
int start_ang,
int arc_ang)
|
void |
drawBytes(byte[] data,
int off,
int len,
int x,
int y)
|
void |
drawChars(char[] data,
int off,
int len,
int x,
int y)
|
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.Color bgcolor,
java.awt.image.ImageObserver obs)
|
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.image.ImageObserver observer)
|
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int w,
int h,
java.awt.Color bgcolor,
java.awt.image.ImageObserver obs)
|
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int w,
int h,
java.awt.image.ImageObserver obs)
|
boolean |
drawImage(loaded_image img,
int x,
int y)
Extended draw image that can deal with a loaded_image w/o an observer. |
boolean |
drawImage(loaded_image img,
int x,
int y,
java.awt.Color bgcolor)
Extended draw image that can deal with a loaded_image w/o an observer. |
boolean |
drawImage(loaded_image img,
int x,
int y,
int w,
int h)
Extended draw image that can deal with a loaded_image w/o an observer. |
boolean |
drawImage(loaded_image img,
int x,
int y,
int w,
int h,
java.awt.Color bgcolor)
Extended draw image that can deal with a loaded_image w/o an observer. |
void |
drawLine(int x1,
int y1,
int x2,
int y2)
|
void |
drawOval(int x,
int y,
int w,
int h)
|
void |
drawPolygon(int[] xp,
int[] yp,
int np)
|
void |
drawPolygon(java.awt.Polygon p)
|
void |
drawRect(int x,
int y,
int w,
int h)
|
void |
drawRoundRect(int x,
int y,
int w,
int h,
int arcw,
int arch)
|
void |
drawString(java.lang.String str,
int x,
int y)
|
void |
end_interactor_draw(interactor of_interactor)
Method to be called to mark the end of output for a particular interactor. |
void |
fill_arrowhead(int x1,
int y1,
int x2,
int y2,
int arrow_head_len,
int arrow_head_angle,
double arrow_inset)
Draw a filled arrowhead polygon at the second end of the given line (this does not draw the line). |
void |
fill3DRect(int x,
int y,
int w,
int h,
boolean raised)
|
void |
fillArc(int x,
int y,
int w,
int h,
int start_ang,
int arc_ang)
|
void |
fillOval(int x,
int y,
int w,
int h)
|
void |
fillPolygon(int[] xp,
int[] yp,
int np)
|
void |
fillPolygon(java.awt.Polygon p)
|
void |
fillRect(int x,
int y,
int w,
int h)
|
void |
fillRoundRect(int x,
int y,
int w,
int h,
int arcw,
int arch)
|
void |
finalize()
|
java.awt.Rectangle |
getClipBounds()
|
java.awt.Color |
getColor()
|
java.awt.Font |
getFont()
|
java.awt.FontMetrics |
getFontMetrics()
|
java.awt.FontMetrics |
getFontMetrics(java.awt.Font f)
|
boolean |
mark_interactor_draw(interactor of_interactor,
java.lang.Object mark_obj)
Method to be called to mark a significant point during output for a particular interactor. |
void |
set_trace_enabled(boolean v)
Set the flag to indicate whether tracing is enabled. |
void |
set_trace_out(java.io.PrintStream new_out)
Set the PrintStream object we write trace lines to. |
void |
setColor(java.awt.Color c)
|
void |
setFont(java.awt.Font font)
|
void |
setPaintMode()
|
void |
setXORMode(java.awt.Color c)
|
boolean |
start_interactor_draw(interactor of_interactor)
Method to be called to mark the beginning of output for a particular interactor. |
boolean |
tileImage(loaded_image pattern,
int x,
int y,
int w,
int h)
Tiled drawing of a pattern image over an area. |
java.lang.String |
toString()
Convert to a human readable string. |
boolean |
trace_enabled()
Flag to indicate that tracing is enabled (starts off true). |
java.io.PrintStream |
trace_out()
PrintStream object we write trace lines to. |
void |
trace(java.lang.String str)
Produce a line of trace. |
void |
translate(int x,
int y)
|
Methods inherited from class sub_arctic.output.drawable_wrapper |
copy,
copy,
graphics,
setClip,
wrappee |
Methods inherited from class sub_arctic.output.drawable |
arrowhead_bound,
clear_rect,
clip_rect,
copy_area,
draw_3D_rect,
draw_arc,
draw_arrowhead,
draw_bytes,
draw_chars,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_image,
draw_line,
draw_oval,
draw_polygon,
draw_polygon,
draw_polyline,
draw_rect,
draw_round_rect,
draw_string,
drawImage,
drawImage,
drawImage,
drawImage,
drawPolyline,
drawString,
fill_3D_rect,
fill_arc,
fill_arrowhead,
fill_oval,
fill_polygon,
fill_polygon,
fill_rect,
fill_round_rect,
get_clip_bounds,
get_clip,
get_color,
get_font_metrics,
get_font_metrics,
get_font,
getClip,
set_clip,
set_clip,
set_color,
set_font,
set_paint_mode,
set_XOR_mode,
setClip,
tile_image |
Methods inherited from class java.awt.Graphics |
getClipBounds,
getClipRect,
hitClip |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected boolean _trace_enabled
protected java.io.PrintStream _trace_out
Constructor Detail |
public trace_drawable(drawable rappee, java.io.PrintStream outfile)
drawable
- rappee the drawable we create a wrapper around.PrintStream
- outfile the print stream on which we produce trace
output. If null is passed here System.out will be
used by default (to turn tracing on or off use
set_trace_enabled())public trace_drawable(drawable rappee)
drawable
- rappee the drawable we create a wrapper around.public trace_drawable(java.awt.Graphics rappee, java.io.PrintStream outfile)
Graphics
- rappee the object we are wrapper around.PrintStream
- outfile the print stream on which we produce trace
output. If null is passed here System.out will be
used by default (to turn tracing on or off use
set_trace_enabled())Method Detail |
public boolean trace_enabled()
public void set_trace_enabled(boolean v)
boolean
- v new value for trace_enabled flagpublic java.io.PrintStream trace_out()
public void set_trace_out(java.io.PrintStream new_out)
PrintStream
- new_out the new output streampublic void trace(java.lang.String str)
String
- str the text for the trace line.public java.awt.Graphics create()
public java.awt.Graphics create(int x, int y, int w, int h)
int
- x x component of origin of new drawableint
- y y component of origin of new drawableint
- w width of new drawableint
- h height of new drawablepublic boolean start_interactor_draw(interactor of_interactor)
interactor
- of_interactor the interactor we are starting to drawboolean
- whether the drawing of the interactor (and its children)
should be performed.mark_interactor_draw(sub_arctic.lib.interactor, java.lang.Object)
,
end_interactor_draw(sub_arctic.lib.interactor)
public boolean mark_interactor_draw(interactor of_interactor, java.lang.Object mark_obj)
interactor
- of_interactor the interactor we are currently drawingObject
- mark_obj an object giving additional information
about the markboolean
- whether the drawing of the interactor (and its children)
should be performed.start_interactor_draw(sub_arctic.lib.interactor)
,
end_interactor_draw(sub_arctic.lib.interactor)
public void end_interactor_draw(interactor of_interactor)
interactor
- of_interactor the interactor we are starting to drawmark_interactor_draw(sub_arctic.lib.interactor, java.lang.Object)
,
start_interactor_draw(sub_arctic.lib.interactor)
public boolean drawImage(loaded_image img, int x, int y)
loaded_image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.public boolean drawImage(loaded_image img, int x, int y, int w, int h)
loaded_image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.int
- w width image will be scaled to.int
- h height image will be scaled to.public boolean drawImage(loaded_image img, int x, int y, java.awt.Color bgcolor)
loaded_image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.Color
- bgcolor background color.public boolean drawImage(loaded_image img, int x, int y, int w, int h, java.awt.Color bgcolor)
loaded_image
- img the image to be drawn.int
- x x position to place the image at.int
- y y position to place the image at.int
- w width image will be scaled to.int
- h height image will be scaled to.Color
- bgcolor background color.public boolean tileImage(loaded_image pattern, int x, int y, int w, int h)
loaded_image
- pattern the pattern to be tiled with the given space.int
- x x position to place the image at.int
- y y position to place the image at.int
- w width of area to tile.int
- h height of area to tile.public void fill_arrowhead(int x1, int y1, int x2, int y2, int arrow_head_len, int arrow_head_angle, double arrow_inset)
int
- x1 first x coordinate of the lineint
- y1 first y coordinate of the lineint
- x2 second x coordinate of the line (arrow
head point goes here)int
- y2 second y coordinate of the line (arrow
head point goes here)int
- arrow_head_len length of the sides of the arrow headint
- arrow_head_angle angle between each side and the line in
degreesdouble
- arrow_inset percent inset for base of arrow [0..1]
(values around 0.60 seem to work well).public void draw_arrowhead(int x1, int y1, int x2, int y2, int arrow_head_len, int arrow_head_angle, double arrow_inset)
int
- x1 first x coordinate of the line.int
- y1 first y coordinate of the line.int
- x2 second x coordinate of the line (arrow
head point goes here).int
- y2 second y coordinate of the line (arrow
head point goes here).int
- arrow_head_len length of the sides of the arrow head.int
- arrow_head_angle angle between each side and the line in
degrees.double
- arrow_inset percent inset for base of arrow [0..1]
(values around 0.60 seem to work well).public void arrowhead_bound(int x1, int y1, int x2, int y2, int arrow_head_len, int arrow_head_angle, double arrow_inset, java.awt.Point min_pt, java.awt.Point max_pt)
int
- x1 first x coordinate of the lineint
- y1 first y coordinate of the lineint
- x2 second x coordinate of the line (arrow head point goes here)int
- y2 second y coordinate of the line (arrow head point goes here)int
- arrow_head_len length of the sides of the arrow headint
- arrow_head_angle angle between each side and the line in degreesdouble
- arrow_inset percent inset for base of arrow [0..1]Point
- min_pt returns holding the min x,y of the boundPoint
- max_pt returns holding the max x,y of the boundpublic java.awt.Color getColor()
public void setColor(java.awt.Color c)
public void setPaintMode()
public void setXORMode(java.awt.Color c)
public java.awt.Font getFont()
public void setFont(java.awt.Font font)
public java.awt.FontMetrics getFontMetrics()
public java.awt.FontMetrics getFontMetrics(java.awt.Font f)
public java.awt.Rectangle getClipBounds()
public void clipRect(int x, int y, int w, int h)
public void translate(int x, int y)
public void dispose()
public void finalize()
public void copyArea(int x, int y, int w, int h, int dx, int dy)
public void drawLine(int x1, int y1, int x2, int y2)
public void fillRect(int x, int y, int w, int h)
public void drawRect(int x, int y, int w, int h)
public void clearRect(int x, int y, int w, int h)
public void drawRoundRect(int x, int y, int w, int h, int arcw, int arch)
public void fillRoundRect(int x, int y, int w, int h, int arcw, int arch)
public void draw3DRect(int x, int y, int w, int h, boolean raised)
public void fill3DRect(int x, int y, int w, int h, boolean raised)
public void drawOval(int x, int y, int w, int h)
public void fillOval(int x, int y, int w, int h)
public void drawArc(int x, int y, int w, int h, int start_ang, int arc_ang)
public void fillArc(int x, int y, int w, int h, int start_ang, int arc_ang)
public void drawPolygon(int[] xp, int[] yp, int np)
public void drawPolygon(java.awt.Polygon p)
public void fillPolygon(int[] xp, int[] yp, int np)
public void fillPolygon(java.awt.Polygon p)
public void drawString(java.lang.String str, int x, int y)
public void drawChars(char[] data, int off, int len, int x, int y)
public void drawBytes(byte[] data, int off, int len, int x, int y)
public boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
public boolean drawImage(java.awt.Image img, int x, int y, int w, int h, java.awt.image.ImageObserver obs)
public boolean drawImage(java.awt.Image img, int x, int y, java.awt.Color bgcolor, java.awt.image.ImageObserver obs)
public boolean drawImage(java.awt.Image img, int x, int y, int w, int h, java.awt.Color bgcolor, java.awt.image.ImageObserver obs)
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |