uk.co.ist.mwt
Class ScaleChildLayout

java.lang.Object
  |
  +--uk.co.ist.mwt.ScaleChildLayout

public class ScaleChildLayout
extends java.lang.Object
implements java.awt.LayoutManager, java.io.Serializable

As we don't let scale widgets have children, to get the normal Motif behaviour, you should put the scale in the East or South section of a BorderLayout, and puts its children in a Container in the Center. This latter Container should have a ScaleChildLayout. The effects should then be as expected. NB. if you change the scale's orientation, don't forget to change that of the layout, and to move it to a new position in the parent. The ScalePanel can be used as a short-cut; it implements the behaviour described above.

See Also:
Serialized Form

Constructor Summary
ScaleChildLayout()
           
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
          Add a component to the layout manager's records.
 boolean isVertical()
          Gets the orientation of this layout
 void layoutContainer(java.awt.Container parent)
          Lays out the container.
protected  java.awt.Dimension layoutSize(java.awt.Container parent, boolean minimum)
          Find out the size - minimum if the flag is set, preferred otherwise - of the /parent/ with this layout attached.
 java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
          Method to find the minimum size of the parent container with this layout
 java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
          Method to find the preferred size of the parent container with this layout
 void removeLayoutComponent(java.awt.Component comp)
          Remove a component from the layout manager's records.
 void setVertical(boolean whether)
          Sets the orientation of this layout
protected  java.awt.Dimension sizeOfComponent(java.awt.Component c, boolean minimum)
          Calculates how large a component wants to be.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScaleChildLayout

public ScaleChildLayout()
Method Detail

setVertical

public void setVertical(boolean whether)
Sets the orientation of this layout

isVertical

public boolean isVertical()
Gets the orientation of this layout
Returns:
true if it's vertical, false otherwise

layoutContainer

public void layoutContainer(java.awt.Container parent)
Lays out the container.
Specified by:
layoutContainer in interface java.awt.LayoutManager

layoutSize

protected java.awt.Dimension layoutSize(java.awt.Container parent,
                                        boolean minimum)
Find out the size - minimum if the flag is set, preferred otherwise - of the /parent/ with this layout attached.

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Method to find the minimum size of the parent container with this layout
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Method to find the preferred size of the parent container with this layout
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Remove a component from the layout manager's records.
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - would be the component to remove.
See Also:
addLayoutComponent(java.lang.String, java.awt.Component)

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Add a component to the layout manager's records.
Specified by:
addLayoutComponent in interface java.awt.LayoutManager
Parameters:
comp - would be the component to add.
name - would be the name with which to add the component.
See Also:
removeLayoutComponent(java.awt.Component)

sizeOfComponent

protected java.awt.Dimension sizeOfComponent(java.awt.Component c,
                                             boolean minimum)
Calculates how large a component wants to be. The minimumLayoutSize method and the preferredLayoutSize method are identical but for the size-finding method called on their children in many of our layout managers; this routine makes it possible to use the same code for both.