ar.com.da.swing
Class FormLayout

java.lang.Object
  extended by ar.com.da.swing.FormLayout
All Implemented Interfaces:
java.awt.LayoutManager

public class FormLayout
extends java.lang.Object
implements java.awt.LayoutManager

A Layout for developing forms. This layout puts the components in de next form:
label1 - component1
label2 - component2
It uses the atribute labelFor of the JLabel to recognize wich component is shown with each lbel.

Author:
Carlos E.Descalzi

Constructor Summary
FormLayout()
           
FormLayout(int hGap, int vGap)
           
FormLayout(int hGap, int vGap, HorizontalAlignment labelAlignment, int labelSectionWidth)
           
 
Method Summary
 FormLayout add(java.awt.Component component, javax.swing.JLabel label, java.awt.Container container)
          Convenience method to add a component with its label to a container.
 FormLayout add(java.awt.Component component, java.lang.String label, java.awt.Container container)
          Convenience method to add a component with its label to a container.
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
 int getHGap()
           
 HorizontalAlignment getLabelAlignment()
           
 int getLabelSectionWidth()
           
 int getVGap()
           
 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)
           
 void setHGap(int gap)
           
 void setLabelAlignment(HorizontalAlignment labelAlignment)
           
 void setLabelSectionWidth(int labelSectionWidth)
           
 void setVGap(int gap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormLayout

public FormLayout()

FormLayout

public FormLayout(int hGap,
                  int vGap)

FormLayout

public FormLayout(int hGap,
                  int vGap,
                  HorizontalAlignment labelAlignment,
                  int labelSectionWidth)
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager

removeLayoutComponent

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

preferredLayoutSize

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

minimumLayoutSize

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

layoutContainer

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

getLabelSectionWidth

public int getLabelSectionWidth()

setLabelSectionWidth

public void setLabelSectionWidth(int labelSectionWidth)

getLabelAlignment

public HorizontalAlignment getLabelAlignment()

setLabelAlignment

public void setLabelAlignment(HorizontalAlignment labelAlignment)

getHGap

public int getHGap()

setHGap

public void setHGap(int gap)

getVGap

public int getVGap()

setVGap

public void setVGap(int gap)

add

public FormLayout add(java.awt.Component component,
                      java.lang.String label,
                      java.awt.Container container)
Convenience method to add a component with its label to a container. It will create a label component and bind it to the component.

Parameters:
component -
label -
container -

add

public FormLayout add(java.awt.Component component,
                      javax.swing.JLabel label,
                      java.awt.Container container)
Convenience method to add a component with its label to a container.

Parameters:
component -
label -
container -


Copyright © 2006 null. All Rights Reserved.