org.omegahat.Graphics.Layouts
Class BorderAllocator

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--org.omegahat.Environment.Utils.OrderedTable
                    |
                    +--org.omegahat.Graphics.Layouts.BasicAllocator
                          |
                          +--org.omegahat.Graphics.Layouts.BorderAllocator
All Implemented Interfaces:
Activable, AssignableSubset, java.lang.Cloneable, Database, EnumeratedRegionAllocator, java.util.Iterator, java.util.Map, RegionAllocator, java.io.Serializable, ShallowCopyable, Subsettable
Direct Known Subclasses:
DataPlotAllocator

public class BorderAllocator
extends BasicAllocator
implements RegionAllocator

Region allocator that provides similar (but not identical) behaviour as the BorderLayout manager in AWT, allowing each of the 4 sides of a rectangle to be allocated to children that occupy their natural space and giving the remaining interior to the "Center" child. This uses the UDoubleExpression mechanism to define the "constraints" between the different components. It differes the the BorderLayout by not worrying about minimum sizes, allocating the corners to a particular compass point but allows this to be decided by the children and the order they are added.
Note that you should not change the UDouble objects in the different RegionDescriptionInt objects of the children "managed" by this allocator. You can change their values, but we maintain references to them.

See Also:
Serialized Form

Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
protected  RegionDescriptionInt center
           
static int CENTER
           
static int CENTRE
           
static int EAST
           
static int NORTH
           
static java.lang.String[] RegionNames
           
static int SOUTH
           
static int WEST
           
 
Fields inherited from class org.omegahat.Graphics.Layouts.BasicAllocator
cursor
 
Fields inherited from class org.omegahat.Environment.Utils.OrderedTable
listeners, name, orderedElements, orderedKeys, state
 
Fields inherited from interface org.omegahat.Environment.Databases.Database
ALL, ASSIGN, ATTACH, DETACH, NULL_ENTRY, READ, READ_WRITE, REMOVE
 
Fields inherited from interface org.omegahat.Environment.Databases.Activable
ACTIVE, INACTIVE
 
Constructor Summary
BorderAllocator()
           
 
Method Summary
 RegionDescriptionInt getCenter()
          Accessor for center field
 RegionDescriptionInt setCenter(RegionDescriptionInt value)
          Accessor for setting center field
 RegionDescriptionInt setDescription(int regionId, GraphicalComponentInt child, GraphicalContainerInt parent)
          Get the description indexed by order/position.
 RegionDescriptionInt setDescription(java.lang.String regionId, GraphicalComponentInt child, GraphicalContainerInt parent)
          Get the description indexed by arbitrary object.
 
Methods inherited from class org.omegahat.Graphics.Layouts.BasicAllocator
getCursor, getRegionDescriptions, getRegions, hasNext, next, nextDescription, remove, setCursor, setDescription
 
Methods inherited from class org.omegahat.Environment.Utils.OrderedTable
add, add, addListListener, assign, assignSubset, attach, clear, copy, copy, detach, elementAt, exists, get, getName, getState, keys, listeners, listeners, notifyListeners, objects, ordered, orderedKeys, put, put, put, remove, remove, removeElement, removeElement, removeElementAt, removeElementAt, removeListListener, setElementAt, setName, setState, subset, subset, subset
 
Methods inherited from class java.util.Hashtable
clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, rehash, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.omegahat.Graphics.Layouts.RegionAllocator
getRegionDescriptions, getRegions, setDescription
 
Methods inherited from interface org.omegahat.Environment.Databases.Database
size
 

Field Detail

RegionNames

public static final java.lang.String[] RegionNames

NORTH

public static final int NORTH

SOUTH

public static final int SOUTH

EAST

public static final int EAST

WEST

public static final int WEST

CENTER

public static final int CENTER

CENTRE

public static final int CENTRE

center

protected RegionDescriptionInt center
Constructor Detail

BorderAllocator

public BorderAllocator()
Method Detail

setDescription

public RegionDescriptionInt setDescription(int regionId,
                                           GraphicalComponentInt child,
                                           GraphicalContainerInt parent)
Description copied from class: BasicAllocator
Get the description indexed by order/position.
Specified by:
setDescription in interface RegionAllocator
Overrides:
setDescription in class BasicAllocator

setDescription

public RegionDescriptionInt setDescription(java.lang.String regionId,
                                           GraphicalComponentInt child,
                                           GraphicalContainerInt parent)
Description copied from class: BasicAllocator
Get the description indexed by arbitrary object.
Specified by:
setDescription in interface RegionAllocator
Overrides:
setDescription in class BasicAllocator

getCenter

public RegionDescriptionInt getCenter()
Accessor for center field

setCenter

public RegionDescriptionInt setCenter(RegionDescriptionInt value)
Accessor for setting center field