com.threerings.opengl.gui.layout
Class LayoutManager

java.lang.Object
  extended by com.threerings.opengl.gui.layout.LayoutManager
Direct Known Subclasses:
AbsoluteLayout, AnchorLayout, BorderLayout, GroupLayout, TableLayout

public abstract class LayoutManager
extends Object

Layout managers implement a policy for laying out the children in a container. They must provide routines for computing the preferred size of a target container and for actually laying out its children.


Constructor Summary
LayoutManager()
           
 
Method Summary
 void addLayoutComponent(Component comp, Object constraints)
          Components added to a container will result in a call to this method, informing the layout manager of said constraints.
abstract  Dimension computePreferredSize(Container 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.
 Object getConstraints(Component comp)
          Returns a reference to the constraints associated with the specified component, or null for none.
abstract  void layoutContainer(Container 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(Component comp)
          Components removed to a container for which a layout manager has been configured will result in a call to this method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LayoutManager

public LayoutManager()
Method Detail

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
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.


removeLayoutComponent

public void removeLayoutComponent(Component comp)
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.


getConstraints

public Object getConstraints(Component comp)
Returns a reference to the constraints associated with the specified component, or null for none. The default implementation always returns null.


computePreferredSize

public abstract Dimension computePreferredSize(Container 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. Note: it is not necessary to add the container's insets to the returned preferred size.


layoutContainer

public abstract void layoutContainer(Container 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. Note: the target's insets must be accounted for when laying out the children.



Copyright © 2011. All Rights Reserved.