com.sibvisions.rad.ui.swing.impl.layout
Class AwtFlowLayout

java.lang.Object
  extended by com.sibvisions.rad.ui.awt.impl.AwtResource<JVxSequenceLayout>
      extended by com.sibvisions.rad.ui.swing.impl.layout.AwtFlowLayout
All Implemented Interfaces:
IAlignmentConstants, ILayout<Object>, IResource, IFlowLayout

public class AwtFlowLayout
extends AwtResource<JVxSequenceLayout>
implements IFlowLayout

The AwtFormLayout is a platform independent FlowLayout impelementation.

See Also:
JVxSequenceLayout

Field Summary
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
Fields inherited from interface javax.rad.ui.layout.IFlowLayout
HORIZONTAL, VERTICAL
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
AwtFlowLayout()
          Creates a new instance of AwtSimpleFormLayout based on an IFlowLayout implementation.
 
Method Summary
 int getComponentAlignment()
          Gets the alignment between the components.
 Object getConstraints(IComponent pComponent)
          Gets the constraints for the specified IComponent.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 int getHorizontalGap()
          Returns the horizontal gap between components.
 IInsets getMargins()
          Gets the margins.
 int getOrientation()
          Gets the orientation of this flow layout.
 int getVerticalAlignment()
          Returns the alignment along the y axis.
 int getVerticalGap()
          Returns the vertical gap between components.
 boolean isAutoWrap()
          Gets the current state of the automatic wrap mode.
 boolean isSquareComponents()
          Gets the square components mode.
 void setAutoWrap(boolean pAutoWrap)
          Sets the automatic wrap mode.
 void setComponentAlignment(int pComponentAlignment)
          Sets the alignment between the components.
 void setConstraints(IComponent pComponent, Object pConstraints)
          Gets the constraints for the specified IComponent.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setHorizontalGap(int pHgap)
          Sets the horizontal gap between components.
 void setMargins(IInsets pMargins)
          Sets the margins.
 void setOrientation(int pOrientation)
          Sets the orientation of this flow layout.
 void setSquareComponents(boolean pSquareComponents)
          Sets the square components mode.
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the vertical alignment.
 void setVerticalGap(int pVgap)
          Sets the vertical gap between components.
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
equals, getResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

AwtFlowLayout

public AwtFlowLayout()
Creates a new instance of AwtSimpleFormLayout based on an IFlowLayout implementation.

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.

isSquareComponents

public boolean isSquareComponents()
Gets the square components mode. If it is true, all components are sqared.

Specified by:
isSquareComponents in interface IFlowLayout
Returns:
the square components mode.

setSquareComponents

public void setSquareComponents(boolean pSquareComponents)
Sets the square components mode. If it is true, all components are sqared.

Specified by:
setSquareComponents in interface IFlowLayout
Parameters:
pSquareComponents - the square components mode.

getHorizontalGap

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

Specified by:
getHorizontalGap in interface ILayout<Object>
Returns:
returns the horizontal gap between components.

setHorizontalGap

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

Specified by:
setHorizontalGap in interface ILayout<Object>
Parameters:
pHgap - the horizontal gap between components.

getVerticalGap

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

Specified by:
getVerticalGap in interface ILayout<Object>
Returns:
returns the vertical gap between components.

setVerticalGap

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

Specified by:
setVerticalGap in interface ILayout<Object>
Parameters:
pVgap - the vertical gap between components

getMargins

public IInsets getMargins()
Gets the margins.

Specified by:
getMargins in interface ILayout<Object>
Returns:
the margins.

setMargins

public void setMargins(IInsets pMargins)
Sets the margins.

Specified by:
setMargins in interface ILayout<Object>
Parameters:
pMargins - the margins.

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

getConstraints

public Object getConstraints(IComponent pComponent)
Gets the constraints for the specified IComponent.

Specified by:
getConstraints in interface ILayout<Object>
Parameters:
pComponent - the IComponent to be queried
Returns:
the constraint for the specified IComponent, or null if component is null or is not present in this layout

setConstraints

public void setConstraints(IComponent pComponent,
                           Object pConstraints)
Gets the constraints for the specified IComponent.

Specified by:
setConstraints in interface ILayout<Object>
Parameters:
pComponent - the IComponent to be queried
pConstraints - the constraint for the specified IComponent, or null if component is null or is not present in this layout


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.