|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kirk.gui.LineLayout
A custom LayoutManager that lays out components like a vertical FlowLayout that
does not do multiple columns. Each Component is as wide as the container minus
insets minus gaps, or as wide as it prefers to be if it's maximum value is
smaller.
Classes that extend this class make out how high each component is, and where they
are placed (vertically).
Therefore there are 3 abstract methods to override, which are also specified by
the LayoutManager interface. Also provided are methods to retrieve information
about the width.
Note that components are always on the left of the line. There is also only one
component per line. If you want to align your component, or want more components
on a line, put a Panel
on the line and go from there.
Field Summary | |
private int |
horizontalgap
The horizontal gap. |
private int |
verticalgap
The vertical gap. |
Constructor Summary | |
LineLayout()
Constructs a new LineLayout. |
|
LineLayout(int verticalgap)
Constructs a new LineLayout with the given value for the vertical gap, and the default value for the horizontal gap. |
|
LineLayout(int horizontalgap,
int verticalgap)
Constructs a new LineLayout with the given values for the gaps. |
Method Summary | |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Called by a Container that has this LayoutManager as LayoutManager. |
int |
getHorizontalGap()
Returns the horizontal gap. |
int |
getMinimumWidth(java.awt.Container parent)
Returns the minimum width of the passed parent when it would be layed out by this class. |
int |
getPreferredWidth(java.awt.Container parent)
Returns the preferred width of the passed parent when it would be layed out by this class. |
int |
getVerticalGap()
Returns the vertical gap. |
int |
getWidth(java.awt.Container parent,
java.awt.Component component)
Returns the width the passed component should have if it is layed out by this class. |
abstract void |
layoutContainer(java.awt.Container parent)
Lays out the given container. |
abstract java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Returns the minimum size of the container if it get's layed out by this LayoutManager. |
abstract java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Returns the preferred size of the container if it get's layed out by this LayoutManager. |
void |
removeLayoutComponent(java.awt.Component comp)
Called by a Container that has this LayoutManager as LayoutManager. |
void |
setHorizontalGap(int horizontalgap)
Sets the horizontal gap. |
void |
setVerticalGap(int verticalgap)
Sets the vertical gap. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int horizontalgap
private int verticalgap
Constructor Detail |
public LineLayout(int horizontalgap, int verticalgap)
public LineLayout(int verticalgap)
public LineLayout()
Method Detail |
public final int getHorizontalGap()
public final void setHorizontalGap(int horizontalgap)
public final int getVerticalGap()
public final void setVerticalGap(int verticalgap)
public final void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
LayoutManager.addLayoutComponent(java.lang.String,
java.awt.Component)
,
FlowLayout
public final void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
LayoutManager.removeLayoutComponent(java.awt.Component)
,
FlowLayout
public abstract java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
parent
- The Container that the preferred size is wanted of.LayoutManager.preferredLayoutSize(java.awt.Container)
public abstract java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
parent
- The Container that the minimum size is wanted of.LayoutManager.minimumLayoutSize(java.awt.Container)
public abstract void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
parent
- The Container to be layed out.LayoutManager.layoutContainer(java.awt.Container)
public final int getWidth(java.awt.Container parent, java.awt.Component component)
component
should have.public final int getPreferredWidth(java.awt.Container parent)
parent
.public final int getMinimumWidth(java.awt.Container parent)
parent
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |