uic.layout
Class VerticalLayout

java.lang.Object
  extended by uic.layout.VerticalLayout
All Implemented Interfaces:
LayoutManager, LayoutManager2

public class VerticalLayout
extends Object
implements LayoutManager2


Constructor Summary
VerticalLayout()
           
VerticalLayout(int margin, int spacing)
           
 
Method Summary
 void addLayoutComponent(Component component, Object constraint)
          Adds the specified component with the specified name to the layout.
 void addLayoutComponent(String name, Component component)
          Adds the specified component with the specified name to the layout.
 float getLayoutAlignmentX(Container parent)
          Returns the alignment along the x axis.
 float getLayoutAlignmentY(Container parent)
          Returns the alignment along the y axis.
 int getMargin()
           
 int getNumRows()
           
 double getRow(int row)
           
 int getSpacing()
           
 void invalidateLayout(Container target)
          Invalidates the layout.
 void layoutContainer(Container container)
          To lay out the specified container using this layout.
 Dimension maximumLayoutSize(Container component)
          Returns the maximum dimensions for this layout given the components in the specified target container.
 Dimension minimumLayoutSize(Container container)
          Determines the minimum size of the container argument using this layout.
 Dimension preferredLayoutSize(Container container)
          Determines the preferred size of the container argument using this layout.
 void removeLayoutComponent(Component component)
          Removes the specified component from the layout.
 void setMargin(int margin)
          Set margin.
 void setRow(int row, double size)
           
 void setSpacing(int spacing)
          Set spacing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerticalLayout

public VerticalLayout()

VerticalLayout

public VerticalLayout(int margin,
                      int spacing)
Method Detail

setRow

public void setRow(int row,
                   double size)

getRow

public double getRow(int row)

getNumRows

public int getNumRows()

layoutContainer

public void layoutContainer(Container container)
To lay out the specified container using this layout. This method reshapes the components in the specified target container in order to satisfy the constraints of all components.

User code should not have to call this method directly.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
container - container being served by this layout manager

preferredLayoutSize

public Dimension preferredLayoutSize(Container container)
Determines the preferred size of the container argument using this layout. The preferred size is the smallest size that, if used for the container's size, will ensure that all components are at least as large as their preferred size.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
container - container being served by this layout manager
Returns:
a dimension indicating the container's preferred size

minimumLayoutSize

public Dimension minimumLayoutSize(Container container)
Determines the minimum size of the container argument using this layout. The minimum size is the smallest size that, if used for the container's size, will ensure that all components are at least as large as their minimum size.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
container - container being served by this layout manager
Returns:
a dimension indicating the container's minimum size

addLayoutComponent

public void addLayoutComponent(String name,
                               Component component)
Adds the specified component with the specified name to the layout.

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
name - indicates entry's position and anchor
component - component to add

addLayoutComponent

public void addLayoutComponent(Component component,
                               Object constraint)
Adds the specified component with the specified name to the layout.

Specified by:
addLayoutComponent in interface LayoutManager2
Parameters:
component - component to add
constraint - indicates entry's position and alignment

removeLayoutComponent

public void removeLayoutComponent(Component component)
Removes the specified component from the layout.

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
component - component being removed

maximumLayoutSize

public Dimension maximumLayoutSize(Container component)
Returns the maximum dimensions for this layout given the components in the specified target container.

Specified by:
maximumLayoutSize in interface LayoutManager2
Parameters:
component - the component which needs to be laid out

getLayoutAlignmentX

public float getLayoutAlignmentX(Container parent)
Returns the alignment along the x axis.

Specified by:
getLayoutAlignmentX in interface LayoutManager2
Returns:
unconditionally, 0.5

getLayoutAlignmentY

public float getLayoutAlignmentY(Container parent)
Returns the alignment along the y axis.

Specified by:
getLayoutAlignmentY in interface LayoutManager2
Returns:
unconditionally, 0.5

invalidateLayout

public void invalidateLayout(Container target)
Invalidates the layout.

Specified by:
invalidateLayout in interface LayoutManager2

setMargin

public void setMargin(int margin)
Set margin. The margin is the absolute space around the widget.
When you have a 10x10 pixels icon placed on a widget that has a margin of 6 pixels, the complete height of the widget will be 16 pixels, and the icon will be placed in the center.


setSpacing

public void setSpacing(int spacing)
Set spacing. The spacing is the absolute space between each child-widget, when spacing is 6 and an icon is placed at x=10, and has with of 10 then next widget will be placed at 10+10+6 is 26.
Notice that spacing is only between child-widgets; see margin for the area around the parent widget.


getSpacing

public int getSpacing()

getMargin

public int getMargin()


Copyright © 2002-2004 Thomas Zander Available under the Free Apache licence