com.jmex.bui.layout
Class BorderLayout

java.lang.Object
  extended by com.jmex.bui.layout.BLayoutManager
      extended by com.jmex.bui.layout.BorderLayout

public class BorderLayout
extends BLayoutManager

Lays out the children of a container around the borders and one in the center. For example:

 +------------------------------------+
 |               NORTH                |
 +-----+------------------------+-----+
 |     |                        |     |
 |  W  |         CENTER         |  E  |
 |     |                        |     |
 +-----+------------------------+-----+
 |               SOUTH                |
 +------------------------------------+
 


Field Summary
protected  BComponent[] _components
           
protected  int _hgap
           
protected  int _vgap
           
static Integer CENTER
          A layout constraint.
static Integer EAST
          A layout constraint.
protected static Integer[] HORIZS
           
static Integer IGNORE
          A layout constraint.
static Integer NORTH
          A layout constraint.
static Integer SOUTH
          A layout constraint.
protected static Integer[] VERTS
           
static Integer WEST
          A layout constraint.
 
Constructor Summary
BorderLayout()
          Creates a border layout with zero gap between the horizontal components and zero gap between the vertical.
BorderLayout(int hgap, int vgap)
          Creates a border layout with the specified gap between the horizontal components and the specified gap between the vertical.
 
Method Summary
 void addLayoutComponent(BComponent comp, Object constraints)
          Components added to a container will result in a call to this method, informing the layout manager of said constraints.
 Dimension computePreferredSize(BContainer target, int whint, int hhint)
          Computes the preferred size for the supplied container, based on the preferred sizes of its children and the layout policy implemented by this manager.
 void layoutContainer(BContainer target)
          Effects the layout policy of this manager on the supplied target, adjusting the size and position of its children based on the size and position of the target at the time of this call.
 void removeLayoutComponent(BComponent comp)
          Components removed to a container for which a layout manager has been configured will result in a call to this method.
 void setGaps(int hgap, int vgap)
          Configures our inter-component gaps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORTH

public static final Integer NORTH
A layout constraint.


SOUTH

public static final Integer SOUTH
A layout constraint.


EAST

public static final Integer EAST
A layout constraint.


WEST

public static final Integer WEST
A layout constraint.


CENTER

public static final Integer CENTER
A layout constraint.


IGNORE

public static final Integer IGNORE
A layout constraint.


_hgap

protected int _hgap

_vgap

protected int _vgap

_components

protected BComponent[] _components

VERTS

protected static final Integer[] VERTS

HORIZS

protected static final Integer[] HORIZS
Constructor Detail

BorderLayout

public BorderLayout()
Creates a border layout with zero gap between the horizontal components and zero gap between the vertical.


BorderLayout

public BorderLayout(int hgap,
                    int vgap)
Creates a border layout with the specified gap between the horizontal components and the specified gap between the vertical.

Method Detail

setGaps

public void setGaps(int hgap,
                    int vgap)
Configures our inter-component gaps.


addLayoutComponent

public void addLayoutComponent(BComponent comp,
                               Object constraints)
Description copied from class: BLayoutManager
Components added to a container will result in a call to this method, informing the layout manager of said constraints. The default implementation does nothing.

Overrides:
addLayoutComponent in class BLayoutManager

removeLayoutComponent

public void removeLayoutComponent(BComponent comp)
Description copied from class: BLayoutManager
Components removed to a container for which a layout manager has been configured will result in a call to this method. The default implementation does nothing.

Overrides:
removeLayoutComponent in class BLayoutManager

computePreferredSize

public Dimension computePreferredSize(BContainer target,
                                      int whint,
                                      int hhint)
Description copied from class: BLayoutManager
Computes the preferred size for the supplied container, based on the preferred sizes of its children and the layout policy implemented by this manager. Note: it is not necessary to add the container's insets to the returned preferred size.

Specified by:
computePreferredSize in class BLayoutManager

layoutContainer

public void layoutContainer(BContainer target)
Description copied from class: BLayoutManager
Effects the layout policy of this manager on the supplied target, adjusting the size and position of its children based on the size and position of the target at the time of this call. Note: the target's insets must be accounted for when laying out the children.

Specified by:
layoutContainer in class BLayoutManager


Copyright © 2008 Michael Bayne. All Rights Reserved.