JavaView© v3.95.000

jv.objectGui
Class PsSlotLayout

java.lang.Object
  extended byjv.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.Serializable

Layout 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

Constructor Summary
PsSlotLayout(int numSlots)
          Constructor with total number of slots of this container.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          The string contains the number of slots of the current component.
 void layoutContainer(java.awt.Container parent)
           
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
           
 void removeLayoutComponent(java.awt.Component comp)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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)
The string contains the number of slots of the current component.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container parent)
Specified by:
layoutContainer in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager

JavaView© v3.95.000

The software JavaView© is copyright protected. All Rights Reserved.