Arch4J 1.1

org.arch4j.ui.layout
Class FractionalLayout

java.lang.Object
  |
  +--org.arch4j.ui.layout.FractionalLayout
All Implemented Interfaces:
LayoutManager

public class FractionalLayout
extends Object
implements LayoutManager

A layout manager for a container that lays out components in a VisualWorks kinda way. For each component, you can specify a constraint, which must be a kind of OriginConstraint. Please see the constraint classes for more information.

Version:
1.01, 04/18/96
Author:
Eric Lunt (elunt@mcs.net)
See Also:
OriginConstraint, AlignmentOriginConstraint, FrameConstraint

Field Summary
protected  Hashtable components
          The keys are components, which are pointing to contraints.
 
Constructor Summary
FractionalLayout()
          Create an instanace of a FractionalLayout
 
Method Summary
 void addLayoutComponent(String name, Component comp)
          Adds the specified component with the specified name to the layout.
 OriginConstraint getConstraint(Component comp)
          Return the constraint that is associated with the given component.
 void layoutContainer(Container parent)
          Lays out the container in the specified panel.
 Dimension minimumLayoutSize(Container parent)
          Returns the minimum dimensions for this layout given the components in the specified panel.
 Dimension preferredLayoutSize(Container parent)
          Returns the preferred dimensions for this layout given the components in the specified panel.
 void removeAll()
          This method was created by a SmartGuide.
 void removeLayoutComponent(Component comp)
          Removes the specified component from the layout.
 void setConstraint(Component comp, OriginConstraint constraint)
          Add a component and a corresponding constraint to the layout.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

components

protected Hashtable components
The keys are components, which are pointing to contraints.

Constructor Detail

FractionalLayout

public FractionalLayout()
Create an instanace of a FractionalLayout

Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Adds the specified component with the specified name to the layout.

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
name - the name of the component (ignored)
comp - the component to be added

getConstraint

public OriginConstraint getConstraint(Component comp)
Return the constraint that is associated with the given component. If a constraint hasn't been set for the component, then give it a default OriginContraint (which places the component at the upper-right of the container).

Parameters:
comp - the component to return the constraint for
Returns:
the appropriate constraint

layoutContainer

public void layoutContainer(Container parent)
Lays out the container in the specified panel.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
parent - the specified component being laid out
See Also:
Container

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Returns the minimum dimensions for this layout given the components in the specified panel.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
parent - the component which needs to be laid out
Returns:
the minimum dimension for this layout
See Also:
preferredLayoutSize(java.awt.Container)

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Returns the preferred dimensions for this layout given the components in the specified panel.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
parent - the component which needs to be laid out
Returns:
the preferred dimension for this layout
See Also:
minimumLayoutSize(java.awt.Container)

removeAll

public void removeAll()
This method was created by a SmartGuide.


removeLayoutComponent

public void removeLayoutComponent(Component comp)
Removes the specified component from the layout.

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

setConstraint

public void setConstraint(Component comp,
                          OriginConstraint constraint)
Add a component and a corresponding constraint to the layout.

Parameters:
comp - the component to add
constraint - an instance of a constraint. Note that I do not clone the instance, so be careful.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.