sub_arctic.style
Class shadow_rect_blank

java.lang.Object
  |
  +--sub_arctic.style.composition_part_base
        |
        +--sub_arctic.style.blank_base
              |
              +--sub_arctic.style.hv_fill_blank
                    |
                    +--sub_arctic.style.shadow_rect_blank
Direct Known Subclasses:
shadow_roundrect_blank

public class shadow_rect_blank
extends hv_fill_blank

This class implements a simple blank base on a rectangle with a highlight color one pixel above and left, and a shadow color one pixel below and right.


Field Summary
protected  boolean _draw_border
          Indication of whether to draw a border (in black)
protected  java.awt.Color _hilight_color
          Color for the hilight above the blank
protected  java.awt.Color _main_color
          Color for the main area of the blank
protected  java.awt.Color _shadow_color
          Color for the shadow below the blank
protected static int border_size
          Constant for border size.
protected static int shadow_size
          Constant for shadow and highlight size (in pixels).
 
Fields inherited from class sub_arctic.style.blank_base
_draw_area_h, _draw_area_w, _draw_area_x_off, _draw_area_y_off, _h, _w
 
Fields inherited from class sub_arctic.style.composition_part_base
_feature_points, _x, _y
 
Constructor Summary
shadow_rect_blank(int size_kind, int req_w, int req_h, java.awt.Color in_color, java.awt.Color hi_color, java.awt.Color shad_color, boolean draw_brd)
          Construct a blank based on a size 3 colors (main, highlight, and shadow), and a border draw flag.
shadow_rect_blank(int w_kind, int req_w, int h_kind, int req_h, java.awt.Color in_color, java.awt.Color hi_color, java.awt.Color shad_color, boolean draw_brd)
          Construct a blank based on a size 3 colors (main, highlight, and shadow), and a border draw flag.
 
Method Summary
 blank build(int w_kind, int req_w, int h_kind, int req_h)
          Create a new blank of a given size using this one as a prototype.
 boolean draw_border()
          Do we draw a border around the main area (in black)
 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.
 java.awt.Color hilight_color()
          Color for the higlight above the blank
 java.awt.Color main_color()
          Color for the main area of the blank
 void set_draw_border(boolean val)
          Set whether draw a border around the main area (in black)
 void set_hilight_color(java.awt.Color clr)
          Set the color the highlight above the blank gets drawn in.
 void set_main_color(java.awt.Color clr)
          Set the color the color of the main area of the blank
 void set_shadow_color(java.awt.Color clr)
          Set the color the shadow below the blank gets drawn in.
 java.awt.Color shadow_color()
          Color for the shadow below the blank
 
Methods inherited from class sub_arctic.style.blank_base
build, can_set_h, can_set_w, draw_area_h, draw_area_w, draw_area_x_off, draw_area_y_off, h, set_draw_area_h, set_draw_area_w, set_h, set_w, w
 
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

_main_color

protected java.awt.Color _main_color
Color for the main area of the blank

_hilight_color

protected java.awt.Color _hilight_color
Color for the hilight above the blank

_shadow_color

protected java.awt.Color _shadow_color
Color for the shadow below the blank

_draw_border

protected boolean _draw_border
Indication of whether to draw a border (in black)

shadow_size

protected static final int shadow_size
Constant for shadow and highlight size (in pixels).

border_size

protected static final int border_size
Constant for border size. The border for this blank is uniform and leaves room for the shadow or highlight plus 1 pixel. (We are basically ignoring the round corners here.)
Constructor Detail

shadow_rect_blank

public shadow_rect_blank(int w_kind,
                         int req_w,
                         int h_kind,
                         int req_h,
                         java.awt.Color in_color,
                         java.awt.Color hi_color,
                         java.awt.Color shad_color,
                         boolean draw_brd)
Construct a blank based on a size 3 colors (main, highlight, and shadow), and a border draw flag. Sizes can be either EXTERIOR_SIZED, or INTERIOR_SIZED indicating overall size of the blank, or size of the drawable area of the blank, respectively. If requested, the border will be drawn one pixel wide around the main area in black.
Parameters:
int - w_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.
int - req_w requested width.
int - h_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.
int - req_h requested height.
Color - in_color main color of blank.
Color - hi_color highligh color drawn at top and left.
Color - shad_color shadow color drawn at bottom and right.
boolean - draw_brd do we draw the border

shadow_rect_blank

public shadow_rect_blank(int size_kind,
                         int req_w,
                         int req_h,
                         java.awt.Color in_color,
                         java.awt.Color hi_color,
                         java.awt.Color shad_color,
                         boolean draw_brd)
Construct a blank based on a size 3 colors (main, highlight, and shadow), and a border draw flag. Sizes can be either EXTERIOR_SIZED, or INTERIOR_SIZED indicating overall size of the blank, or size of the drawable area of the blank, respectively. If requested, the border will be drawn one pixel wide around the main area in black.
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.
int - req_w requested width.
int - req_h requested height.
Color - in_color main color of blank.
Color - hi_color highligh color drawn at top and left.
Color - shad_color shadow color drawn at bottom and right.
boolean - draw_brd do we draw the border
Method Detail

main_color

public java.awt.Color main_color()
Color for the main area of the blank
Returns:
Color the color used to main area of blank

set_main_color

public void set_main_color(java.awt.Color clr)
Set the color the color of the main area of the blank
Parameters:
Color - clr the new main color

hilight_color

public java.awt.Color hilight_color()
Color for the higlight above the blank
Returns:
Color the color used to draw the highlight with.

set_hilight_color

public void set_hilight_color(java.awt.Color clr)
Set the color the highlight above the blank gets drawn in.
Parameters:
Color - clr the new color to draw the highlight with.

shadow_color

public java.awt.Color shadow_color()
Color for the shadow below the blank
Returns:
Color the color used to draw the shadow with.

set_shadow_color

public void set_shadow_color(java.awt.Color clr)
Set the color the shadow below the blank gets drawn in.
Parameters:
Color - clr the new color to draw the shadow with.

draw_border

public boolean draw_border()
Do we draw a border around the main area (in black)
Returns:
boolean indicating whether we draw

set_draw_border

public void set_draw_border(boolean val)
Set whether draw a border around the main area (in black)
Parameters:
boolean - val indicating whether we draw

build

public blank build(int w_kind,
                   int req_w,
                   int h_kind,
                   int req_h)
Create a new blank of a given size using this one as a prototype. 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.
Parameters:
int - w_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 - h_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_h requested height.
Returns:
blank a new blank constructed based on this one as a prototype.
Overrides:
build in class blank_base

draw_self

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