|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.argouml.swingext.LabelledLayout
This layout manager lines up components in 2 columns. All JLabels are the first column and any component the JLabel is registered with is in a second column next to the label.
The height of each row is the largest minimum height of the 2 components.
The width of the first column is the largest preferred width of the 2 components.
The width of the 2nd column is any left over space or the maximum width of the component, whichever is the least.
LabelledLayout can show multiple panels of label/component pairs. The seperation of these panels is indicated by adding a Seperator component to the parent component. Labelled layout starts a new panel when detecting this Seperator.
Field Summary | |
---|---|
private int |
_hgap
This is the horizontal gap (in pixels) which specifies the space between columns. |
private boolean |
_ignoreSplitters
|
private int |
_labelWidth
The required cell width of the labels column |
private int |
_largestHeight
The height of the child component with the largest height |
private int |
_largestWidth
The width of the child component with the largest width |
private int |
_vgap
This is the vertical gap (in pixels) which specifies the space between rows. |
Constructor Summary | |
---|---|
LabelledLayout()
Construct a new LabelledLayout. |
|
LabelledLayout(boolean ignoreSplitters)
Construct a new LabelledLayout. |
|
LabelledLayout(int hgap,
int vgap)
Construct a new horizontal LabelledLayout with the specified cell spacing. |
Method Summary | |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified component with the specified name to the layout. |
private int |
calculateHeight(int parentHeight,
int totalHeight,
int unknownHeightsLeft,
java.awt.Component childComp)
|
int |
getHgap()
|
private int |
getSectionCount(java.awt.Container parent)
Determine the number of sections. |
private int |
getSectionWidth(java.awt.Container parent,
int sectionCount)
Determine the width of each section from the section count. |
static Seperator |
getSeperator()
|
private int |
getUsableWidth(java.awt.Container parent)
Determine the usable width of the parent. |
int |
getVgap()
|
void |
layoutContainer(java.awt.Container parent)
|
private void |
layoutSection(java.awt.Container parent,
int sectionX,
int sectionWidth,
java.util.ArrayList components)
Layout a single section |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Determines the preferred size of the container argument using this labelled layout. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component with the specified name from the layout. |
void |
setHgap(int hgap)
|
void |
setVgap(int vgap)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int _hgap
getHgap()
,
setHgap(int)
private int _vgap
getVgap()
,
setVgap(int)
private int _largestHeight
private int _largestWidth
private int _labelWidth
private boolean _ignoreSplitters
Constructor Detail |
public LabelledLayout()
public LabelledLayout(boolean ignoreSplitters)
public LabelledLayout(int hgap, int vgap)
Method Detail |
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
name
- the name of the componentcomp
- the component to be addedpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
comp
- the name of the componentpublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
private int getSectionCount(java.awt.Container parent)
private int getSectionWidth(java.awt.Container parent, int sectionCount)
private int getUsableWidth(java.awt.Container parent)
private void layoutSection(java.awt.Container parent, int sectionX, int sectionWidth, java.util.ArrayList components)
private int calculateHeight(int parentHeight, int totalHeight, int unknownHeightsLeft, java.awt.Component childComp)
public static Seperator getSeperator()
public int getHgap()
public void setHgap(int hgap)
public int getVgap()
public void setVgap(int vgap)
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20040306) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |