|
|||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mplayout.MultiPanelLayout
Lays out multiple panels containing components within a parent container.
Maintains left and right alignment of all components in all panels.
This is the only layout that operates on multiple containers at once.
The parent container has to be designated as the master. Calling layout
on this container lays out all other dependent containers. Calling
layout on a dependent container has no effect.
Steps to use:
You are free to use this code and to make modifications provided this notice is retained.
If you found this useful, please add a note of acknowledgement to my guestbook, or send me a mail at tanmaykm@hotmail.com. If you would like to report a bug or suggest some improvements, you are most welcome. I will be happy to help you use this piece of code.
Constructor Summary | |
MultiPanelLayout(int iMaxX,
int iMaxY,
java.awt.Container parentContainer)
Constructor. |
Method Summary | |
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds a component to the layout, using a constraint object. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified component with the specified name to the layout. |
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. |
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 parent)
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. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public MultiPanelLayout(int iMaxX, int iMaxY, java.awt.Container parentContainer)
iMaxX
- the number of grids in the horizontal directioniMaxY
- the number of grids in the vertical directionparentContainer
- the parent container containing all components and other containersMethod Detail |
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
public float getLayoutAlignmentX(java.awt.Container target)
public float getLayoutAlignmentY(java.awt.Container target)
public void invalidateLayout(java.awt.Container target)
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)
public void layoutContainer(java.awt.Container parent)
public java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
public void removeLayoutComponent(java.awt.Component comp)
|
|||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |