|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.extended.layout.AbstractLayoutManager com.alee.extended.layout.AlignLayout
public class AlignLayout
This layout allows you to align components inside the container using the standart Swing constants.
Field Summary | |
---|---|
protected java.util.Map<java.awt.Component,java.lang.String> |
constraints
Constraints cache for added components. |
protected boolean |
hfill
Whether components should fill all available horizontal space or not. |
protected int |
hgap
Horizontal gap between components. |
static java.util.List<java.lang.Integer> |
horizontals
Horizontal alignment constraints. |
static java.lang.String |
SEPARATOR
Layout constraints separator. |
static java.util.List<java.lang.Integer> |
verticals
Vertical alignment constraints. |
protected boolean |
vfill
Whether components should fill all available vertical space or not. |
protected int |
vgap
Vertical gap between components. |
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 | |
---|---|
AlignLayout()
Constructs new align layout. |
Method Summary | |
---|---|
void |
addComponent(java.awt.Component component,
java.lang.Object constraints)
Caled when component added into container with this layout. |
protected int |
getHalign(java.lang.String name)
Returns horizontal alignment for the specified constraint. |
int |
getHgap()
Returns horizontal gap between components. |
protected java.awt.Dimension |
getSideSize(java.awt.Container parent,
int halign,
int valign)
Returns size for the side specified by horizontal and vertical alignments. |
protected int |
getValign(java.lang.String name)
Returns vertical alignment for the specified constraint. |
int |
getVgap()
Returns vertical gap between components. |
protected void |
illegalArgument()
Throws illegal argument (constraint) exception. |
boolean |
isHfill()
Returns whether components should fill all available horizontal space or not. |
boolean |
isVfill()
Returns whether components should fill all available vertical space or not. |
void |
layoutContainer(java.awt.Container parent)
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
|
void |
removeComponent(java.awt.Component component)
Called when component removed from container with this layout. |
void |
setHfill(boolean hfill)
Sets whether components should fill all available horizontal space or not. |
void |
setHgap(int hgap)
Sets horizontal gap between components. |
void |
setVfill(boolean vfill)
Sets whether components should fill all available vertical space or not. |
void |
setVgap(int vgap)
Sets vertical gap between components. |
Methods inherited from class com.alee.extended.layout.AbstractLayoutManager |
---|
addLayoutComponent, addLayoutComponent, getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, maximumLayoutSize, minimumLayoutSize, removeLayoutComponent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SEPARATOR
public static final java.util.List<java.lang.Integer> horizontals
public static final java.util.List<java.lang.Integer> verticals
protected final java.util.Map<java.awt.Component,java.lang.String> constraints
protected int hgap
protected int vgap
protected boolean hfill
protected boolean vfill
Constructor Detail |
---|
public AlignLayout()
Method Detail |
---|
public int getHgap()
public void setHgap(int hgap)
hgap
- new horizontal gap between componentspublic int getVgap()
public void setVgap(int vgap)
vgap
- new vertical gap between componentspublic boolean isHfill()
public void setHfill(boolean hfill)
hfill
- whether components should fill all available horizontal space or notpublic boolean isVfill()
public void setVfill(boolean vfill)
vfill
- whether components should fill all available vertical space or notpublic void addComponent(java.awt.Component component, java.lang.Object constraints)
addComponent
in class AbstractLayoutManager
component
- added componentconstraints
- component constraintsprotected void illegalArgument()
protected int getHalign(java.lang.String name)
name
- constraint
protected int getValign(java.lang.String name)
name
- constraint
public void removeComponent(java.awt.Component component)
removeComponent
in class AbstractLayoutManager
component
- removed componentpublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
protected java.awt.Dimension getSideSize(java.awt.Container parent, int halign, int valign)
parent
- containerhalign
- horizontal alignmentvalign
- vertical alignment
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |