|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object PIRL.Viewers.Draggable_Rows.Draggable_Rows_Layout
public class Draggable_Rows.Draggable_Rows_Layout
Draggable_Rows_Layout is a LayoutManager for a vertical stack of row Components.
LayoutManager2
Field Summary | |
---|---|
protected static int |
MAXIMUM_DIMENSION
Convenience constants for specifying which layout size dimensions to calculate. |
protected static int |
MINIMUM_DIMENSION
Convenience constants for specifying which layout size dimensions to calculate. |
protected static int |
PREFERRED_DIMENSION
Convenience constants for specifying which layout size dimensions to calculate. |
Method Summary | |
---|---|
void |
addLayoutComponent(Component component,
Object constraints)
|
void |
addLayoutComponent(String name,
Component component)
|
float |
getLayoutAlignmentX(Container container)
Gets the horizontal alignment factor for the layout. |
float |
getLayoutAlignmentY(Container container)
Gets the vertical alignment factor for the layout. |
void |
invalidateLayout(Container container)
The layout constraints for the container are invalidated. |
protected Dimension |
Layout_Size(Container container,
int which_dimension)
Gets the dimensions for a container suitable for laying out the components it contains. |
void |
layoutContainer(Container container)
Layout the container components as stacked rows. |
Dimension |
maximumLayoutSize(Container container)
Gets the maximum layout dimensions for the container. |
Dimension |
minimumLayoutSize(Container container)
Gets the minumum layout dimensions for the container. |
Dimension |
preferredLayoutSize(Container container)
Gets the preferred layout dimensions for the container. |
void |
removeLayoutComponent(Component component)
|
Draggable_Rows.Draggable_Rows_Layout |
setLayoutAlignmentX(float alignment)
Sets the horizontal row alignment factor. |
protected void |
Update_Sizes(Container container)
Calculates a container layout size. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int MINIMUM_DIMENSION
layout size
dimensions to calculate.
protected static final int PREFERRED_DIMENSION
layout size
dimensions to calculate.
protected static final int MAXIMUM_DIMENSION
layout size
dimensions to calculate.
Method Detail |
---|
public Draggable_Rows.Draggable_Rows_Layout setLayoutAlignmentX(float alignment)
An alignment of 0.0 aligns the rows against their left sides; 1.0 aligns against the rights sides; 0.5 aligns rows along their centers; etc.
The initial, default, alignment factor is 0.0.
alignment
- The horizontal alignment factor.
protected void Update_Sizes(Container container)
If the container is empty or its size requirements have not been
invalidated
since they were last
set, then nothing is done.
A set of width and height SizeRequirements
is maintained for
each component and for the entire container. The components' minimum,
preferred and maximum sizes are used; the horizontal alignment factor
is applied.
Components that are not visible have no affect on the layout.
The container's width size requirements are based on the aligned size requirements
of the components; the height size
requirements are based on the tiled
size requirements
of the components.
container
- The container associated with this layout manager.protected Dimension Layout_Size(Container container, int which_dimension)
The container, if it is not empty, has the preferred, minimum or maximum
size, depending on which dimension is specified, of each component
it contains examined. The
container width is the maximum value of the component widths, or the
Draggable_Rows.EMPTY_WIDTH
if there are no components, plus the left and
right insets amount. The container height is the sum of the heights
of all visible components, or zero if there are no components, plus
the top and bottom insets amount.
container
- The container associated with this layout manager.which_dimension
- If the MINIMUM_DIMENSION
, the
minimum sizes will be calculated; if the PREFERRED_DIMENSION
, the preferred size is determined; if the
MAXIMUM_DIMENSION
the maximum size.
Update_Sizes(Container)
,
minimumLayoutSize(Container)
,
preferredLayoutSize(Container)
,
maximumLayoutSize(Container)
public void layoutContainer(Container container)
All components of the container are distributed in top-to-bottom
order as they occur in the container's component list. The
SizeRequirements for the components are first updated
. The the bounds of each component
are then determined using horizontally alignment into a single column
and vertical top-to-bottom distribution into continguous rows.
layoutContainer
in interface LayoutManager
container
- The container associated with this layout manager.public Dimension minimumLayoutSize(Container container)
minimumLayoutSize
in interface LayoutManager
container
- The container associated with this layout manager.
Layout_Size(Container, int)
public Dimension preferredLayoutSize(Container container)
preferredLayoutSize
in interface LayoutManager
container
- The container associated with this layout manager.
Layout_Size(Container, int)
public void addLayoutComponent(String name, Component component)
addLayoutComponent
in interface LayoutManager
public void removeLayoutComponent(Component component)
removeLayoutComponent
in interface LayoutManager
public Dimension maximumLayoutSize(Container container)
maximumLayoutSize
in interface LayoutManager2
container
- The container associated with this layout manager.
Layout_Size(Container, int)
public float getLayoutAlignmentX(Container container)
getLayoutAlignmentX
in interface LayoutManager2
container
- The container associated with this layout manager.
setLayoutAlignmentX(float)
public float getLayoutAlignmentY(Container container)
getLayoutAlignmentY
in interface LayoutManager2
container
- The container associated with this layout manager.
public void addLayoutComponent(Component component, Object constraints)
addLayoutComponent
in interface LayoutManager2
public void invalidateLayout(Container container)
The next time a layout
is to
occur the layout constraints will be updated
.
This method is called by AWT when the invalidate method is called on the Container. Since the invalidate method may be called asynchronously to the event thread, this method may be called asynchronously.
invalidateLayout
in interface LayoutManager2
container
- The affected container.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |