Class sub_arctic.lib.column
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sub_arctic.lib.column

java.lang.Object
   |
   +----sub_arctic.lib.min_interactor
           |
           +----sub_arctic.lib.base_interactor
                   |
                   +----sub_arctic.lib.base_parent_interactor
                           |
                           +----sub_arctic.lib.column

public class column
extends base_parent_interactor
This object is a composition that puts its children in a tiled column from top to bottom. It can be aligned with LEFT, RIGHT, or CENTER justification.
Author:
Ian Smith

Variable Index

 o _border
Border around all the children.
 o _boxed
If this variable is set, the interactor has a box around it.
 o _colors
This holds the color pair in use for this object.
 o _interchild_space
The spacing between children.
 o _layout_type
The layout type for this column.
 o _opaque
If this variable is set, the interactor has an opaque background.
 o _size_by_children
This holds our state variable about whether or not we are sized by our children.
 o CENTER_JUSTIFIED
Constant to denote centered layout.
 o LEFT_JUSTIFIED
Constant to denote left justified layout.
 o RIGHT_JUSTIFIED
Constant to denote right justified layout

Constructor Index

 o column(int, byte)
Minimal column constructor.
 o column(int, int, boolean, boolean, byte)
Smaller column constructor.
 o column(int, int, int, int, int, int, boolean, boolean, boolean, byte, color_pair)
Full constructor for a column.

Method Index

 o add_child(interactor)
Override from base_interactor to also add constraints
 o border()
Return the border around all the children (in pixels).
 o boxed()
Return whether or not the interactor has a box around it.
 o colors()
Return the current color pair.
 o draw_self_local(drawable)
Draw the object on the provided drawable
 o insert_child(int, interactor)
Override to also add constraints
 o interchild_space()
Return the spacing between children.
 o layout_type()
The layout type for this column.
 o opaque()
Return whether or not the interactor has an opaque background
 o remove_child(int)
Override to also add constraints
 o remove_child(interactor)
Override to also add constraints
 o set_border(int)
Set border all around the children.
 o set_boxed(boolean)
Control whether or not the interactor has a box around it.
 o set_child(int, interactor)
Overridden from base_interactor to also add constraints
 o set_child_constraints()
Establish or reestablish constraints on children to form a column.
 o set_colors(color_pair)
Set the current color pair.
 o set_interchild_space(int)
Set the spacing between children.
 o set_layout_type(byte)
Set the layout type for this column.
 o set_local_constraints()
Set the constraint for this object's width and height.
 o set_opaque(boolean)
Control whether or not the interactor has an opaque background
 o set_size_by_children(boolean)
Control whether or not we are sized by our children.
 o size_by_children()
Return whether or not we are sized by our children.

Variables

 o _size_by_children
  protected boolean _size_by_children
This holds our state variable about whether or not we are sized by our children. This variable should be set at construction time, but can later be changed if necessary. Note: be careful about changing this after construction time! If it was on and you turn it off, nothing will happen, but you should take into account from then on that the column won't size itself to its children automatically. If it was off and you turn it on, your column's size will change at that point, so you should be sure there will be enough room, etc... for it
 o _boxed
  protected boolean _boxed
If this variable is set, the interactor has a box around it.
 o _opaque
  protected boolean _opaque
If this variable is set, the interactor has an opaque background.
 o _border
  protected int _border
Border around all the children.
 o _colors
  protected color_pair _colors
This holds the color pair in use for this object. null indicates to use the system default color pair.
 o _interchild_space
  protected int _interchild_space
The spacing between children.
 o CENTER_JUSTIFIED
  public final static byte CENTER_JUSTIFIED
Constant to denote centered layout.
 o LEFT_JUSTIFIED
  public final static byte LEFT_JUSTIFIED
Constant to denote left justified layout.
 o RIGHT_JUSTIFIED
  public final static byte RIGHT_JUSTIFIED
Constant to denote right justified layout
 o _layout_type
  protected byte _layout_type
The layout type for this column.

Constructors

 o column
  public column(int xv,
                int yv,
                int wv,
                int hv,
                int b,
                int ic,
                boolean box,
                boolean o,
                boolean sbc,
                byte lt,
                color_pair cp)
Full constructor for a column.
Parameters:
int - xv the x position of this interactor.
int - yv the y position of this interactor.
int - wv the width of this interactor.
int - hv the height of this interactor.
int - b the border around the children of this column.
int - ic the inter-child spacing for this column.
boolean - box whether or not you want a box around this interactor.
boolean - o whether or not the object has an opaque background.
boolean - sbc pass true if this column's size should be controlled by its children, false to use the size passed by the user and/or constraints.
byte - lt the type of layout you want for this column (must be one of the constants CENTER_JUSTIFIED, RIGHT_JUSTIFIED, LEFT_JUSTIFIED).
color_pair - cp the color pair to use if this object is opaque (if you use null here you'll get the system's default color pair).
 o column
  public column(int b,
                int ic,
                boolean box,
                boolean o,
                byte lt)
