javax.rad.genui.layout
Class UIFlowLayout

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UILayout<IFlowLayout,Object>
          extended by javax.rad.genui.layout.UIFlowLayout
All Implemented Interfaces:
IAlignmentConstants, ILayout<Object>, IResource, IFlowLayout

public class UIFlowLayout
extends UILayout<IFlowLayout,Object>
implements IFlowLayout

Platform and technology independent FlowLayout. It is designed for use with AWT, Swing, SWT, JSP, JSF,... .


Field Summary
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.ui.layout.IFlowLayout
HORIZONTAL, VERTICAL
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
  UIFlowLayout()
          Creates a new instance of UIFlowLayout.
protected UIFlowLayout(IFlowLayout pLayout)
          Creates a new instance of UIFlowLayout with the given layout.
  UIFlowLayout(int pOrientation)
          Creates a new instance of UIFlowLayout.
  UIFlowLayout(int pOrientation, int pHorizontalGap, int pVerticalGap)
          Creates a new instance of UIFlowLayout with a given orientation and default gaps.
 
Method Summary
 int getComponentAlignment()
          Gets the alignment between the components.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 int getOrientation()
          Gets the orientation of this flow layout.
 int getVerticalAlignment()
          Returns the alignment along the y axis.
 boolean isAutoWrap()
          Gets the current state of the automatic wrap mode.
 void setAutoWrap(boolean pAutoWrap)
          Sets the automatic wrap mode.
 void setComponentAlignment(int pComponentAlignment)
          Sets the alignment between the components.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setOrientation(int pOrientation)
          Sets the orientation of this flow layout.
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the vertical alignment.
 
Methods inherited from class javax.rad.genui.UILayout
getConstraints, getHorizontalGap, getMargins, getVerticalGap, setConstraints, setHorizontalGap, setMargins, setMargins, setVerticalGap
 
Methods inherited from class javax.rad.genui.UIResource
equals, eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getResource, getUIResource, hashCode, hasResourceHandler, putObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.ILayout
getConstraints, getHorizontalGap, getMargins, getVerticalGap, setConstraints, setHorizontalGap, setMargins, setVerticalGap
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

UIFlowLayout

public UIFlowLayout()
Creates a new instance of UIFlowLayout.

See Also:
IFlowLayout

UIFlowLayout

protected UIFlowLayout(IFlowLayout pLayout)
Creates a new instance of UIFlowLayout with the given layout.

Parameters:
pLayout - the layout
See Also:
IFlowLayout

UIFlowLayout

public UIFlowLayout(int pOrientation)
Creates a new instance of UIFlowLayout.

Parameters:
pOrientation - the orientation.
See Also:
IFlowLayout

UIFlowLayout

public UIFlowLayout(int pOrientation,
                    int pHorizontalGap,
                    int pVerticalGap)
Creates a new instance of UIFlowLayout with a given orientation and default gaps.

Parameters:
pOrientation - the orientation.
pHorizontalGap - the horizontal gap.
pVerticalGap - the vertical gap.
See Also:
IFlowLayout
Method Detail

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getHorizontalAlignment in interface IAlignmentConstants
Returns:
the horizontal alignment

setHorizontalAlignment

public void setHorizontalAlignment(int pHorizontalAlignment)
Sets the horizontal alignment. Possible values are defined in AlignmentConstants.

Specified by:
setHorizontalAlignment in interface IAlignmentConstants
Parameters:
pHorizontalAlignment - the new vertical alignment

getVerticalAlignment

public int getVerticalAlignment()
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getVerticalAlignment in interface IAlignmentConstants
Returns:
the vertical alignment

setVerticalAlignment

public void setVerticalAlignment(int pVerticalAlignment)
Sets the vertical alignment. Possible values are defined in AlignmentConstants.

Specified by:
setVerticalAlignment in interface IAlignmentConstants
Parameters:
pVerticalAlignment - the new vertical alignment

getOrientation

public int getOrientation()
Gets the orientation of this flow layout. It can be HORIZONTAL or VERTICAL.

Specified by:
getOrientation in interface IFlowLayout
Returns:
the orientation.

setOrientation

public void setOrientation(int pOrientation)
Sets the orientation of this flow layout. It can be HORIZONTAL or VERTICAL.

Specified by:
setOrientation in interface IFlowLayout
Parameters:
pOrientation - the orientation.

getComponentAlignment

public int getComponentAlignment()
Gets the alignment between the components. For horizontal orientation the component alignment can be ALIGN_TOP, ALIGN_CENTER, ALIGN_BOTTOM or ALIGN_STRETCH for vertical orientation ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT or ALIGN_STRETCH. Switching the orientation maps top to left and bottom to right alignment.

Specified by:
getComponentAlignment in interface IFlowLayout
Returns:
the component alignment.

setComponentAlignment

public void setComponentAlignment(int pComponentAlignment)
Sets the alignment between the components. For horizontal orientation the component alignment can be ALIGN_TOP, ALIGN_CENTER, ALIGN_BOTTOM or ALIGN_STRETCH for vertical orientation ALIGN_LEFT, ALIGN_CENTER, ALIGN_RIGHT or ALIGN_STRETCH. Switching the orientation maps top to left and bottom to right alignment.

Specified by:
setComponentAlignment in interface IFlowLayout
Parameters:
pComponentAlignment - the component alignment.

isAutoWrap

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

Specified by:
isAutoWrap in interface IFlowLayout
Returns:
true if the automatic wrap mode is enabled; otherwise false

setAutoWrap

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

Specified by:
setAutoWrap in interface IFlowLayout
Parameters:
pAutoWrap - true to enabled the auto wrap mode, false otherwise


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.