Class Form

java.lang.Object
com.HawkinsSoftware.FormLayout
com.portal.ctrl.Form
All Implemented Interfaces:
LayoutManager, LayoutManager2, Serializable

public class Form extends com.HawkinsSoftware.FormLayout implements LayoutManager2, Serializable
This class extends FormLayout from HawkinsSoftware. It allows you to layout compoents in a "label/field" layout, but it allows you to use any component for the label/field. Components are added to a specified row and column and can span multiple rows. It uses FormConstraints to specify how the compoents are to be laid out.
Author:
Monica Gaines
See Also:
  • Field Summary

    Fields inherited from class com.HawkinsSoftware.FormLayout

    DEFAULT, FREE_FIELD, FREE_LABEL, LABEL_ON_TOP
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Form with default gaps horizontally and vertically between components and no external gaps.
    Form(int intHGap, int intVGap, int extHGap, int extVGap)
    Creates a new Form with the given gaps.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addLayoutComponent(Component comp, Object constraints)
    Adds the given compoent to the layout using the given constraints.
    float
    Returns the alignment along the x axis.
    float
    Returns the alignment along the y axis.
    void
    Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
    Returns the maximum size for this layout.

    Methods inherited from class com.HawkinsSoftware.FormLayout

    add, add, add, add, add, add, addLayoutComponent, addMultiRow, addMultiRow, addMultiRow, addMultiRow, addMultiRow, addMultiRow, getDefaultFillRightPct, getExternalHGap, getExternalVGap, getInternalHGap, getInternalVGap, layoutContainer, minimumLayoutSize, preferredLayoutSize, removeLayoutComponent, setDefaultFillRightPct, setExternalHGap, setExternalVGap, setInternalHGap, setInternalVGap

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Form

      public Form()
      Creates a new Form with default gaps horizontally and vertically between components and no external gaps.
      Parameters:
      p - the container that is needs to be laid out
    • Form

      public Form(int intHGap, int intVGap, int extHGap, int extVGap)
      Creates a new Form with the given gaps.
      Parameters:
      intHGap - the pixel amount separating label/field horizontally
      intVGap - the pixel amount separating label/field vertically
      extHGap - the amount the layout is bounded left and right
      extVGap - the amount the layout is bounded top and bottom
      p - the container that is needs to be laid out
  • Method Details

    • addLayoutComponent

      public void addLayoutComponent(Component comp, Object constraints)
      Adds the given compoent to the layout using the given constraints.
      Specified by:
      addLayoutComponent in interface LayoutManager2
      Parameters:
      comp - the component to be added to the layout
      constraints - the constraints to be applied to the component
    • maximumLayoutSize

      public Dimension maximumLayoutSize(Container target)
      Returns the maximum size for this layout.
      Specified by:
      maximumLayoutSize in interface LayoutManager2
    • getLayoutAlignmentX

      public float getLayoutAlignmentX(Container target)
      Returns the alignment along the x axis.
      Specified by:
      getLayoutAlignmentX in interface LayoutManager2
    • getLayoutAlignmentY

      public float getLayoutAlignmentY(Container target)
      Returns the alignment along the y axis.
      Specified by:
      getLayoutAlignmentY in interface LayoutManager2
    • invalidateLayout

      public void invalidateLayout(Container target)
      Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
      Specified by:
      invalidateLayout in interface LayoutManager2