Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.crosswire.common.swing
Class AbstractLayout

    java.lang.Object
      org.crosswire.common.swing.AbstractLayout

All Implemented Interfaces:
  LayoutManager, LayoutManager2, Serializable

Direct Known Subclasses:
  FieldLayout

    public abstract class AbstractLayout

extends Object
implements LayoutManager2, Serializable

AbstractLayout - support for DeckLayout.

Distribution Licence: JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA The copyright to this program is held by it's authors.

Version:
  $Id: AbstractLayout.java,v 1.8 2005/01/24 23:22:06 dmsmith Exp $
Author:
  Joe Walker [joe at eireneh dot com], Claude Duguay (Idea in JDJ article)
See Also:
  `Licence`, Serialized Form

Field Summary
`protected int` | `hgap` horizontal gap
`protected int` | `vgap` vertical gap

Constructor Summary
`protected` | `AbstractLayout()` Defaults the horizontal and vertical gaps to 0
`protected` | `AbstractLayout(int hgap, int vgap)` Constructor that specifies the horizontal and vertical gaps

Method Summary
`void` | `addLayoutComponent(Component comp, Object constraints)` Add the specified component from the layout.
`void` | `addLayoutComponent(String name, Component comp)` Adds the specified component with the specified name to the layout.
`int` | `getHgap()` Get the horizontal gap between components.
`float` | `getLayoutAlignmentX(Container parent)` Returns the alignment along the x axis.
`float` | `getLayoutAlignmentY(Container parent)` Returns the alignment along the y axis.
`int` | `getVgap()` Get the vertical gap between components.
`void` | `invalidateLayout(Container target)` Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
`Dimension` | `maximumLayoutSize(Container target)` Returns the maximum dimensions for this layout given the component in the specified target container.
`void` | `removeLayoutComponent(Component comp)` Removes the specified component from the layout.
`void` | `setHgap(int gap)` Set the horizontal gap between components.
`void` | `setVgap(int gap)` Set the vertical gap between components.
`String` | `toString()` Return a string representation of the layout manager

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface java.awt.LayoutManager
`layoutContainer, minimumLayoutSize, preferredLayoutSize`

Field Detail

### hgap

    protected int hgap

  horizontal gap

### vgap

    protected int vgap

  vertical gap

Constructor Detail

### AbstractLayout

    protected AbstractLayout()

  Defaults the horizontal and vertical gaps to 0

### AbstractLayout

    protected AbstractLayout(int hgap,
                             int vgap)

  Constructor that specifies the horizontal and vertical gaps

Method Detail

### getHgap

    public final int getHgap()

  Get the horizontal gap between components.

### getVgap

    public final int getVgap()

  Get the vertical gap between components.

### setHgap

    public final void setHgap(int gap)

  Set the horizontal gap between components.

  Parameters:
    `gap` - The horizontal gap to be set

### setVgap

    public final void setVgap(int gap)

  Set the vertical gap between components.

  Parameters:
    `gap` - The vertical gap to be set

### maximumLayoutSize

    public Dimension maximumLayoutSize(Container target)

  Returns the maximum dimensions for this layout given the component in the specified target container.

  Specified by:
    `maximumLayoutSize` in interface `LayoutManager2`
  Parameters:
    `target` - The component which needs to be laid out

### getLayoutAlignmentX

    public float getLayoutAlignmentX(Container parent)

  Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

  Specified by:
    `getLayoutAlignmentX` in interface `LayoutManager2`

### getLayoutAlignmentY

    public float getLayoutAlignmentY(Container parent)

  Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.

  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`

### addLayoutComponent

    public void addLayoutComponent(String name,
                                   Component comp)

  Adds the specified component with the specified name to the layout. By default, we call the more recent addLayoutComponent method with an object constraint argument. The name is passed through directly.

  Specified by:
    `addLayoutComponent` in interface `LayoutManager`
  Parameters:
    `name` - The name of the component
    `comp` - The component to be added

### addLayoutComponent

    public void addLayoutComponent(Component comp,
                                   Object constraints)

  Add the specified component from the layout. By default, we let the Container handle this directly.

  Specified by:
    `addLayoutComponent` in interface `LayoutManager2`
  Parameters:
    `comp` - The component to be added
    `constraints` - The constraints to apply when laying out.

### removeLayoutComponent

    public void removeLayoutComponent(Component comp)

  Removes the specified component from the layout. By default, we let the Container handle this directly.

  Specified by:
    `removeLayoutComponent` in interface `LayoutManager`
  Parameters:
    `comp` - the component to be removed

### toString

    public String toString()

  Return a string representation of the layout manager

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ? 2003-2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD