net.sf.magicproject.ui.layout
Class FlowLayout2Center

java.lang.Object
  extended by net.sf.magicproject.ui.layout.FlowLayout2Center
All Implemented Interfaces:
java.awt.LayoutManager

public class FlowLayout2Center
extends java.lang.Object
implements java.awt.LayoutManager

A flow layout arranges components in a directional flow, much like lines of text in a paragraph. The flow direction is determined by the container's componentOrientation property and may be one of two values:

Flow layouts are typically used to arrange buttons in a panel. It arranges buttons horizontally until no more buttons fit on the same line.

A flow layout lets each component assume its natural (preferred) size.

Since:
0.80
Author:
Fabrice Daugan

Constructor Summary
FlowLayout2Center()
          Constructs a new FlowLayout2Center with a centered alignment and a default 5-unit horizontal and vertical gap.
FlowLayout2Center(int hgap, int vgap)
          Creates a new flow layout manager with the indicated horizontal and vertical gaps.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
 int getHgap()
          Gets the horizontal gap between components and between the components and the borders of the Container
 int getVgap()
          Gets the vertical gap between components and between the components and the borders of the Container.
 void layoutContainer(java.awt.Container target)
           
 java.awt.Dimension minimumLayoutSize(java.awt.Container target)
           
 java.awt.Dimension preferredLayoutSize(java.awt.Container target)
           
 void removeLayoutComponent(java.awt.Component comp)
           
 void setHgap(int hgap)
          Sets the horizontal gap between components and between the components and the borders of the Container.
 void setVgap(int vgap)
          Sets the vertical gap between components and between the components and the borders of the Container.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowLayout2Center

public FlowLayout2Center()
Constructs a new FlowLayout2Center with a centered alignment and a default 5-unit horizontal and vertical gap.


FlowLayout2Center

public FlowLayout2Center(int hgap,
                         int vgap)
Creates a new flow layout manager with the indicated horizontal and vertical gaps.

Parameters:
hgap - the horizontal gap between components and between the components and the borders of the Container
vgap - the vertical gap between components and between the components and the borders of the Container
Method Detail

getHgap

public int getHgap()
Gets the horizontal gap between components and between the components and the borders of the Container

Returns:
the horizontal gap between components and between the components and the borders of the Container
Since:
JDK1.1
See Also:
FlowLayout.setHgap(int)

setHgap

public void setHgap(int hgap)
Sets the horizontal gap between components and between the components and the borders of the Container.

Parameters:
hgap - the horizontal gap between components and between the components and the borders of the Container
Since:
JDK1.1
See Also:
FlowLayout.getHgap()

getVgap

public int getVgap()
Gets the vertical gap between components and between the components and the borders of the Container.

Returns:
the vertical gap between components and between the components and the borders of the Container
Since:
JDK1.1
See Also:
FlowLayout.setVgap(int)

setVgap

public void setVgap(int vgap)
Sets the vertical gap between components and between the components and the borders of the Container.

Parameters:
vgap - the vertical gap between components and between the components and the borders of the Container
Since:
JDK1.1
See Also:
FlowLayout.getVgap()

addLayoutComponent

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

removeLayoutComponent

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

preferredLayoutSize

public java.awt.Dimension preferredLayoutSize(java.awt.Container target)
Specified by:
preferredLayoutSize in interface java.awt.LayoutManager

minimumLayoutSize

public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
Specified by:
minimumLayoutSize in interface java.awt.LayoutManager

layoutContainer

public void layoutContainer(java.awt.Container target)
Specified by:
layoutContainer in interface java.awt.LayoutManager


Copyright © 2003-2007 Magic-Project. All Rights Reserved.