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
-
_border
- Border around all the children.
-
_boxed
- If this variable is set, the interactor has a box around it.
-
_colors
- This holds the color pair in use for this object.
-
_interchild_space
- The spacing between children.
-
_layout_type
- The layout type for this column.
-
_opaque
- If this variable is set, the interactor has an opaque background.
-
_size_by_children
- This holds our state variable about whether or not we are
sized by our children.
-
CENTER_JUSTIFIED
- Constant to denote centered layout.
-
LEFT_JUSTIFIED
- Constant to denote left justified layout.
-
RIGHT_JUSTIFIED
- Constant to denote right justified layout
-
column(int, byte)
-
Minimal column constructor.
-
column(int, int, boolean, boolean, byte)
-
Smaller column constructor.
-
column(int, int, int, int, int, int, boolean, boolean, boolean, byte, color_pair)
-
Full constructor for a column.
-
add_child(interactor)
-
Override from base_interactor to also add constraints
-
border()
- Return the border around all the children (in pixels).
-
boxed()
- Return whether or not the interactor has a box around it.
-
colors()
- Return the current color pair.
-
draw_self_local(drawable)
-
Draw the object on the provided drawable
-
insert_child(int, interactor)
-
Override to also add constraints
-
interchild_space()
-
Return the spacing between children.
-
layout_type()
-
The layout type for this column.
-
opaque()
- Return whether or not the interactor has an opaque background
-
remove_child(int)
-
Override to also add constraints
-
remove_child(interactor)
-
Override to also add constraints
-
set_border(int)
- Set border all around the children.
-
set_boxed(boolean)
- Control whether or not the interactor has a box around it.
-
set_child(int, interactor)
-
Overridden from base_interactor to also add constraints
-
set_child_constraints()
- Establish or reestablish constraints on children to form a column.
-
set_colors(color_pair)
- Set the current color pair.
-
set_interchild_space(int)
-
Set the spacing between children.
-
set_layout_type(byte)
-
Set the layout type for this column.
-
set_local_constraints()
-
Set the constraint for this object's width and height.
-
set_opaque(boolean)
- Control whether or not the interactor has an opaque background
-
set_size_by_children(boolean)
- Control whether or not we are sized by our children.
-
size_by_children()
- Return whether or not we are sized by our children.
_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
_boxed
protected boolean _boxed
- If this variable is set, the interactor has a box around it.
_opaque
protected boolean _opaque
- If this variable is set, the interactor has an opaque background.
_border
protected int _border
- Border around all the children.
_colors
protected color_pair _colors
- This holds the color pair in use for this object. null indicates
to use the system default color pair.
_interchild_space
protected int _interchild_space
- The spacing between children.
CENTER_JUSTIFIED
public final static byte CENTER_JUSTIFIED
- Constant to denote centered layout.
LEFT_JUSTIFIED
public final static byte LEFT_JUSTIFIED
- Constant to denote left justified layout.
RIGHT_JUSTIFIED
public final static byte RIGHT_JUSTIFIED
- Constant to denote right justified layout
_layout_type
protected byte _layout_type
- The layout type for this column.
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).
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).
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).
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
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
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
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
opaque
public boolean opaque()
- Return whether or not the interactor has an opaque background
- Returns:
- boolean true if the column is opaque
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
border
public int border()
- Return the border around all the children (in pixels).
- Returns:
- int the size of the border in pixels
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
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
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
interchild_space
public int interchild_space()
- Return the spacing between children.
- Returns:
- int the space between the children in the row (in pixels)
set_interchild_space
public void set_interchild_space(int v)
- Set the spacing between children.
- Parameters:
- int - v the new interchild spacing
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)
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)
set_local_constraints
public void set_local_constraints()
- Set the constraint for this object's width and height.
set_child_constraints
protected void set_child_constraints()
- Establish or reestablish constraints on children to form a column.
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
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
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
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
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
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