Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.columnlayout
Class LayoutBuilder

java.lang.Object
  extended by oracle.javatools.columnlayout.LayoutBuilder

public class LayoutBuilder
extends java.lang.Object

The LayoutBuilder is a variant of the builder pattern. Its focus is to reduce clients' explicit creation of LayoutComponents, but it doesn't make great efforts to hide their structure as clients may wish to provide their own LayoutComponent implementations. Overall the builder makes it easy to do layout in a directed fashion.


Field Summary
static int ANCHOR_CENTER
          Alias for grid bag constraints.
static int ANCHOR_EAST
          Alias for grid bag constraints.
static int ANCHOR_NORTH
          Alias for grid bag constraints.
static int ANCHOR_NORTHEAST
          Alias for grid bag constraints.
static int ANCHOR_NORTHWEST
          Alias for grid bag constraints.
static int ANCHOR_SOUTH
          Alias for grid bag constraints.
static int ANCHOR_SOUTHEAST
          Alias for grid bag constraints.
static int ANCHOR_SOUTHWEST
          Alias for grid bag constraints.
static int ANCHOR_WEST
          Alias for grid bag constraints.
static java.awt.Insets CONTROL_INSETS
          Controls and labels have 5 pixels at the bottom.
static int FILL_BOTH
          Alias for grid bag constraints fill both horizontally and vertically.
static java.awt.Insets GROUP_INSETS
          Control groups have 15 pixels at the bottom.
static int HORIZONTAL_FILL
          Alias for grid bag constraints horizontal fill.
static java.awt.Dimension HORIZONTAL_GAP
          The default size for horizontal gaps (24, 0).
static java.awt.Insets LABEL_INSETS
          Labels with the control to the right rather than below have a 12 pixel gap.
static int NO_FILL
          Alias for grid bag constraints no fill.
static int VERTICAL_FILL
          Alias for grid bag constraints vertical fill.
static java.awt.Dimension VERTICAL_GAP
          The default size for vertical gaps (0, 15).
static java.awt.Dimension ZERO_DIMENSION
          A zero sized dimension.
static java.awt.Insets ZERO_INSETS
          Zero insets.
 
Constructor Summary
LayoutBuilder()
           
 
Method Summary
 void add(java.awt.Component component, java.awt.Insets insets, int columnSpan, boolean isRowResizable, boolean isColumnResizable)
          Add a UI component.
 void add(java.awt.Component component, java.awt.Insets insets, int columnSpan, boolean isRowResizable, boolean isColumnResizable, int anchor, int fill)
          Add a UI component.
 void add(LayoutComponent lc)
          Add a LayoutComponent to the current panel.
 void addHFiller()
          Add a horizontal filler.
 void addHGap()
          Add horizontal gap of default size.
 void addHGap(int width)
          Add horizontal gap of the specified size.
 void addToPanel(java.awt.Container container)
          Set the layout manager for the container and add all the UI components in the layout with the appropriate constraints.
 void addVFiller()
          Add a vertical filler.
 void addVGap()
          Add a vertical gap of default size.
 void addVGap(int height)
          Add a vertical gap of the specified size.
 int getDefaultAnchor()
          Get the default anchor used when adding components.
 int getDefaultFill()
          Get the default fill used when adding components.
 LayoutComponent getRootComponent()
          Get the outermost LayoutComponent.
 void nl()
          Move down one row.
 void popPanel()
          Add the current panel to the enclosing one and make the enclosing one the current panel.
 void pushPanel()
          Create a new layout panel and make it the current panel.
 void setDefaultAnchor(int anchor)
          Set the default anchor used when adding components.
 void setDefaultFill(int fill)
          Set the default fill used when adding components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZERO_INSETS

public static final java.awt.Insets ZERO_INSETS
Zero insets.


CONTROL_INSETS

public static final java.awt.Insets CONTROL_INSETS
Controls and labels have 5 pixels at the bottom.


LABEL_INSETS

public static final java.awt.Insets LABEL_INSETS
Labels with the control to the right rather than below have a 12 pixel gap.


GROUP_INSETS

public static final java.awt.Insets GROUP_INSETS
Control groups have 15 pixels at the bottom.


