|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--FlexibleLayout
Flexible layout manager that allows components to be positionned either at an absolute or at a relative location. Component size can also adapt itself to the container size. Once positionned, the component can be newly laid out using FlexibleConstraints methods.
FlexibleConstraints
Constructor Summary | |
FlexibleLayout()
Creates a new FlexibleLayout instance with no size specified. |
|
FlexibleLayout(java.awt.Container target)
Creates a new FlexibleLayout instance to lay out the specified target container. |
|
FlexibleLayout(java.awt.Dimension size)
Creates a new FlexibleLayout instance with size. |
|
FlexibleLayout(java.awt.Dimension size,
java.awt.Insets insets)
Creates a new FlexibleLayout instance with size. |
|
FlexibleLayout(int width,
int height)
Creates a new FlexibleLayout instance with size. |
|
FlexibleLayout(int width,
int height,
java.awt.Insets insets)
Creates a new FlexibleLayout instance with size. |
Method Summary | |
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
|
FlexibleConstraints |
getConstraints(java.awt.Component comp)
Gets the constraints for the specified component in this layout. |
float |
getLayoutAlignmentX(java.awt.Container target)
|
float |
getLayoutAlignmentY(java.awt.Container target)
|
java.awt.Dimension |
getSize()
Gets this layout size. |
void |
invalidateLayout(java.awt.Container target)
|
void |
layoutContainer(java.awt.Container parent)
Lays out the container using this FlexibleLayout rules. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container parent)
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size dimensions for the specified container given the components in the specified parent container. |
void |
removeLayoutComponent(java.awt.Component comp)
|
void |
setConstraints(java.awt.Component comp,
FlexibleConstraints cons)
Specifies new constraints for the specified component in this layout. |
void |
setSize(java.awt.Dimension size)
Specifies this layout size. |
void |
setSize(int width,
int height)
Specifies this layout size. |
void |
setTarget(java.awt.Container target)
Sets this layout size so to lay out the specified target container. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public FlexibleLayout()
public FlexibleLayout(java.awt.Dimension size)
This is the layout default size, and it defines the number of rows and columns to use for relative layout.
size
- The size to use for layout.setSize(java.awt.Dimension)
public FlexibleLayout(int width, int height)
This is the layout default size, and it defines the number of rows and columns to use for relative layout.
width
- The width to use for layout.height
- The height to use for layout.setSize(java.awt.Dimension)
public FlexibleLayout(java.awt.Dimension size, java.awt.Insets insets)
This is the layout default size, and it defines the number of rows and columns to use for relative layout.
size
- The size to use for layout.setSize(java.awt.Dimension)
public FlexibleLayout(int width, int height, java.awt.Insets insets)
This is the layout default size, and it defines the number of rows and columns to use for relative layout.
width
- The width to use for layout.height
- The height to use for layout.setSize(java.awt.Dimension)
public FlexibleLayout(java.awt.Container target)
This layout size is set according to target client area, that is the
container size without its insets.
NB: There is no drawback in using this layout for other containers too.
target
- the target container.setTarget(java.awt.Container)
Method Detail |
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
public void removeLayoutComponent(java.awt.Component comp)
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Fixed: Preferred size calculation was corrected in this version.
parent
- the container to be laid out.minimumLayoutSize(java.awt.Container)
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
public java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
public void layoutContainer(java.awt.Container parent)
Components that were not added to the container using FlexibleConstraints constraints (or null constraints) aren't laid out.
Most applications do not call this method directly.
parent
- the container in which to do the layoutFlexibleConstraints
,
Container
,
Container.doLayout()
public float getLayoutAlignmentX(java.awt.Container target)
public float getLayoutAlignmentY(java.awt.Container target)
public void invalidateLayout(java.awt.Container target)
public void setConstraints(java.awt.Component comp, FlexibleConstraints cons)
component
- the component to be modified.constraints
- the constraints to be applied.public FlexibleConstraints getConstraints(java.awt.Component comp)
component
- the component to be queried.public void setSize(java.awt.Dimension size)
This is the layout default size, and it defines the number of rows and columns to use for relative layout.
size
- The size to use for layout.getSize()
,
setTarget(java.awt.Container)
,
FlexibleConstants.RELATIVE
public void setSize(int width, int height)
This is the layout default size, and it defines the number of rows and columns to use for relative layout.
width
- The width to use for layout.height
- The height to use for layout.getSize()
,
setTarget(java.awt.Container)
,
FlexibleConstants.RELATIVE
public void setTarget(java.awt.Container target)
This layout size is set according to target client area, that is the target size without its insets.
target
- the target container.setSize(java.awt.Dimension)
public java.awt.Dimension getSize()
When not null, this is the layout preferred size, and it defines the number of rows and columns to use for relative layout.
setSize(java.awt.Dimension)
,
FlexibleConstants.RELATIVE
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |