Class SingleFiledLayout

java.lang.Object
info.clearthought.layout.SingleFiledLayout
All Implemented Interfaces:
LayoutManager, Serializable

public class SingleFiledLayout
extends Object
implements LayoutManager, Serializable
SingleFiledLayout lays out components singled filed. This layout manager is like FlowLayout except that all components are placed in a single row or column.
Version:
1.1 4/4/02
Author:
Daniel E. Barbalace
See Also:
Serialized Form
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int BOTTOM
    Bottom justify components
    static int CENTER
    Center components
    static int COLUMN
    Align components in a column
    static int DEFAULT_GAP
    Default gap -- derived classes may override
    static int FULL
    Full justify components
    static int LEFT
    Left justify components
    static int RIGHT
    Right justify components
    static int ROW
    Align components in a row
    static int TOP
    Top justify components
  • Constructor Summary

    Constructors
    Constructor Description
    SingleFiledLayout()
    Constructs an instance of SingleFiledLayout that will align components in a column using the default gap and LEFT justification.
    SingleFiledLayout​(int orientation)
    Constructs an instance of SingleFiledLayout using the default gap and LEFT or TOP justification.
    SingleFiledLayout​(int orientation, int justification, int gap)
    Constructs an instance of SingleFiledLayout.
  • Method Summary

    Modifier and Type Method Description
    void addLayoutComponent​(String name, Component component)
    Adds the specified component with the specified name to the layout.
    void layoutContainer​(Container container)
    To lay out the specified container using this layout.
    Dimension minimumLayoutSize​(Container container)
    Determines the minimum size of the container argument using this layout.
    Dimension preferredLayoutSize​(Container container)
    Determines the preferred size of the container argument using this layout.
    void removeLayoutComponent​(Component component)
    Removes the specified component with the specified name from the layout.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • SingleFiledLayout

      public SingleFiledLayout()
      Constructs an instance of SingleFiledLayout that will align components in a column using the default gap and LEFT justification.
    • SingleFiledLayout

      public SingleFiledLayout​(int orientation)
      Constructs an instance of SingleFiledLayout using the default gap and LEFT or TOP justification.
      Parameters:
      orientation - ROW or COLUMN -- should the components be aligned in a row or column
    • SingleFiledLayout

      public SingleFiledLayout​(int orientation, int justification, int gap)
      Constructs an instance of SingleFiledLayout.
      Parameters:
      orientation - ROW or COLUMN -- should the components be aligned in a row or column
      justification - LEFT, TOP, CENTER, FULL, BOTTOM, RIGHT -- how should components of different sizes be aligned
      gap - space between components in pixels
  • Method Details

    • layoutContainer

      public void layoutContainer​(Container container)
      To lay out the specified container using this layout. This method repositions the components in the specified target container.

      User code should not have to call this method directly.

      Specified by:
      layoutContainer in interface LayoutManager
      Parameters:
      container - container being served by this layout manager
    • preferredLayoutSize

      public Dimension preferredLayoutSize​(Container container)
      Determines the preferred size of the container argument using this layout. The preferred size is the smallest size that, if used for the container's size, will ensure that no component is truncated when the component is it's preferred size.
      Specified by:
      preferredLayoutSize in interface LayoutManager
      Parameters:
      container - container being served by this layout manager
      Returns:
      a dimension indicating the container's preferred size
    • minimumLayoutSize

      public Dimension minimumLayoutSize​(Container container)
      Determines the minimum size of the container argument using this layout. The minimum size is the smallest size that, if used for the container's size, will ensure that no component is truncated. The minimum size is the preferred size.
      Specified by:
      minimumLayoutSize in interface LayoutManager
      Parameters:
      container - container being served by this layout manager
      Returns:
      a dimension indicating the container's minimum size
    • addLayoutComponent

      public void addLayoutComponent​(String name, Component component)
      Adds the specified component with the specified name to the layout.
      Specified by:
      addLayoutComponent in interface LayoutManager
      Parameters:
      name - dummy parameter
      component - component to add
    • removeLayoutComponent

      public void removeLayoutComponent​(Component component)
      Removes the specified component with the specified name from the layout.
      Specified by:
      removeLayoutComponent in interface LayoutManager
      Parameters:
      component - component being removed