|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.gui.AlignedLayout
Layout that maintains a single component
in a justified position within the parent container.
This class is a more general replacement for the
class
introduced in JPT v1.0.1.CenterLayout
CenterLayout| Field Summary | |
protected int |
alignment
Alignment for this layout. |
protected Component |
c
Component to be maintained by this layout. |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
AlignedLayout()
Constructs a layout using southwest alignment. |
|
AlignedLayout(int alignment)
Constructs a layout using the given alignment. |
|
| Method Summary | |
void |
addLayoutComponent(Component component,
Object constraints)
Adds the given component to the layout by replacing the currently maintained component with the given component. |
void |
addLayoutComponent(String name,
Component component)
Adds the given component to the layout. |
protected Point |
applyAlignment(Dimension cSize,
Dimension pSize,
Point origin)
Returns the point at which a component of the given size should be located within its parent of the given size, translated by the given origin point. |
int |
getAlignment()
Returns the alignment for this layout. |
float |
getLayoutAlignmentX(Container target)
Returns the layout alignment along the x-axis. |
float |
getLayoutAlignmentY(Container target)
Returns the layout alignment along the y-axis. |
void |
invalidateLayout(Container target)
Invalidates this layout. |
void |
layoutContainer(Container parent)
Lays out the parent container by setting the bounds of the component it contains. |
Dimension |
maximumLayoutSize(Container parent)
Returns the maximum size for the parent container given the maximum size of the contained component. |
Dimension |
minimumLayoutSize(Container parent)
Returns the minimum size for the parent container given the minimum size of the contained component. |
Dimension |
preferredLayoutSize(Container parent)
Returns the preferred size for the parent container given the preferred size of the contained component. |
void |
removeLayoutComponent(Component component)
Removes the given component from the layout. |
void |
setAlignment(int align)
Sets the alignment for this layout to the alignment represented by the given value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Component c
protected int alignment
| Constructor Detail |
public AlignedLayout()
AlignedLayout(int)public AlignedLayout(int alignment)
alignment - the alignment for this layoutAlignedLayout(),
JPTConstants.DEFAULT| Method Detail |
public void addLayoutComponent(String name,
Component component)
addLayoutComponent in interface LayoutManagername - the name for this component (ignored)component - the component to be
maintained by this layoutaddLayoutComponent(Component, Object)
public void addLayoutComponent(Component component,
Object constraints)
null,
the currently maintained component is removed.
addLayoutComponent in interface LayoutManager2component - the component to be
maintained by this layoutconstraints - the constraints affecting
this component in the layout (ignored)addLayoutComponent(String, Component)public void removeLayoutComponent(Component component)
removeLayoutComponent in interface LayoutManagercomponent - the component to remove
from this layoutpublic Dimension minimumLayoutSize(Container parent)
Dimension
with zero width and height.
minimumLayoutSize in interface LayoutManagerparent - the parent container using this layoutmaximumLayoutSize(Container),
preferredLayoutSize(Container)public Dimension preferredLayoutSize(Container parent)
Dimension
with zero width and height.
preferredLayoutSize in interface LayoutManagerparent - the parent container using this layoutmaximumLayoutSize(Container),
minimumLayoutSize(Container)public Dimension maximumLayoutSize(Container parent)
Dimension
with the maximum possible width and height.
maximumLayoutSize in interface LayoutManager2parent - the parent container using this layoutminimumLayoutSize(Container),
preferredLayoutSize(Container)public void layoutContainer(Container parent)
layoutContainer in interface LayoutManagerparent - the parent container using this layoutpublic float getLayoutAlignmentY(Container target)
getLayoutAlignmentY in interface LayoutManager2target - the target container for this layoutgetLayoutAlignmentX(Container)public float getLayoutAlignmentX(Container target)
getLayoutAlignmentX in interface LayoutManager2target - the target container for this layoutgetLayoutAlignmentY(Container)public void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2target - the target container for this layoutpublic void setAlignment(int align)
align - the alignment for this layoutgetAlignment(),
JPTConstants.DEFAULTpublic int getAlignment()
setAlignment(int)
protected Point applyAlignment(Dimension cSize,
Dimension pSize,
Point origin)
cSize - the size of the component to locatepSize - the size of the parent componentorigin - the point of origin for translation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||