com.sibvisions.rad.ui.swing.ext.layout
Class JVxSequenceLayout

java.lang.Object
  extended by com.sibvisions.rad.ui.swing.ext.layout.JVxSequenceLayout
All Implemented Interfaces:
JVxConstants, LayoutManager, SwingConstants

public class JVxSequenceLayout
extends Object
implements LayoutManager, JVxConstants

The JVxSequenceLayout can be used as FlowLayout with additional features. The additional features are:


Field Summary
 
Fields inherited from interface com.sibvisions.rad.ui.swing.ext.JVxConstants
STRETCH
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
JVxSequenceLayout()
          Creates a new instance of JVxSequenceLayout with SwingConstants.HORIZONTAL orientation and 5 pixels vertical and horizontal gap.
JVxSequenceLayout(int pOrientation)
          Creates a new instance of JVxSequenceLayout with the desired orientation and 5 pixels vertical and horizontal gap.
JVxSequenceLayout(int pOrientation, int pHorizontalGap, int pVerticalGap)
          Creates a new instance of JVxSequenceLayout with the desired orientation and gaps.
 
Method Summary
 void addLayoutComponent(String name, Component comp)
          
 int getHorizontalAlignment()
          Returns the alignment for the x axis.
 int getHorizontalComponentAlignment()
          Gets the component alignment for the x axis.
 int getHorizontalGap()
          Gets the horizontal gap between components.
 Insets getMargins()
          Gets the layout margins.
 int getOrientation()
          Gets the component orientation.
 int getVerticalAlignment()
          Gets the alignment for the y axis.
 int getVerticalComponentAlignment()
          Gets the component alignment for the x axis.
 int getVerticalGap()
          Gets the vertical gap between components.
 boolean isAutoWrap()
          Gets the current state of the automatic wrap mode.
 void layoutContainer(Container pContainer)
          
 Dimension minimumLayoutSize(Container target)
          Gets the minimum layout size.
 Dimension preferredLayoutSize(Container pContainer)
          
 void removeLayoutComponent(Component comp)
          
 void setAutoWrap(boolean pAutoWrap)
          Sets the automatic wrap mode.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the alignment for the x axis.
 void setHorizontalComponentAlignment(int pHorizontalComponentAlignment)
          Sets the component alignment for the x axis.
 void setHorizontalGap(int pGap)
          Sets horizontal gap between components.
 void setMargins(Insets pMargins)
          Sets the layout margins.
 void setOrientation(int pOrientation)
          Sets the orientation of the components in the "layout".
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the alignment for the y axis.
 void setVerticalComponentAlignment(int pVerticalComponentAlignment)
          Sets the component alignement for the y axis.
 void setVerticalGap(int pGap)
          Sets the vertical gap between components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVxSequenceLayout

public JVxSequenceLayout()
Creates a new instance of JVxSequenceLayout with SwingConstants.HORIZONTAL orientation and 5 pixels vertical and horizontal gap.


JVxSequenceLayout

public JVxSequenceLayout(int pOrientation)
Creates a new instance of JVxSequenceLayout with the desired orientation and 5 pixels vertical and horizontal gap.

Parameters:
pOrientation - the desired orientation

JVxSequenceLayout

public JVxSequenceLayout(int pOrientation,
                         int pHorizontalGap,
                         int pVerticalGap)
Creates a new instance of JVxSequenceLayout with the desired orientation and gaps.

Parameters:
pOrientation - the desired orientation
pHorizontalGap - the horizontal gap
pVerticalGap - the vertical gap
Method Detail

addLayoutComponent

public void addLayoutComponent(String name,
                               Component comp)

Specified by:
addLayoutComponent in interface LayoutManager

removeLayoutComponent

public void removeLayoutComponent(Component comp)

Specified by:
removeLayoutComponent in interface LayoutManager

preferredLayoutSize

public Dimension preferredLayoutSize(Container pContainer)

Specified by:
preferredLayoutSize in interface LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container target)
Gets the minimum layout size.

