Oracle Data-aware Controls Reference

oracle.dacf.layout
Class LayoutManager3

java.lang.Object
  extended byoracle.dacf.layout.LayoutManager3
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2
Direct Known Subclasses:
ColumnLayout, ControlLayout, RowLayout

public abstract class LayoutManager3
extends java.lang.Object
implements java.awt.LayoutManager2

LayoutManager3 is a simple extension of LayoutManager and LayoutManager2. It provides a basic framework for managing the constraints associated with the controls in a container. Constraints associated with components are stored in a hash table.

Version:
PUBLIC
See Also:
LayoutManager, LayoutManager2

Field Summary
static int SIZE_MAXIMUM
          Calculate the maximum size of the container.
static int SIZE_MINIMUM
          Calculate the minimum size of the container.
static int SIZE_PREFERRED
          Calculate the preferred size of the container.
 
Constructor Summary
LayoutManager3()
          Parameterless class constructor.
 
Method Summary
 void addLayoutComponent(java.awt.Component comp, java.lang.Object cons)
          Adds the component's contraints to the layout.
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Adds the component to the layout with the given name.
protected  ControlConstraints findConstraints(java.awt.Component comp)
          Finds the constraint object associated with this component.
protected  java.awt.Dimension getComponentBounds(java.awt.Component comp, ControlConstraints cc)
          Compute the component's bounds.
 float getLayoutAlignmentX(java.awt.Container cont)
          Calculates the layout manager's x-alignment value.
 float getLayoutAlignmentY(java.awt.Container cont)
          Calculates the layout manager's y-alignment value.
 void invalidateLayout(java.awt.Container cont)
          Invalidates the layout manager.
abstract  void layoutContainer(java.awt.Container parent)
          Lays out the container in the specified panel.
protected abstract  java.awt.Dimension layoutSize(java.awt.Container parent, int type)
          Computes the indicated container size dimensions.
 java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
          Calculates the layout's maximum size dimensions.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Computes the minimum size dimensions for the specified panel given the components in the specified parent container.
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Computes the preferred size dimensions for the specified panel given the components in the specified parent container.
 void removeLayoutComponent(java.awt.Component comp)
          Removes the layout from the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE_PREFERRED

public static final int SIZE_PREFERRED
Calculate the preferred size of the container.

See Also:
Constant Field Values

SIZE_MINIMUM

public static final int SIZE_MINIMUM
Calculate the minimum size of the container.

See Also:
Constant Field Values

SIZE_MAXIMUM

public static final int SIZE_MAXIMUM
Calculate the maximum size of the container.

See Also:
Constant Field Values
Constructor Detail

LayoutManager3

public LayoutManager3()
Parameterless class constructor.

Method Detail

addLayoutComponent

public final void addLayoutComponent(java.lang.String name,
                                     java.awt.Component comp)
Adds the component to the layout with the given name.

Not used! We use a constraints object rather than keying the layout off the component name.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
name - identifying name of the component
comp - component to add
See Also:
LayoutManager2.addLayoutComponent(java.awt.Component, java.lang.Object)

layoutContainer

public abstract void layoutContainer(java.awt.Container parent)
Lays out the container in the specified panel. Must be implemented by child classes.

Specified by:
layoutContainer in interface java.awt.LayoutManager
Parameters:
parent - component which needs to be laid out
See Also:
LayoutManager.layoutContainer(java.awt.Container)

minimumLayoutSize

public final java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Computes the minimum size dimensions for the specified panel given the components in the specified parent container.

Specified by:
minimumLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - component to be laid out
Returns:
Dimension object containing the container's minimum size
See Also:
LayoutManager.minimumLayoutSize(java.awt.Container)

preferredLayoutSize

public final java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Computes the preferred size dimensions for the specified panel given the components in the specified parent container.

Specified by:
preferredLayoutSize in interface java.awt.LayoutManager
Parameters:
parent - component to be laid out
Returns:
Dimension object containing the container's preferred size
See Also:
LayoutManager.preferredLayoutSize(java.awt.Container)

removeLayoutComponent

public final void removeLayoutComponent(java.awt.Component comp)
Removes the layout from the component.

Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - component to remove
See Also:
LayoutManager.removeLayoutComponent(java.awt.Component)

addLayoutComponent

public final void addLayoutComponent(java.awt.Component comp,
                                     java.lang.Object cons)
Adds the component's contraints to the layout.

Specified by:
addLayoutComponent in interface java.awt.LayoutManager2
Parameters:
comp - component to add
cons - constraints associated with the component
See Also:
LayoutManager2.addLayoutComponent(java.awt.Component, java.lang.Object)

getLayoutAlignmentX

public float getLayoutAlignmentX(java.awt.Container cont)
Calculates the layout manager's x-alignment value. May be over-ridden by child classes if necessary.

Specified by:
getLayoutAlignmentX in interface java.awt.LayoutManager2
Parameters:
cont - the container we're interested in
Returns:
alignment value along the x-axis
See Also:
LayoutManager2.getLayoutAlignmentX(java.awt.Container)

getLayoutAlignmentY

public float getLayoutAlignmentY(java.awt.Container cont)
Calculates the layout manager's y-alignment value. May be over-ridden by child classes if necessary.

Specified by:
getLayoutAlignmentY in interface java.awt.LayoutManager2
Parameters:
cont - the container we're interested in
Returns:
alignment value along the y-axis
See Also:
java.awt.LayoutManager#getLayoutAlignmentY

invalidateLayout

public void invalidateLayout(java.awt.Container cont)
Invalidates the layout manager. Reset any internal state values. May be over-ridden by child classes if necessary.

Specified by:
invalidateLayout in interface java.awt.LayoutManager2
Parameters:
cont - the container we're interested in
See Also:
LayoutManager2.invalidateLayout(java.awt.Container)

maximumLayoutSize

public final java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
Calculates the layout's maximum size dimensions.

Specified by:
maximumLayoutSize in interface java.awt.LayoutManager2
See Also:
LayoutManager2.maximumLayoutSize(java.awt.Container)

findConstraints

protected final ControlConstraints findConstraints(java.awt.Component comp)
Finds the constraint object associated with this component.

Parameters:
comp - component whose constraint object we want
Returns:
a constraint object

getComponentBounds

protected java.awt.Dimension getComponentBounds(java.awt.Component comp,
                                                ControlConstraints cc)
Compute the component's bounds. If a width or height is specified in the constraint object use it. Otherwise use the component's preferred size.

Parameters:
comp - the component we're interested in
cc - the component's constraint object
Returns:
the bounds of the component

layoutSize

protected abstract java.awt.Dimension layoutSize(java.awt.Container parent,
                                                 int type)
Computes the indicated container size dimensions. Must be implemented by child classes.

Parameters:
parent - container to be laid out
type - _MINIMUM, _MAXIMUM or _PREFERRED
Returns:
Dimension object with the container's requested size

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.