yu.ac.bg.etf.javaqx.qswing.layouts
Class FlowLayout

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.layouts.FlowLayout
All Implemented Interfaces:
LayoutManager

public class FlowLayout
extends java.lang.Object
implements LayoutManager

Flow Layout.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
static int CENTER
          Center layout alignment (the value is 1).
static int LEADING
          Leading layout alignment (the value is 3).
static int LEFT
          Left layout alignment (the value is 0).
static int RIGHT
          Right layout alignment (the value is 2).
static int TRAILING
          Trailing layout alignment (the value is 4).
 
Constructor Summary
FlowLayout()
          Constructs new FlowLayout object.
FlowLayout(int align)
          Constructs new FlowLayout object.
FlowLayout(int align, int hgap, int vgap)
          Constructs new FlowLayout object.
 
Method Summary
 void addLayoutComponent(JQComponent comp, java.lang.Object constraints)
          Adds the specified component to the layout.
 int getAlignment()
          Returns the alignment for this layout.
 int getHgap()
          Returns the horizontal gap between components.
 int getVgap()
          Returns the vertical gap between components.
 void invalidateLayout(JQContainer target)
          Invalidates the layout.
 void layoutContainer(JQContainer target)
          Lays out the specified container.
 Dimension maximumLayoutSize(JQContainer target)
          Calculates the maximum size dimensions for the specified container.
 Dimension minimumLayoutSize(JQContainer target)
          Calculates the minimum size dimensions for the specified containers.
 Dimension preferredLayoutSize(JQContainer target)
          Calculates the preferred size dimensions for the specified container.
 void removeLayoutComponent(JQComponent comp)
          Removes the specified component from the layout.
 void setAlignment(int alignment)
          Sets the alignment for this layout.
 void setHgap(int hgap)
          Sets the horizontal gap between components.
 void setVgap(int vgap)
          Sets the vertical gap between components.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LEFT

public static final int LEFT
Left layout alignment (the value is 0).

See Also:
Constant Field Values

CENTER

public static final int CENTER
Center layout alignment (the value is 1).

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Right layout alignment (the value is 2).

See Also:
Constant Field Values

LEADING

public static final int LEADING
Leading layout alignment (the value is 3).

See Also:
Constant Field Values

TRAILING

public static final int TRAILING
Trailing layout alignment (the value is 4).

See Also:
Constant Field Values
Constructor Detail

FlowLayout

public FlowLayout(int align,
                  int hgap,
                  int vgap)
Constructs new FlowLayout object.

Parameters:
align - the alignment value
hgap - the horizontal gap between components
vgap - the vertical gap between components

FlowLayout

public FlowLayout(int align)
Constructs new FlowLayout object.

Parameters:
align - the alignment value

FlowLayout

public FlowLayout()
Constructs new FlowLayout object.

Method Detail

getAlignment

public int getAlignment()
Returns the alignment for this layout.

Returns:
the alignment for this layout

setAlignment

public void setAlignment(int alignment)
Sets the alignment for this layout.

Parameters:
alignment - he alignment

getHgap

public int getHgap()
Returns the horizontal gap between components.

Returns:
the horizontal gap between components

setHgap

public void setHgap(int hgap)
Sets the horizontal gap between components.

Parameters:
hgap - the horizontal gap between components

getVgap

public int getVgap()
Returns the vertical gap between components.

Returns:
the vertical gap between components

setVgap

public void setVgap(int vgap)
Sets the vertical gap between components.

Parameters:
vgap - the vertical gap between components

addLayoutComponent

public void addLayoutComponent(JQComponent comp,
                               java.lang.Object constraints)
Adds the specified component to the layout.

Specified by:
addLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be added
constraints - the layout constraints

removeLayoutComponent

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

Specified by:
removeLayoutComponent in interface LayoutManager
Parameters:
comp - the component to be removed

preferredLayoutSize

public Dimension preferredLayoutSize(JQContainer target)
Calculates the preferred size dimensions for the specified container.

Specified by:
preferredLayoutSize in interface LayoutManager
Parameters:
target - the container to be laid out
Returns:
the preferred size of the specified container

maximumLayoutSize

public Dimension maximumLayoutSize(JQContainer target)
Calculates the maximum size dimensions for the specified container.

Specified by:
maximumLayoutSize in interface LayoutManager
Parameters:
target - the component to be laid out
Returns:
the maximum size of the specified container

minimumLayoutSize

public Dimension minimumLayoutSize(JQContainer target)
Calculates the minimum size dimensions for the specified containers.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
target - the component to be laid out
Returns:
the minimum size of the specified container

layoutContainer

public void layoutContainer(JQContainer target)
Lays out the specified container.

Specified by:
layoutContainer in interface LayoutManager
Parameters:
target - the container to be laid out

invalidateLayout

public void invalidateLayout(JQContainer target)
Invalidates the layout.

Specified by:
invalidateLayout in interface LayoutManager
Parameters:
target - the container to be laid out

toString

public java.lang.String toString()



Copyright © 2007 ETF and contributors. All Rights Reserved.