sub_arctic.style
Class op1_placement_rule

java.lang.Object
  |
  +--sub_arctic.style.op1_placement_rule
Direct Known Subclasses:
op2_placement_rule

public abstract class op1_placement_rule
extends java.lang.Object
implements comp_placement_rule

This abstract class provides most of the mechanism for a composition placement rule computing an equation with one referent (operand).

See Also:
composer, composition_part

Field Summary
protected  int _ref_coord1
          Designator for the coordinate value within the referent object that we are expressed relative to.
protected  int _ref_num1
          Number of the part, parameter, or constant being refered to in the referent.
protected  int _ref_obj1
          Designator for the object we our single operand refers to (the referent object).
 
Constructor Summary
op1_placement_rule(int referent, int referent_num, int referent_coord)
          Full constructor.
 
Method Summary
abstract  int eval(composer comp_obj)
          Evaluate the rule to produce a value.
 int get_op1(composer comp_obj)
          Fetch the up-to-date value of the single referent (operand) for this rule.
 int ref_coord1()
          Designator for the coordinate value within the referent object that we are expressed relative to.
 int ref_num1()
          Number of the part, parameter, or constant being refered to in the referent.
 int ref_obj1()
          Designator for the object we our single operand refers to (the referent object).
 void set_ref_coord1(int val)
          Set the Designator for the coordinate value within the referent object that we are expressed relative to.
 void set_ref_num1(int val)
          Set the number of the part, parameter, or constant being refered to in the referent.
 void set_ref_obj1(int val)
          Set the Designator for the object we our single operand refers to (the referent object).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ref_obj1

protected int _ref_obj1
Designator for the object we our single operand refers to (the referent object). This must be one of the values PART, PARM, or CONST.

_ref_num1

protected int _ref_num1
Number of the part, parameter, or constant being refered to in the referent.

_ref_coord1

protected int _ref_coord1
Designator for the coordinate value within the referent object that we are expressed relative to. This must be one of the values LEFT, RIGHT, TOP, BOTTOM, HCENTER, or VCENTER, or must be constucted as from a feature point number (FPN) using either: (FPN << FEATURE_SHIFT) | FEATURE_X to designate the x value of a feature point, or as (FPN << FEATURE_SHIFT) | FEATURE_Y to designate the y value of a feature point.
Constructor Detail

op1_placement_rule

public op1_placement_rule(int referent,
                          int referent_num,
                          int referent_coord)
Full constructor.
Parameters:
int - referent designator for which object we are computed from. This must be one of PART, PARM, or CONST.
int - refernent_num Number of part or parameter being refered to (or a constant value if referent == CONST).
int - referent_coord designator for which coordinate of the referent This must either be one of LEFT, RIGHT, TOP, BOTTOM, HCENTER, or VCENTER, or it must be constructed from a feature point number (FPN) using either: (FPN << FEATURE_SHIFT) | FEATURE_X to designate the x value of a feature point, or as (FPN << FEATURE_SHIFT) | FEATURE_Y to designate the y value of a feature point.
Method Detail

ref_obj1

public int ref_obj1()
Designator for the object we our single operand refers to (the referent object). This must be one of the values PART, PARM, or CONST.
Returns:
int the designator constant.

set_ref_obj1

public void set_ref_obj1(int val)
Set the Designator for the object we our single operand refers to (the referent object). This must be one of the values PART, PARM, or CONST.
Parameters:
int - val the new designator constant.

ref_num1

public int ref_num1()
Number of the part, parameter, or constant being refered to in the referent.
Returns:
int the number.

set_ref_num1

public void set_ref_num1(int val)
Set the number of the part, parameter, or constant being refered to in the referent.
Parameters:
int - val the new number.

ref_coord1

public int ref_coord1()
Designator for the coordinate value within the referent object that we are expressed relative to. This must be one of the values LEFT, RIGHT, TOP, BOTTOM, HCENTER, or VCENTER, or must be constucted as from a feature point number (FPN) using either: (FPN << FEATURE_SHIFT) | FEATURE_X to designate the x value of a feature point, or as (FPN << FEATURE_SHIFT) | FEATURE_Y to designate the y value of a feature point.
Returns:
int the designator constant.

set_ref_coord1

public void set_ref_coord1(int val)
Set the Designator for the coordinate value within the referent object that we are expressed relative to. This must be one of the values LEFT, RIGHT, TOP, BOTTOM, HCENTER, or VCENTER, or must be constucted as from a feature point number (FPN) using either: (FPN << FEATURE_SHIFT) | FEATURE_X to designate the x value of a feature point, or as (FPN << FEATURE_SHIFT) | FEATURE_Y to designate the y value of a feature point.
Parameters:
int - val the new designator constant.

get_op1

public int get_op1(composer comp_obj)
Fetch the up-to-date value of the single referent (operand) for this rule. This may require computing that value if it hasn't been computed yet.
Parameters:
composer - comp_obj the composer object doing the evaluation. This object provides access the referent and keeps bookkeeping regarding whether it has already been computed.
Returns:
int the up-to-date value of referent.

eval

public abstract int eval(composer comp_obj)
Evaluate the rule to produce a value. This basically just executes the function associated with the rule. Here this is still abstract.
Specified by:
eval in interface comp_placement_rule
Parameters:
composer - comp_obj the composer object doing the evaluation. This object provides access the value of other parts, and to the set of parameters to the composition. It also keeps some of the evauation bookkeeping.
Returns:
int the result of the evaluation.