com.samskivert.swing
Class AbsoluteLayout

java.lang.Object
  extended by com.samskivert.swing.AbsoluteLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2

public class AbsoluteLayout
extends Object
implements LayoutManager2

Used to lay out components at absolute coordinates. This layout manager will not gracefully deal with not having room to layout the components at the coordinates specified, so be sure only to use it in very controlled circumstances.

Components should be added with a Point or Rectangle object as their constraints. If their constraints are a Point they will be laid out at those coordinates with their preferred size. If it is a Rectangle they will be laid out in those exact bounds.


Field Summary
protected  HashMap<Component,Object> _constraints
           
 
Constructor Summary
AbsoluteLayout()
           
 
Method Summary
 void addLayoutComponent(Component comp, Object constraints)
           
 void addLayoutComponent(String name, Component comp)
           
 float getLayoutAlignmentX(Container target)
           
 float getLayoutAlignmentY(Container target)
           
 void invalidateLayout(Container target)
           
 void layoutContainer(Container parent)
           
 Dimension maximumLayoutSize(Container parent)
           
 Dimension minimumLayoutSize(Container parent)
           
 Dimension preferredLayoutSize(Container parent)
           
 void removeLayoutComponent(Component comp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_constraints

protected HashMap<Component,Object> _constraints
Constructor Detail

AbsoluteLayout

public AbsoluteLayout()
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Specified by:
addLayoutComponent in interface LayoutManager

addLayoutComponent

public void addLayoutComponent(Component comp,
                               Object constraints)
Specified by:
addLayoutComponent in interface LayoutManager2

removeLayoutComponent

public void removeLayoutComponent(Component comp)
Specified by:
removeLayoutComponent in interface LayoutManager

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Specified by:
preferredLayoutSize in interface LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Specified by:
minimumLayoutSize in interface LayoutManager

maximumLayoutSize

public Dimension maximumLayoutSize(Container parent)
Specified by:
maximumLayoutSize in interface LayoutManager2

layoutContainer

public void layoutContainer(Container parent)
Specified by:
layoutContainer in interface LayoutManager

invalidateLayout

public void invalidateLayout(Container target)
Specified by:
invalidateLayout in interface LayoutManager2

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Specified by:
getLayoutAlignmentX in interface LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Specified by:
getLayoutAlignmentY in interface LayoutManager2


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.