sub_arctic.style
Class op2_placement_rule

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

public abstract class op2_placement_rule
extends op1_placement_rule

This abstract class provides most of the mechanism for a composition placement rule computing an equation with two referents (operands).

See Also:
composer, composition_part

Field Summary
protected  int _ref_coord2
          Designator for the coordinate value within the second referent object.
protected  int _ref_num2
          Number of the part, parameter, or constant being refered to in the second referent.
protected  int _ref_obj2
          Designator for the object our second operand refers to (second referent object).
 
Fields inherited from class sub_arctic.style.op1_placement_rule
_ref_coord1, _ref_num1, _ref_obj1
 
Constructor Summary
op2_placement_rule(int referent1, int referent_num1, int referent_coord1, int referent2, int referent_num2, int referent_coord2)
          Full constructor.
 
Method Summary
abstract  int eval(composer comp_obj)
          Evaluate the rule to produce a value.
 int get_op2(composer comp_obj)
          Fetch the up-to-date value of the second referent (operand) for this rule.
 int ref_coord2()
          Designator for the coordinate value within the second referent object.
 int ref_num2()
          Number of the part, parameter, or constant being refered to in the second referent.
 int ref_obj2()
          Designator for the object our second operand refers to (second referent object).
 void set_ref_coord2(int val)
          Set the designator for the coordinate value within the second referent object.
 void set_ref_num2(int val)
          Set the number of the part, parameter, or constant being refered to in the second referent.
 void set_ref_obj2(int val)
          Set the Designator for the object our second operand refers to (second referent object).
 
Methods inherited from class sub_arctic.style.op1_placement_rule
get_op1, ref_coord1, ref_num1, ref_obj1, set_ref_coord1, set_ref_num1, set_ref_obj1
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ref_obj2

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

_ref_num2

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

_ref_coord2

protected int _ref_coord2
Designator for the coordinate value within the second referent object. 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

op2_placement_rule

public op2_placement_rule(int referent1,
                          int referent_num1,
                          int referent_coord1,
                          int referent2,
                          int referent_num2,
                          int referent_coord2)
Full constructor.
Parameters:
int - referent1 designator for first referent object. This must be one of PART, PARM, or CONST.
int - refernent_num1 Number of part or parameter being refered to (or a constant value if referent == CONST).
int - referent_coord1 designator for which coordinate of the first referent is being refered to. 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.
int - referent2 designator for second referent object. This must be one of PART, PARM, or CONST.
int - refernent_num2 Number of part or parameter being refered to (or a constant value if referent == CONST).
int - referent_coord2 designator for which coordinate of the second referent is being refered to. 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_obj2

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

set_ref_obj2

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

ref_num2

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

set_ref_num2

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

ref_coord2

public int ref_coord2()
Designator for the coordinate value within the second referent object. 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_coord2

public void set_ref_coord2(int val)
Set the designator for the coordinate value within the second referent object. 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_op2

public int get_op2(composer comp_obj)
Fetch the up-to-date value of the second 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.
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.
Overrides:
eval in class op1_placement_rule