jv.objectGui
Class PsSlotLayout
- java.lang.Object
-
- jv.objectGui.PsSlotLayout
-
- All Implemented Interfaces:
- java.awt.LayoutManager, java.io.Serializable
public final class PsSlotLayout extends java.lang.Object implements java.awt.LayoutManager, java.io.SerializableLayout manager generalizes GridLayout(1,n) where each component may occupy more than one slot in a horizontal row.The following example creates a horizontal panel which has three slots. The first slot is occupied with a label and the remaining two slots are filled with a TextField.
Example usage: panel.setLayout(new PsSlotLayout(3)); panel.add("1", new Label("Name")); panel.add("2", new TextField());Currently, components cannot be removed from this layout manager once they have been added. This may be implemented later.
- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 25.08.04, 1.10 revised (kp) Check number of components to avoid exception.
24.03.02, 1.00 created (kp)
-
-
Constructor Summary
Constructors Constructor and Description PsSlotLayout(int numSlots)Constructor with total number of slots of this container.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddLayoutComponent(java.lang.String name, java.awt.Component comp)Add a new component which occupies the given number of slots.voidlayoutContainer(java.awt.Container parent)java.awt.DimensionminimumLayoutSize(java.awt.Container parent)java.awt.DimensionpreferredLayoutSize(java.awt.Container parent)voidremoveLayoutComponent(java.awt.Component comp)
-
-
-
Constructor Detail
-
PsSlotLayout
public PsSlotLayout(int numSlots)
Constructor with total number of slots of this container.
-
-
Method Detail
-
addLayoutComponent
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)Add a new component which occupies the given number of slots. The overall occupied number of slots must be equal to the total number of slots reserved in the constructor. param name contains the number of slots of the current component.- Specified by:
addLayoutComponentin interfacejava.awt.LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
- Specified by:
minimumLayoutSizein interfacejava.awt.LayoutManager
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
- Specified by:
preferredLayoutSizein interfacejava.awt.LayoutManager
-
layoutContainer
public void layoutContainer(java.awt.Container parent)
- Specified by:
layoutContainerin interfacejava.awt.LayoutManager
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)
- Specified by:
removeLayoutComponentin interfacejava.awt.LayoutManager
-
-
"