Public Member Functions | |
RiverLayout () | |
RiverLayout (int hgap, int vgap) | |
void | addLayoutComponent (String name, Component comp) |
Insets | getExtraInsets () |
int | getHgap () |
Gets the horizontal gap between components. | |
int | getVgap () |
Gets the vertical gap between components. | |
void | layoutContainer (Container target) |
Lays out the container. | |
Dimension | minimumLayoutSize (Container target) |
Returns the minimum dimensions needed to layout the visible components contained in the specified target container. | |
Dimension | preferredLayoutSize (Container target) |
Returns the preferred dimensions for this layout given the visible components in the specified target container. | |
void | removeLayoutComponent (Component comp) |
Removes the specified component from the layout. | |
void | setExtraInsets (Insets newExtraInsets) |
void | setHgap (int hgap) |
Sets the horizontal gap between components. | |
void | setVgap (int vgap) |
Sets the vertical gap between components. | |
Static Public Attributes | |
static final String | CENTER_ALIGN = "center" |
static final String | HFILL = "hfill" |
static final String | LEFT_ALIGN = "left" |
static final String | LINE_BREAK = "br" |
static final String | PARAGRAPH_BREAK = "p" |
static final String | RIGHT_ALIGN = "right" |
static final String | TAB_STOP = "tab" |
static final String | VCENTER = "vcenter" |
static final String | VFILL = "vfill" |
static final String | VTOP = "vtop" |
Protected Member Functions | |
void | adjustAlignment (Component m) |
Ruler | calcTabs (Container target) |
Figure out tab stop x-positions. | |
Insets | getInsets (Container target) |
void | moveComponents (Container target, int x, int y, int width, int height, int rowStart, int rowEnd, boolean ltr, Ruler ruler) |
Centers the elements in the specified row, if there is any slack. | |
void | relMove (Container target, int dx, int dy, int rowStart, int rowEnd) |
Package Functions | |
boolean | hasConstraint (Component comp, String test) |
boolean | hasHfill (Component comp) |
boolean | hasVfill (Component comp) |
boolean | isFirstInRow (Component comp) |
Package Attributes | |
final Map< Component, String > | constraints = new HashMap<Component, String>() |
Insets | extraInsets |
int | hgap |
final Insets | totalInsets = new Insets(0, 0, 0, 0) |
String | valign = VCENTER |
int | vgap |
List of constraints:
Definition at line 37 of file RiverLayout.java.
void addLayoutComponent | ( | String | name, | |
Component | comp | |||
) |
name | the name of the component | |
comp | the component to be added |
Definition at line 87 of file RiverLayout.java.
References RiverLayout.constraints.
void layoutContainer | ( | Container | target | ) |
Lays out the container.
This method lets each component take its preferred size by reshaping the components in the target container in order to satisfy the constraints of this FlowLayout
object.
target | the specified component being laid out |
java.awt.Container.doLayout
Definition at line 196 of file RiverLayout.java.
References RiverLayout.adjustAlignment(), RiverLayout.calcTabs(), RiverLayout.getInsets(), Ruler.getTab(), RiverLayout.hasConstraint(), RiverLayout.hasHfill(), RiverLayout.hasVfill(), RiverLayout.hgap, RiverLayout.isFirstInRow(), RiverLayout.moveComponents(), RiverLayout.PARAGRAPH_BREAK, RiverLayout.relMove(), RiverLayout.TAB_STOP, and RiverLayout.vgap.
Dimension minimumLayoutSize | ( | Container | target | ) |
Returns the minimum dimensions needed to layout the visible components contained in the specified target container.
target | the component which needs to be laid out |
java.awt.Container
java.awt.Container.doLayout
Definition at line 284 of file RiverLayout.java.
References RiverLayout.calcTabs(), RiverLayout.getInsets(), Ruler.getTab(), RiverLayout.hasConstraint(), RiverLayout.hgap, RiverLayout.isFirstInRow(), RiverLayout.PARAGRAPH_BREAK, RiverLayout.TAB_STOP, and RiverLayout.vgap.
void moveComponents | ( | Container | target, | |
int | x, | |||
int | y, | |||
int | width, | |||
int | height, | |||
int | rowStart, | |||
int | rowEnd, | |||
boolean | ltr, | |||
Ruler | ruler | |||
) | [protected] |
Centers the elements in the specified row, if there is any slack.
target | the component which needs to be moved | |
x | the x coordinate | |
y | the y coordinate | |
width | the width dimensions | |
height | the height dimensions | |
rowStart | the beginning of the row | |
rowEnd | the the ending of the row |
Definition at line 344 of file RiverLayout.java.
References RiverLayout.getInsets(), Ruler.getTab(), RiverLayout.hasConstraint(), RiverLayout.hgap, RiverLayout.TAB_STOP, RiverLayout.valign, and RiverLayout.VTOP.
Referenced by RiverLayout.layoutContainer().
Dimension preferredLayoutSize | ( | Container | target | ) |
Returns the preferred dimensions for this layout given the visible components in the specified target container.
target | the component which needs to be laid out |
java.awt.Container.getPreferredSize
Definition at line 392 of file RiverLayout.java.
References RiverLayout.calcTabs(), RiverLayout.getInsets(), Ruler.getTab(), RiverLayout.hasConstraint(), RiverLayout.hgap, RiverLayout.isFirstInRow(), RiverLayout.PARAGRAPH_BREAK, RiverLayout.TAB_STOP, and RiverLayout.vgap.
void removeLayoutComponent | ( | Component | comp | ) |
Removes the specified component from the layout.
Not used by this class.
comp | the component to remove |
Definition at line 453 of file RiverLayout.java.
References RiverLayout.constraints.