sub_arctic.output
Class ignore_drawable

java.lang.Object
  |
  +--java.awt.Graphics
        |
        +--sub_arctic.output.drawable
              |
              +--sub_arctic.output.ignore_drawable

public class ignore_drawable
extends drawable

Subclass of drawable that performs none of its drawing but maintains internal state for all its state changes. This is useful when a drawable_wrapper is being exceuted for its side-effects alone. Since all state changes are performed this drawable will operate smoothly in an interactor redraw pass (where trivial rejects depend on the proper clipping rect being set and in general operations lower in the tree may depend on state set above). Note that the initial state of this drawable (color, font, etc. may not match the default for whatever platform we are running on, so its possible that objects which accidentally use that state (they shouldn't since its platform dependent) may get different results with this drawable than with a "live" one.

See Also:
drawable

Field Summary
protected  java.awt.Rectangle _cur_clip
          Rectangle of current clipping rectangle
protected  java.awt.Color _cur_color
          A privately maintained current color
protected  java.awt.Font _cur_font
          A privately maintained current font
protected  java.awt.FontMetrics _cur_metrics
          A privately maintained metrics object for the current font
 
Fields inherited from class sub_arctic.output.drawable
_ignore, g
 
Constructor Summary
ignore_drawable()
          Simple constructor
 
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 clip_rect(int x, int y, int w, int h)
           
 void clipRect(int x, int y, int w, int h)
           
 drawable copy()
          New version of create() that returns a drawable.
 drawable copy(int x, int y, int w, int h)
          New version of create() that returns a drawable.
 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 result.
 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)
           
 java.awt.Rectangle get_clip_bounds()
           
 java.awt.Color get_color()
           
 java.awt.FontMetrics get_font_metrics()
           
 java.awt.FontMetrics get_font_metrics(java.awt.Font f)
           
 java.awt.Font get_font()
           
 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_clip(int x, int y, int w, int h)
           
 void set_color(java.awt.Color c)
           
 void set_font(java.awt.Font font)
           
 void set_paint_mode()
           
 void set_XOR_mode(java.awt.Color c)
           
 void setClip(int x, int y, int w, int h)
           
 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.
 void translate(int x, int y)
           
 
Methods inherited from class sub_arctic.output.drawable
arrowhead_bound, clear_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, getClip, graphics, set_clip, setClip, tile_image
 
Methods inherited from class java.awt.Graphics
finalize, getClipBounds, getClipRect, hitClip
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_cur_color

protected java.awt.Color _cur_color
A privately maintained current color

_cur_font

protected java.awt.Font _cur_font
A privately maintained current font

_cur_metrics

protected java.awt.FontMetrics _cur_metrics
A privately maintained metrics object for the current font

_cur_clip

protected java.awt.Rectangle _cur_clip
Rectangle of current clipping rectangle
Constructor Detail

ignore_drawable

public ignore_drawable()
Simple constructor
Method Detail

create

public java.awt.Graphics create()
Override create() to create the properly typed result.
Returns:
Graphics a new ignore_drawable object copied from this one.
Overrides:
create in class drawable

create

public 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. Note: subclasses will typically need to do this also.
Parameters:
int - x x component of origin of new drawable
int - y y component of origin of new drawable
int - w width of new drawable
int - h height of new drawable
Returns:
Graphics a new ignore_drawable object derived from this one.
Overrides:
create in class drawable

copy

public drawable copy()
New version of create() that returns a drawable. This does exactly the same thing as create(), but is just more accurate about its return type.
Returns:
Graphics a new ignore_drawable object copied from this one.
Overrides:
copy in class drawable

copy

public drawable copy(int x,
                     int y,
                     int w,
                     int h)
New version of create() that returns a drawable. This does exactly the same thing as create(), but is just more accurate about its return type.
Parameters:
int - x x component of origin of new drawable
int - y y component of origin of new drawable
int - w width of new drawable
int - h height of new drawable
Returns:
Graphics a new drawable object derived from this one.
Overrides:
copy in class drawable

start_interactor_draw

public boolean start_interactor_draw(interactor of_interactor)
Method to be called to mark the beginning of output for a particular interactor. This is normally called (only) in draw_self(). The return value indicates whether the interactor (and its children) should be drawn (i.e., if false is returned, the drawing should be skipped and draw_self() should simply return).

Parameters:
interactor - of_interactor the interactor we are starting to draw
boolean - whether the drawing of the interactor (and its children) should be performed.
Overrides:
start_interactor_draw in class drawable
See Also:
mark_interactor_draw(sub_arctic.lib.interactor, java.lang.Object), end_interactor_draw(sub_arctic.lib.interactor)

mark_interactor_draw

public 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. The return value indicates whether the remaining output for the interactor (and its children) should be drawn (i.e., if false is returned, the remaining drawing should be skipped). The type and effect of the mark_obj parameter to this routine (as well as the effect of the routine) is dependent on subclasses that implement special effects via this call.
Parameters:
interactor - of_interactor the interactor we are currently drawing
Object - mark_obj an object giving additional information about the mark
boolean - whether the drawing of the interactor (and its children) should be performed.
Overrides:
mark_interactor_draw in class drawable
See Also:
start_interactor_draw(sub_arctic.lib.interactor), end_interactor_draw(sub_arctic.lib.interactor)

end_interactor_draw

public void end_interactor_draw(interactor of_interactor)
Method to be called to mark the end of output for a particular interactor. This is normally called (only) in draw_self().

Parameters:
interactor - of_interactor the interactor we are starting to draw
Overrides:
end_interactor_draw in class drawable
See Also:
mark_interactor_draw(sub_arctic.lib.interactor, java.lang.Object), start_interactor_draw(sub_arctic.lib.interactor)

drawImage

public boolean drawImage(loaded_image img,
                         int x,
                         int y)
Extended draw image that can deal with a loaded_image w/o an observer.
Parameters:
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.
Returns:
boolean undocumented return value from AWT drawImage() routine.
Overrides:
drawImage in class drawable

drawImage

public 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.
Parameters:
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.
Returns:
boolean undocumented return value from AWT drawImage() routine.
Overrides:
drawImage in class drawable

drawImage

public 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.
Parameters:
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.
Returns:
boolean undocumented return value from AWT drawImage() routine.
Overrides:
drawImage in class drawable

drawImage

public 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. If the image has not actually been loaded yet, this will block until it has.
Parameters:
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.
Returns:
boolean undocumented return value from AWT drawImage() routine.
Overrides:
drawImage in class drawable

tileImage

public boolean tileImage(loaded_image pattern,
                         int x,
                         int y,
                         int w,
                         int h)
Tiled drawing of a pattern image over an area. The given image is drawn repeatedly to fill the given area.
Parameters:
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.
Returns:
boolean undocumented return value from AWT drawImage() routine.
Overrides:
tileImage in class drawable

fill_arrowhead

public 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).

Parameters:
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).
Overrides:
fill_arrowhead in class drawable

draw_arrowhead

public 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).

Parameters:
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).
Overrides:
draw_arrowhead in class drawable

arrowhead_bound

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)
Find the min and max points bounding the arrowhead that would be drawn at the second point on the given line.

Parameters:
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]
Point - min_pt returns holding the min x,y of the bound
Point - max_pt returns holding the max x,y of the bound
Overrides:
arrowhead_bound in class drawable

getColor

public java.awt.Color getColor()
Overrides:
getColor in class drawable

get_color

public java.awt.Color get_color()
Overrides:
get_color in class drawable

setColor

public void setColor(java.awt.Color c)
Overrides:
setColor in class drawable

set_color

public void set_color(java.awt.Color c)
Overrides:
set_color in class drawable

setPaintMode

public void setPaintMode()
Overrides:
setPaintMode in class drawable

set_paint_mode

public void set_paint_mode()
Overrides:
set_paint_mode in class drawable

setXORMode

public void setXORMode(java.awt.Color c)
Overrides:
setXORMode in class drawable

set_XOR_mode

public void set_XOR_mode(java.awt.Color c)
Overrides:
set_XOR_mode in class drawable

getFont

public java.awt.Font getFont()
Overrides:
getFont in class drawable

get_font

public java.awt.Font get_font()
Overrides:
get_font in class drawable

setFont

public void setFont(java.awt.Font font)
Overrides:
setFont in class drawable

set_font

public void set_font(java.awt.Font font)
Overrides:
set_font in class drawable

getFontMetrics

public java.awt.FontMetrics getFontMetrics()
Overrides:
getFontMetrics in class drawable

get_font_metrics

public java.awt.FontMetrics get_font_metrics()
Overrides:
get_font_metrics in class drawable

getFontMetrics

public java.awt.FontMetrics getFontMetrics(java.awt.Font f)
Overrides:
getFontMetrics in class drawable

get_font_metrics

public java.awt.FontMetrics get_font_metrics(java.awt.Font f)
Overrides:
get_font_metrics in class drawable

getClipBounds

public java.awt.Rectangle getClipBounds()
Overrides:
getClipBounds in class drawable

get_clip_bounds

public java.awt.Rectangle get_clip_bounds()
Overrides:
get_clip_bounds in class drawable

clipRect

public void clipRect(int x,
                     int y,
                     int w,
                     int h)
Overrides:
clipRect in class drawable

clip_rect

public void clip_rect(int x,
                      int y,
                      int w,
                      int h)
Overrides:
clip_rect in class drawable

setClip

public void setClip(int x,
                    int y,
                    int w,
                    int h)
Overrides:
setClip in class drawable

set_clip

public void set_clip(int x,
                     int y,
                     int w,
                     int h)
Overrides:
set_clip in class drawable

translate

public void translate(int x,
                      int y)
Overrides:
translate in class drawable

dispose

public void dispose()
Overrides:
dispose in class drawable

copyArea

public void copyArea(int x,
                     int y,
                     int w,
                     int h,
                     int dx,
                     int dy)
Overrides:
copyArea in class drawable

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
Overrides:
drawLine in class drawable

fillRect

public void fillRect(int x,
                     int y,
                     int w,
                     int h)
Overrides:
fillRect in class drawable

drawRect

public void drawRect(int x,
                     int y,
                     int w,
                     int h)
Overrides:
drawRect in class drawable

clearRect

public void clearRect(int x,
                      int y,
                      int w,
                      int h)
Overrides:
clearRect in class drawable

drawRoundRect

public void drawRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int arcw,
                          int arch)
Overrides:
drawRoundRect in class drawable

fillRoundRect

public void fillRoundRect(int x,
                          int y,
                          int w,
                          int h,
                          int arcw,
                          int arch)
Overrides:
fillRoundRect in class drawable

draw3DRect

public void draw3DRect(int x,
                       int y,
                       int w,
                       int h,
                       boolean raised)
Overrides:
draw3DRect in class drawable

fill3DRect

public void fill3DRect(int x,
                       int y,
                       int w,
                       int h,
                       boolean raised)
Overrides:
fill3DRect in class drawable

drawOval

public void drawOval(int x,
                     int y,
                     int w,
                     int h)
Overrides:
drawOval in class drawable

fillOval

public void fillOval(int x,
                     int y,
                     int w,
                     int h)
Overrides:
fillOval in class drawable

drawArc

public void drawArc(int x,
                    int y,
                    int w,
                    int h,
                    int start_ang,
                    int arc_ang)
Overrides:
drawArc in class drawable

fillArc

public void fillArc(int x,
                    int y,
                    int w,
                    int h,
                    int start_ang,
                    int arc_ang)
Overrides:
fillArc in class drawable

drawPolygon

public void drawPolygon(int[] xp,
                        int[] yp,
                        int np)
Overrides:
drawPolygon in class drawable

drawPolygon

public void drawPolygon(java.awt.Polygon p)
Overrides:
drawPolygon in class drawable

fillPolygon

public void fillPolygon(int[] xp,
                        int[] yp,
                        int np)
Overrides:
fillPolygon in class drawable

fillPolygon

public void fillPolygon(java.awt.Polygon p)
Overrides:
fillPolygon in class drawable

drawString

public void drawString(java.lang.String str,
                       int x,
                       int y)
Overrides:
drawString in class drawable

drawChars

public void drawChars(char[] data,
                      int off,
                      int len,
                      int x,
                      int y)
Overrides:
drawChars in class drawable

drawBytes

public void drawBytes(byte[] data,
                      int off,
                      int len,
                      int x,
                      int y)
Overrides:
drawBytes in class drawable

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.image.ImageObserver observer)
Overrides:
drawImage in class drawable

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int w,
                         int h,
                         java.awt.image.ImageObserver obs)
Overrides:
drawImage in class drawable

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver obs)
Overrides:
drawImage in class drawable

drawImage

public boolean drawImage(java.awt.Image img,
                         int x,
                         int y,
                         int w,
                         int h,
                         java.awt.Color bgcolor,
                         java.awt.image.ImageObserver obs)
Overrides:
drawImage in class drawable

toString

public java.lang.String toString()
Convert to a human readable string.
Overrides:
toString in class drawable