Smaller column constructor. This assumes that you want to just set the actual parameters of the column and you will use constraints to do all positioning. It uses the system default colors and assumes your width and height will be controlled by the children.
Parameters:
int - b the border around the children of this row
int - ic the inter-child spacing for this row
boolean - box whether or not you want a box around this interactor
boolean - o whether or not the object is opaque
byte - b the type of layout you want for this row (must be one of the constants CENTER_JUSTIFIED, TOP_JUSTIFIED, BOTTOM_JUSTIFIED).
 o column
  public column(int ic,
                byte lt)
Minimal column constructor. This assumes that you want to use constraints for position and children for size. It makes the column not have a border and be opaque and have no whitespace border around its edges. This uses the system's default colors.
Parameters:
int - ic the inter-child spacing for this column
byte - b the type of layout you want for this column (must be one of the constants CENTER_JUSTIFIED, LEFT_JUSTIFIED, RIGHT_JUSTIFIED).

Methods

 o size_by_children
  public boolean size_by_children()
Return whether or not we are sized by our children.
Returns:
boolean true if we are sized by our children
 o set_size_by_children
  public void set_size_by_children(boolean b)
Control whether or not we are sized by our children. Note: be careful about changing this after construction time! If it was on and you turn it off, nothing will happen, but you should take into account from then on that the column won't size itself to its children automatically. If it was off and you turn it on, your column's size will change at that point, so you should be sure there will be enough room, etc... for it
Parameters:
boolean - b whether to size ourselves by our children
 o boxed
  public boolean boxed()
Return whether or not the interactor has a box around it.
Returns:
boolean true if the column has a box around it
 o set_boxed
  public void set_boxed(boolean b)
Control whether or not the interactor has a box around it.
Parameters:
boolean - b new state of boxedness
 o opaque
  public boolean opaque()
Return whether or not the interactor has an opaque background
Returns:
boolean true if the column is opaque
 o set_opaque
  public void set_opaque(boolean b)
Control whether or not the interactor has an opaque background
Parameters:
boolean - b new state of opaqueness
 o border
  public int border()
Return the border around all the children (in pixels).
Returns:
int the size of the border in pixels
 o set_border
  public void set_border(int v)
Set border all around the children.
Parameters:
int - v the size of the border around the children in pixels
 o colors
  public color_pair colors()
Return the current color pair. If you get null, we are using the system's default color pair. Note that the color pair for this interactor is not consulted if the object is not opaque.
Returns:
color_pair the current color pair
 o set_colors
  public void set_colors(color_pair cp)
Set the current color pair. If you set this to null, you'll get the system default color pair.
Parameters:
color_pair - cp the new color_pair for this interactor
 o interchild_space
  public int interchild_space()
Return the spacing between children.
Returns:
int the space between the children in the row (in pixels)
 o set_interchild_space
  public void set_interchild_space(int v)
Set the spacing between children.
Parameters:
int - v the new interchild spacing
 o layout_type
  public byte layout_type()
The layout type for this column.
Returns:
byte the type of layout in use in this interactor (must be one of the constants CENTER_JUSTIFIED, LEFT_JUSTIFIED, RIGHT_JUSTIFIED)
 o set_layout_type
  public void set_layout_type(byte v)
Set the layout type for this column.
Parameters:
byte - the type of layout you want (must be one of the constants CENTER_JUSTIFIED, TOP_JUSTIFIED, BOTTOM_JUSTIFIED)
 o set_local_constraints
  public void set_local_constraints()
Set the constraint for this object's width and height.
 o set_child_constraints
  protected void set_child_constraints()
Establish or reestablish constraints on children to form a column.
 o draw_self_local
  protected void draw_self_local(drawable d)
Draw the object on the provided drawable
Parameters:
drawable - d the surface to draw on
Overrides:
draw_self_local in class base_interactor
 o set_child
  public void set_child(int at_indx,
                        interactor chld)
Overridden from base_interactor to also add constraints
Parameters:
int - at_indx the index position at which to change the child.
interactor - chld the new child interactor for that position.
Overrides:
set_child in class base_interactor
 o add_child
  public void add_child(interactor chld)
Override from base_interactor to also add constraints
Parameters:
interactor - chld the child interactor to add
Overrides:
add_child in class base_interactor
 o insert_child
  public void insert_child(int at_indx,
                           interactor chld)
Override to also add constraints
Parameters:
int - at_indx the index position at which to insert the child
interactor - chld the child interactor to insert
Overrides:
insert_child in class base_interactor
 o remove_child
  public interactor remove_child(int at_indx)
Override to also add constraints
Parameters:
int - at_indx the index position of the child to remove
Overrides:
remove_child in class base_interactor
 o remove_child
  public void remove_child(interactor the_child)
Override to also add constraints
Parameters:
interactor - the_child the child to remove
Overrides:
remove_child in class base_interactor

All Packages  Class Hierarchy  This Package  Previous  Next  Index