|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectfr.ove.palette.PaletteLayout
A layout manager for component to be laid out as a palette.
We can specified the number max of element allowed by row or by column according to
the constraint chosen.
For example PaletteLayout(PaletteLayout.COLUMN_CONSTRAINT, 3) will lay a container with
the constraint that, for the most, we can have 3 components by column.
All components have the same size, which corresponds to the biggest "preferredWidth"
and the biggest "preferredHeight".
| Field Summary | |
static byte |
COLUMN_CONSTRAINT
The specified number of elements correspond to the number max by row. |
static byte |
ROW_CONSTRAINT
The specified number of elements correspond to the number max by row. |
| Constructor Summary | |
PaletteLayout()
The default constructor. |
|
PaletteLayout(byte constraint,
int nbElement)
The constructor. |
|
| Method Summary | |
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to the layout, using the specified constraint object. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified component with the specified name to the layout. |
byte |
getConstraint()
Returns the constraint put on the container laid out. |
float |
getLayoutAlignmentX(java.awt.Container target)
Returns the alignment along the x axis. |
float |
getLayoutAlignmentY(java.awt.Container target)
Returns the alignment along the y axis. |
int |
getNbElement()
Returns the number max of element allowed by row (resp. column) with the ROW_CONSTRAINT
(resp. |
void |
invalidateLayout(java.awt.Container target)
Invalidates the layout, indicating that if the layout manager has cached information it should be discarded. |
void |
layoutContainer(java.awt.Container parent)
Lays out the container in the specified panel. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Returns the maximum size of this component. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. |
void |
setConstraint(byte constraint)
Sets the constraint ( ROW_CONSTRAINT or COLUMN_CONSTRAINT) for ordering
the components in the container laid out. |
void |
setNbElement(int nbElement)
Sets the number max of element allowed by row (resp. column) with the ROW_CONSTRAINT
(resp. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final byte ROW_CONSTRAINT
public static final byte COLUMN_CONSTRAINT
| Constructor Detail |
public PaletteLayout()
public PaletteLayout(byte constraint,
int nbElement)
nbElement - the number max of element allowed by row (resp. column) with the ROW_CONSTRAINT
(resp. COLUMN_CONSTRAINT) constraint.| Method Detail |
public void setConstraint(byte constraint)
ROW_CONSTRAINT or COLUMN_CONSTRAINT) for ordering
the components in the container laid out.validate on the container laid out should be
performed to see the change take effect.
constraint - the constraint to set.public byte getConstraint()
public void setNbElement(int nbElement)
ROW_CONSTRAINT
(resp. COLUMN_CONSTRAINT) constraint.
After a call to this method, a call to validate on the container laid out should be
performed to see the change take effect.
nbElement - the number of element allowed.public int getNbElement()
ROW_CONSTRAINT
(resp. COLUMN_CONSTRAINT) constraint.
public void addLayoutComponent(java.lang.String name,
java.awt.Component comp)
addLayoutComponent in interface java.awt.LayoutManagername - the component namecomp - the component to be addedpublic void layoutContainer(java.awt.Container parent)
layoutContainer in interface java.awt.LayoutManagerparent - the component which needs to be laid outpublic java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize in interface java.awt.LayoutManagerparent - the component to be laid outpreferredLayoutSize(java.awt.Container)public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize in interface java.awt.LayoutManagerparent - the component to be laid outpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent in interface java.awt.LayoutManagercomp - the component ot be removed
public void addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
addLayoutComponent in interface java.awt.LayoutManager2comp - the component to be addedconstraints - where/how the component is added to the layout.public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize in interface java.awt.LayoutManager2Component.getMinimumSize(),
Component.getPreferredSize(),
LayoutManagerpublic float getLayoutAlignmentX(java.awt.Container target)
getLayoutAlignmentX in interface java.awt.LayoutManager2public float getLayoutAlignmentY(java.awt.Container target)
getLayoutAlignmentY in interface java.awt.LayoutManager2public void invalidateLayout(java.awt.Container target)
invalidateLayout in interface java.awt.LayoutManager2
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||