sub_arctic.style
Class blank_base

java.lang.Object
  |
  +--sub_arctic.style.composition_part_base
        |
        +--sub_arctic.style.blank_base
Direct Known Subclasses:
h_fill_blank, hv_fill_blank, v_fill_blank

public abstract class blank_base
extends composition_part_base
implements blank

This abstract class provides functionallity common to several classes of blanks. In particular it maintains both internal and extern geometry.


Field Summary
protected  int _draw_area_h
          Height of interior drawing area.
protected  int _draw_area_w
          Width of interior drawing area.
protected  int _draw_area_x_off
          Offset from left edge of bounding box to the left edge of the interior drawing area.
protected  int _draw_area_y_off
          Offset from top edge of bounding box to the top edge of the interior drawing area.
protected  int _h
          Height of the blank image.
protected  int _w
          Width of the blank image.
 
Fields inherited from class sub_arctic.style.composition_part_base
_feature_points, _x, _y
 
Constructor Summary
blank_base()
           
 
Method Summary
 blank build(int size_kind, int req_w, int req_h)
          Create a new blank of a given size using this one as a protype.
abstract  blank build(int w_size_kind, int req_w, int h_size_kind, int req_h)
          Build a new blank like this one, but with a different size.
 boolean can_set_h()
          Indicate whether this object supports setting height.
 boolean can_set_w()
          Indicate whether this object supports setting width.
 int draw_area_h()
          Height of interior drawing area.
 int draw_area_w()
          Width of interior drawing area.
 int draw_area_x_off()
          Offset from left edge of bounding box to the left edge of the interior drawing area.
 int draw_area_y_off()
          Offset from top edge of bounding box to the top edge of the interior drawing area.
abstract  void draw_self(drawable on_surface, int at_x, int at_y)
          Draw the image of the blank on the given drawing surface with the top left corner of its bounding box at the given location.
 int h()
          Height of the blank image.
 void set_draw_area_h(int val)
          Set the height of interior drawing area.
 void set_draw_area_w(int val)
          Set the width of interior drawing area.
 void set_h(int val)
          Set the height of this object to the given value.
 void set_w(int val)
          Set the width of this object to the given value.
 int w()
          Width of the blank image.
 
Methods inherited from class sub_arctic.style.composition_part_base
feature_point, num_feature_points, set_feature_points, set_x, set_y, toString, x, y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_w

protected int _w
Width of the blank image.

_h

protected int _h
Height of the blank image.

_draw_area_x_off

protected int _draw_area_x_off
Offset from left edge of bounding box to the left edge of the interior drawing area.

_draw_area_y_off

protected int _draw_area_y_off
Offset from top edge of bounding box to the top edge of the interior drawing area.

_draw_area_w

protected int _draw_area_w
Width of interior drawing area.

_draw_area_h

protected int _draw_area_h
Height of interior drawing area.
Constructor Detail

blank_base

public blank_base()
Method Detail

w

public int w()
Width of the blank image.
Returns:
int the width of the blank image.
Overrides:
w in class composition_part_base

can_set_w

public boolean can_set_w()
Indicate whether this object supports setting width. By default we do.
Returns:
boolean indicating whether w and/or draw_area_w is setable.
Overrides:
can_set_w in class composition_part_base

set_w

public void set_w(int val)
Set the width of this object to the given value. Here we attempt to maintain the same border for interior geometry. That is, draw_area_x_off will be maintained as is, but draw_area_w will be changed to keep the same right border. If a size less than the minimum width is requested the object will be (silently) set to the minimum width.
Overrides:
set_w in class composition_part_base

h

public int h()
Height of the blank image.
Returns:
int the height of the blank image.
Overrides:
h in class composition_part_base

can_set_h

public boolean can_set_h()
Indicate whether this object supports setting height. By default we do.
Returns:
boolean indicating whether h and/or draw_area_h is setable.
Overrides:
can_set_h in class composition_part_base

set_h

public void set_h(int val)
Set the height of this object to the given value. Here we attempt to maintain the same border for interior geometry. That is, draw_area_y_off will be maintained as is, but draw_area_h will be changed to keep the same bottom border. If a size less than the minimum height is requested the object will be (silently) set to the minimum height.
Overrides:
set_h in class composition_part_base

draw_area_x_off

public int draw_area_x_off()
Offset from left edge of bounding box to the left edge of the interior drawing area.
Specified by:
draw_area_x_off in interface blank
Returns:
int the x position of the interior drawing area.

draw_area_y_off

public int draw_area_y_off()
Offset from top edge of bounding box to the top edge of the interior drawing area.
Specified by:
draw_area_y_off in interface blank
Returns:
int the y position of the interior drawing area.

draw_area_w

public int draw_area_w()
Width of interior drawing area.
Specified by:
draw_area_w in interface blank
Returns:
int the width of the interior drawing area.

set_draw_area_w

public void set_draw_area_w(int val)
Set the width of interior drawing area. This sets the overall (exterior) width to match.
Specified by:
set_draw_area_w in interface blank
Parameters:
int - val the new width of the interior drawing area (must be >= 0).

draw_area_h

public int draw_area_h()
Height of interior drawing area.
Specified by:
draw_area_h in interface blank
Returns:
int the height of the interior drawing area.

set_draw_area_h

public void set_draw_area_h(int val)
Set the height of interior drawing area. This sets the overall (exterior) height to match.
Specified by:
set_draw_area_h in interface blank
Parameters:
int - val the new height of the interior drawing area (must be >= 0).

draw_self

public abstract void draw_self(drawable on_surface,
                               int at_x,
                               int at_y)
Draw the image of the blank on the given drawing surface with the top left corner of its bounding box at the given location.
Specified by:
draw_self in interface blank
Parameters:
drawable - on_surface the drawing surface to draw on.
int - at_x the x location to place the image at.
int - at_y the y location to place the image at.
Overrides:
draw_self in class composition_part_base

build

public blank build(int size_kind,
                   int req_w,
                   int req_h)
Create a new blank of a given size using this one as a protype. Sizes can be specified as interior size (indicating allowable internal drawing area) or exterior size (indicating the bound of the resulting blank) by coding INTERIOR_SIZED or EXTERIOR_SIZED respectively, for the first parameter.
Specified by:
build in interface blank
Parameters:
int - size_kind either EXTERIOR_SIZED or INTERIOR_SIZED to indicate whether the given size request is for the whole image or the interior drawing area within the blank. EXTERIOR_SIZED requests below a minimum size may result in creation of a blank at the (larger) minimum size instead of the requested size.
int - req_w requested width.
int - req_h requested height.
Returns:
blank a new blank constructed based on this one as a prototype.

build

public abstract blank build(int w_size_kind,
                            int req_w,
                            int h_size_kind,
                            int req_h)
Build a new blank like this one, but with a different size. In this case sizes in the two dimensions can be specified independently as either interior size (indicating allowable internal drawing area) or exterior size (indicating the bound of the resulting blank) by coding INTERIOR_SIZED or EXTERIOR_SIZED respectively.
Specified by:
build in interface blank
Parameters:
int - w_size_kind either EXTERIOR_SIZED or INTERIOR_SIZED to indicate whether the given size request is for the external width of the whole blank or the interior drawing width within the blank. EXTERIOR_SIZED requests below a minimum size may result in creation of a blank at the (larger) minimum size instead of the requested size.
int - req_w requested width.
int - h_size_kind either EXTERIOR_SIZED or INTERIOR_SIZED to indicate whether the given size request is for the external width of the whole blank or the interior drawing width within the blank. EXTERIOR_SIZED requests below a minimum size may result in creation of a blank at the (larger) minimum size instead of the requested size.
int - req_h requested height.
Returns:
blank a new blank constructed based on this one as a prototype.