Specified by:
minimumLayoutSize in interface LayoutManager
Parameters:
target - the container
Returns:
a new dimension with a width and height of 0

layoutContainer

public void layoutContainer(Container pContainer)

Specified by:
layoutContainer in interface LayoutManager

setOrientation

public void setOrientation(int pOrientation)
Sets the orientation of the components in the "layout".

Parameters:
pOrientation - the orientation SwingConstants.HORIZONTAL or SwingConstants.VERTICAL

getOrientation

public int getOrientation()
Gets the component orientation.

Returns:
SwingConstants.HORIZONTAL or SwingConstants.VERTICAL

setHorizontalGap

public void setHorizontalGap(int pGap)
Sets horizontal gap between components.

Parameters:
pGap - the gap in pixel

getHorizontalGap

public int getHorizontalGap()
Gets the horizontal gap between components.

Returns:
the gap in pixel

setVerticalGap

public void setVerticalGap(int pGap)
Sets the vertical gap between components.

Parameters:
pGap - the gap in pixel

getVerticalGap

public int getVerticalGap()
Gets the vertical gap between components.

Returns:
the gap in pixel

setAutoWrap

public void setAutoWrap(boolean pAutoWrap)
Sets the automatic wrap mode. This means that the layout acts like the FlowLayout.

Parameters:
pAutoWrap - true to enabled the auto wrap mode; false otherwise

isAutoWrap

public boolean isAutoWrap()
Gets the current state of the automatic wrap mode.

Returns:
true if the automatic wrap mode is enabled; otherwise false

setHorizontalAlignment

public void setHorizontalAlignment(int pHorizontalAlignment)
Sets the alignment for the x axis.

Parameters:
pHorizontalAlignment - the alignment SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT or JVxConstants.STRETCH

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the alignment for the x axis.

Returns:
the alignment SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT or JVxConstants.STRETCH

setVerticalAlignment

public void setVerticalAlignment(int pVerticalAlignment)
Sets the alignment for the y axis.

Parameters:
pVerticalAlignment - the alignment SwingConstants.TOP, SwingConstants.CENTER, SwingConstants.BOTTOM or JVxConstants.STRETCH

getVerticalAlignment

public int getVerticalAlignment()
Gets the alignment for the y axis.

Returns:
the alignment SwingConstants.TOP, SwingConstants.CENTER, SwingConstants.BOTTOM or JVxConstants.STRETCH

setHorizontalComponentAlignment

public void setHorizontalComponentAlignment(int pHorizontalComponentAlignment)
Sets the component alignment for the x axis. The alignment will be used, if the container contains components which have different widths and the orientation of the layout is SwingConstants.VERTICAL.

Parameters:
pHorizontalComponentAlignment - the alignment SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT or JVxConstants.STRETCH

getHorizontalComponentAlignment

public int getHorizontalComponentAlignment()
Gets the component alignment for the x axis.

Returns:
the alignment SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT or JVxConstants.STRETCH
See Also:
setHorizontalComponentAlignment(int)

setVerticalComponentAlignment

public void setVerticalComponentAlignment(int pVerticalComponentAlignment)
Sets the component alignement for the y axis. The alignment will be used, if the container contains components which have different heights and the orientation of the layout is SwingConstants.HORIZONTAL.

Parameters:
pVerticalComponentAlignment - the alignment SwingConstants.TOP, SwingConstants.CENTER, SwingConstants.BOTTOM or JVxConstants.STRETCH

getVerticalComponentAlignment

public int getVerticalComponentAlignment()
Gets the component alignment for the x axis.

Returns:
the alignment SwingConstants.TOP, SwingConstants.CENTER, SwingConstants.BOTTOM or JVxConstants.STRETCH
See Also:
setVerticalComponentAlignment(int)

setMargins

public void setMargins(Insets pMargins)
Sets the layout margins.

Parameters:
pMargins - the margins

getMargins

public Insets getMargins()
Gets the layout margins.

Returns:
the margins


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.