sub_arctic.style
Class composition_part_base

java.lang.Object
  |
  +--sub_arctic.style.composition_part_base
Direct Known Subclasses:
anchor_pt_comp_part, blank_base, composer, image_comp_part, text_comp_part

public abstract class composition_part_base
extends java.lang.Object
implements composition_part

This class provides an abstract base class for several of the common *_composition_part classes.

See Also:
composer

Field Summary
protected  java.awt.Point[] _feature_points
          Feature point array for this object.
protected  int _x
          Current x location of the object.
protected  int _y
          Current y location of the object.
 
Constructor Summary
composition_part_base()
           
 
Method Summary
 boolean can_set_h()
          Can we set the height of the object.
 boolean can_set_w()
          Can we set the width of the object.
abstract  void draw_self(drawable on_surf, int at_x, int at_y)
          Draw the object on the given drawing surface at the given location.
 java.awt.Point feature_point(int indx)
          Return the feature point corresponding to a given feature point index.
abstract  int h()
          Current height of the object.
 int num_feature_points()
          The number of feature points that this object has.
 void set_feature_points(java.awt.Point[] pts)
          Set the feature point array for this object.
 void set_h(int val)
          Set the height of the object.
 void set_w(int val)
          Set the width of the object.
 void set_x(int val)
          Set the current x location of the object.
 void set_y(int val)
          Set the current y location of the object.
 java.lang.String toString()
          Convert to a human readable string suitable for a debugging dump.
abstract  int w()
          Current width of the object.
 int x()
          Current x location of the object.
 int y()
          Current y location of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_x

protected int _x
Current x location of the object. This is normally set by the composer during layout.

_y

protected int _y
Current y location of the object. This is normally set by the composer during layout.

_feature_points

protected java.awt.Point[] _feature_points
Feature point array for this object. If this is null we assume no feature points, otherwise we have the number of points found in this array.
Constructor Detail

composition_part_base

public composition_part_base()
Method Detail

x

public int x()
Current x location of the object. This is normally set by the composer during layout.
Specified by:
x in interface composition_part
Returns:
int the x location of the object

set_x

public void set_x(int val)
Set the current x location of the object. This is normally set by the composer during layout.
Specified by:
set_x in interface composition_part
Parameters:
int - val the new value for the x location of the object

y

public int y()
Current y location of the object. This is normally set by the composer during layout.
Specified by:
y in interface composition_part
Returns:
int the y location of the object

set_y

public void set_y(int val)
Set the current y location of the object. This is normally set by the composer during layout.
Specified by:
set_y in interface composition_part
Parameters:
int - val the new value for the y location of the object

w

public abstract int w()
Current width of the object. This is subclass dependent.
Specified by:
w in interface composition_part
Returns:
int the width of the object

can_set_w

public boolean can_set_w()
Can we set the width of the object. By default we return false.
Specified by:
can_set_w in interface composition_part
Returns:
boolean indicating whether w is setable.

set_w

public void set_w(int val)
Set the width of the object. By default we don't support width changes, so here in the base class we always throw an error.
Specified by:
set_w in interface composition_part
Parameters:
int - val new value for w.

h

public abstract int h()
Current height of the object. This is subclass dependent.
Specified by:
h in interface composition_part
Returns:
int the height of the object

can_set_h

public boolean can_set_h()
Can we set the height of the object. By default we return false.
Specified by:
can_set_h in interface composition_part
Returns:
boolean indicating whether h is setable.

set_h

public void set_h(int val)
Set the height of the object. By default we don't support height changes, so here in the base class we always throw an error.
Specified by:
set_h in interface composition_part
Parameters:
int - val new value for h.

set_feature_points

public void set_feature_points(java.awt.Point[] pts)
Set the feature point array for this object. If this is null we assume no feature points, otherwise we have the number of points found in this array.
Parameters:
Point[] - pts the new set of feature points (or null for no points).

num_feature_points

public int num_feature_points()
The number of feature points that this object has. A feature point is a significant location within the object that can be used for alignment. Objects need not export their top, bottom, left, or right as feature points since these are already provided by the system.

In our case the number of feature points is determined by the internal _feature_points array.

Specified by:
num_feature_points in interface composition_part
Returns:
int the number of feature points of this object
See Also:
_feature_points, set_feature_points(java.awt.Point[])

feature_point

public java.awt.Point feature_point(int indx)
Return the feature point corresponding to a given feature point index. If this point is no in the range 0 ... num_feature_points()-1, 0,0 is returned.

In our case the features points are controlled by the internal _feature_points array.

Specified by:
feature_point in interface composition_part
Parameters:
int - indx the index of the point being requested.
Returns:
Point the requested feature point.
See Also:
_feature_points, set_feature_points(java.awt.Point[])

draw_self

public abstract void draw_self(drawable on_surf,
                               int at_x,
                               int at_y)
Draw the object on the given drawing surface at the given location. This is subclass dependent.
Specified by:
draw_self in interface composition_part
Parameters:
drawable - on_surf the drawing surface to draw on.
int - at_x the x location to draw at.
int - at_y the y location to draw at.

toString

public java.lang.String toString()
Convert to a human readable string suitable for a debugging dump.
Overrides:
toString in class java.lang.Object