ZERO_DIMENSION

public static final java.awt.Dimension ZERO_DIMENSION
A zero sized dimension.


HORIZONTAL_GAP

public static final java.awt.Dimension HORIZONTAL_GAP
The default size for horizontal gaps (24, 0).


VERTICAL_GAP

public static final java.awt.Dimension VERTICAL_GAP
The default size for vertical gaps (0, 15).


ANCHOR_NORTHWEST

public static final int ANCHOR_NORTHWEST
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_NORTH

public static final int ANCHOR_NORTH
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_NORTHEAST

public static final int ANCHOR_NORTHEAST
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_WEST

public static final int ANCHOR_WEST
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_CENTER

public static final int ANCHOR_CENTER
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_EAST

public static final int ANCHOR_EAST
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_SOUTHWEST

public static final int ANCHOR_SOUTHWEST
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_SOUTH

public static final int ANCHOR_SOUTH
Alias for grid bag constraints.

See Also:
Constant Field Values

ANCHOR_SOUTHEAST

public static final int ANCHOR_SOUTHEAST
Alias for grid bag constraints.

See Also:
Constant Field Values

NO_FILL

public static final int NO_FILL
Alias for grid bag constraints no fill.

See Also:
Constant Field Values

HORIZONTAL_FILL

public static final int HORIZONTAL_FILL
Alias for grid bag constraints horizontal fill.

See Also:
Constant Field Values

VERTICAL_FILL

public static final int VERTICAL_FILL
Alias for grid bag constraints vertical fill.

See Also:
Constant Field Values

FILL_BOTH

public static final int FILL_BOTH
Alias for grid bag constraints fill both horizontally and vertically.

See Also:
Constant Field Values
Constructor Detail

LayoutBuilder

public LayoutBuilder()
Method Detail

getRootComponent

public LayoutComponent getRootComponent()
Get the outermost LayoutComponent.


getDefaultAnchor

public int getDefaultAnchor()
Get the default anchor used when adding components.


setDefaultAnchor

public void setDefaultAnchor(int anchor)
Set the default anchor used when adding components.

Parameters:
anchor - one of the ANCHOR constants.

getDefaultFill

public int getDefaultFill()
Get the default fill used when adding components.


setDefaultFill

public void setDefaultFill(int fill)
Set the default fill used when adding components.

Parameters:
fill - one of the FILL constants.

addToPanel

public void addToPanel(java.awt.Container container)
Set the layout manager for the container and add all the UI components in the layout with the appropriate constraints. The outermost panel must be the current panel to call this method.

Parameters:
container - the container to add to, must not be null
Throws:
java.lang.IllegalArgumentException - if container is null
java.lang.IllegalStateException - if the current panel isn't the outermost panel

add

public void add(LayoutComponent lc)
Add a LayoutComponent to the current panel.


add

public void add(java.awt.Component component,
                java.awt.Insets insets,
                int columnSpan,
                boolean isRowResizable,
                boolean isColumnResizable)
Add a UI component. This creates a new LayoutLeaf using the current default fill and anchor values.

See Also:
LayoutLeaf

add

public void add(java.awt.Component component,
                java.awt.Insets insets,
                int columnSpan,
                boolean isRowResizable,
                boolean isColumnResizable,
                int anchor,
                int fill)
Add a UI component. This creates a new LayoutLeaf.

See Also:
LayoutLeaf

addHFiller

public void addHFiller()
Add a horizontal filler. This is a horizontally resizable component of zero size.


addVFiller

public void addVFiller()
Add a vertical filler. This is a vertically resizable component of zero size.


addVGap

public void addVGap()
Add a vertical gap of default size.


addVGap

public void addVGap(int height)
Add a vertical gap of the specified size.


addHGap

public void addHGap()
Add horizontal gap of default size.


addHGap

public void addHGap(int width)
Add horizontal gap of the specified size.


nl

public void nl()
Move down one row.


pushPanel

public void pushPanel()
Create a new layout panel and make it the current panel.


popPanel

public void popPanel()
Add the current panel to the enclosing one and make the enclosing one the current panel.

Throws:
java.lang.IllegalStateException - if the current panel is the outermost panel

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

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