FreeHEP API
Version current

org.freehep.swing.layout
Class PercentLayout

java.lang.Object
  extended byorg.freehep.swing.layout.PercentLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2

public class PercentLayout
extends Object
implements LayoutManager2

Lays out components within a Container such that each component takes a fixed percentage of the size. Each Component added to the Container must have a Constraint object that specifies what proportion of the container it will fill. The Component will be stretched to fill exactly that percentage.

See Also:
PercentLayout.Constraint
Source Code:
PercentLayout.java

Nested Class Summary
static class PercentLayout.Constraint
           
 
Constructor Summary
PercentLayout()
           
 
Method Summary
 void addLayoutComponent(Component component, Object constraint)
           
 void addLayoutComponent(String constraint, Component comp)
           
 PercentLayout.Constraint getConstraintFor(Component component)
           
 float getLayoutAlignmentX(Container p1)
           
 float getLayoutAlignmentY(Container p1)
           
 void invalidateLayout(Container p1)
           
 void layoutContainer(Container p1)
           
 Dimension maximumLayoutSize(Container p1)
           
 Dimension minimumLayoutSize(Container p1)
           
 Dimension preferredLayoutSize(Container p1)
           
 void removeLayoutComponent(Component component)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PercentLayout

public PercentLayout()
Method Detail

getLayoutAlignmentX

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

getLayoutAlignmentY

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

addLayoutComponent

public void addLayoutComponent(Component component,
                               Object constraint)
Specified by:
addLayoutComponent in interface LayoutManager2

addLayoutComponent

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

invalidateLayout

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

layoutContainer

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

maximumLayoutSize

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

minimumLayoutSize

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

preferredLayoutSize

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

removeLayoutComponent

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

getConstraintFor

public PercentLayout.Constraint getConstraintFor(Component component)

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.