Sweet Home 3D 4.0

com.eteks.sweethome3d.swing
Class ProportionalLayout

java.lang.Object
  extended by com.eteks.sweethome3d.swing.ProportionalLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2

public class ProportionalLayout
extends Object
implements LayoutManager2

A layout manager that displays two components at the top of each other. The component at top is sized at container width and at its preferred height. The component at bottom is centered in the rest of the space and sized proportionally to its preferred size.

Author:
Emmanuel Puybaret

Nested Class Summary
static class ProportionalLayout.Constraints
          The two locations where components managed by a ProportionalLayout instance can be placed.
 
Constructor Summary
ProportionalLayout()
          Creates a layout manager which layouts its component with a default gap of 5 pixels between them.
ProportionalLayout(int gap)
          Creates a layout manager which layouts its component with a given gap between them.
 
Method Summary
 void addLayoutComponent(Component component, Object constraints)
          Records a given component in this layout manager as the component at Constraints.TOP or at Constraints.BOTTOM of its container.
 void addLayoutComponent(String name, Component comp)
          Do not use.
 float getLayoutAlignmentX(Container target)
          Returns 0.5.
 float getLayoutAlignmentY(Container target)
          Return 0.
 void invalidateLayout(Container target)
          Invalidates layout.
 void layoutContainer(Container parent)
          Layouts the container.
 Dimension maximumLayoutSize(Container parent)
          Returns the largest maximum width of the components managed by this layout manager, and the sum of their maximum heights.
 Dimension minimumLayoutSize(Container parent)
          Returns the largest minimum width of the components managed by this layout manager, and the sum of their minimum heights.
 Dimension preferredLayoutSize(Container parent)
          Returns the largest preferred width of the components managed by this layout manager, and the sum of their preferred heights.
 void removeLayoutComponent(Component component)
          Removes the given component from the ones managed by this layout manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProportionalLayout

public ProportionalLayout()
Creates a layout manager which layouts its component with a default gap of 5 pixels between them.


ProportionalLayout

public ProportionalLayout(int gap)
Creates a layout manager which layouts its component with a given gap between them.

Method Detail

addLayoutComponent

public void addLayoutComponent(Component component,
                               Object constraints)
Records a given component in this layout manager as the component at Constraints.TOP or at Constraints.BOTTOM of its container.

Specified by:
addLayoutComponent in interface LayoutManager2

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)
Do not use.

Specified by:
addLayoutComponent in interface LayoutManager

removeLayoutComponent

public void removeLayoutComponent(Component component)
Removes the given component from the ones managed by this layout manager.

Specified by:
removeLayoutComponent in interface LayoutManager

getLayoutAlignmentX

public float getLayoutAlignmentX(Container target)
Returns 0.5.

Specified by:
getLayoutAlignmentX in interface LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(Container target)
Return 0.

Specified by:
getLayoutAlignmentY in interface LayoutManager2

invalidateLayout

public void invalidateLayout(Container target)
Invalidates layout.

Specified by:
invalidateLayout in interface LayoutManager2

layoutContainer

public void layoutContainer(Container parent)
Layouts the container.

Specified by:
layoutContainer in interface LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container parent)
Returns the largest minimum width of the components managed by this layout manager, and the sum of their minimum heights.

Specified by:
minimumLayoutSize in interface LayoutManager

maximumLayoutSize

public Dimension maximumLayoutSize(Container parent)
Returns the largest maximum width of the components managed by this layout manager, and the sum of their maximum heights.

Specified by:
maximumLayoutSize in interface LayoutManager2

preferredLayoutSize

public Dimension preferredLayoutSize(Container parent)
Returns the largest preferred width of the components managed by this layout manager, and the sum of their preferred heights.

Specified by:
preferredLayoutSize in interface LayoutManager

Sweet Home 3D 4.0

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License