javax.rad.genui.layout
Class UIFormLayout

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

public class UIFormLayout
extends UILayout<IFormLayout,IFormLayout.IConstraints>
implements IFormLayout

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


Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.rad.ui.layout.IFormLayout
IFormLayout.IAnchor, IFormLayout.IConstraints
 
Field Summary
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Fields inherited from interface javax.rad.ui.layout.IFormLayout
NEWLINE
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
UIFormLayout()
          Creates a new instance of UIFormLayout.
UIFormLayout(IFormLayout pLayout)
          Creates a new instance of UIFormLayout with the given layout.
 
Method Summary
 IFormLayout.IAnchor createAnchor(IFormLayout.IAnchor pRelatedAnchor)
          Constructs an anchor relative to pRelatedAnchor auto sized.
 IFormLayout.IAnchor createAnchor(IFormLayout.IAnchor pRelatedAnchor, IFormLayout.IAnchor pSecondRelatedAnchor, float pRelativePosition)
          Constructs an centered anchor between the related and second related anchor.
 IFormLayout.IAnchor createAnchor(IFormLayout.IAnchor pRelatedAnchor, int pPosition)
          Constructs an anchor relative to pRelatedAnchor with pPosition pixels.
 String getAnchorConfiguration()
          Gets the anchor configuration for default anchors.
 IFormLayout.IConstraints getBottomAlignedConstraints(int pColumn, int pRow)
          Creates bottom aligned constraints for the given column and row.
 IFormLayout.IConstraints getBottomAlignedConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates bottom aligned constraints for the given column and row.
 IFormLayout.IAnchor getBottomAnchor()
          Returns the bottom border anchor.
 IFormLayout.IAnchor getBottomMarginAnchor()
          Returns the bottom margin border anchor.
 IFormLayout.IConstraints getBottomSpaceConstraints(IComponent pCenterComponent)
          Creates the constraints bottom of the center constraint.
 IFormLayout.IConstraints getCenterConstraints(int pColumn, int pRow)
          Creates horizontal and vertical centered constraints for the given column and row.
 IFormLayout.IConstraints getCenterConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates horizontal and vertical centered constraints for the given column and row.
 IFormLayout.IAnchor getColumnLeftAnchor(int pColumnIndex)
          Gets the left anchor of the given column.
 IFormLayout.IAnchor getColumnRightAnchor(int pColumnIndex)
          Gets the right anchor of the given column.
 IFormLayout.IConstraints getConstraints(IFormLayout.IAnchor pTopAnchor, IFormLayout.IAnchor pLeftAnchor, IFormLayout.IAnchor pBottomAnchor, IFormLayout.IAnchor pRightAnchor)
          Creates the default constraints for the given anchors.
 IFormLayout.IConstraints getConstraints(int pColumn, int pRow)
          Creates the default constraints for the given column and row.
 IFormLayout.IConstraints getConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates the default constraints for the given column and row.
 IFormLayout.IConstraints getHCenterConstraints(int pColumn, int pRow)
          Creates vertical centered constraints for the given column and row.
 IFormLayout.IConstraints getHCenterConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates vertical centered constraints for the given column and row.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 IFormLayout.IAnchor[] getHorizontalAnchors()
          Returns all horizontal anchors used by this layout.
 IFormLayout.IConstraints getLeftAlignedConstraints(int pColumn, int pRow)
          Creates left aligned constraints for the given column and row.
 IFormLayout.IConstraints getLeftAlignedConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates left aligned constraints for the given column and row.
 IFormLayout.IAnchor getLeftAnchor()
          Returns the left border anchor.
 IFormLayout.IAnchor getLeftMarginAnchor()
          Returns the left margin border anchor.
 IFormLayout.IConstraints getLeftSpaceConstraints(IComponent pCenterComponent)
          Creates the constraints left of the center constraint.
 IFormLayout.IConstraints getMaximizedConstraints()
          Creates maximized constraints for top, left, bottom and right anchor.
 int getNewlineCount()
          Gets the new line count.
 IFormLayout.IConstraints getRightAlignedConstraints(int pColumn, int pRow)
          Creates right aligned constraints for the given column and row.
 IFormLayout.IConstraints getRightAlignedConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates right aligned constraints for the given column and row.
 IFormLayout.IAnchor getRightAnchor()
          Returns the right border anchor.
 IFormLayout.IAnchor getRightMarginAnchor()
          Returns the right margin border anchor.
 IFormLayout.IConstraints getRightSpaceConstraints(IComponent pCenterComponent)
          Creates the constraints right of the center constraint.
 IFormLayout.IAnchor getRowBottomAnchor(int pRowIndex)
          Gets the bottom anchor of the given row.
 IFormLayout.IAnchor getRowTopAnchor(int pRowIndex)
          Gets the top anchor of the given row.
 IFormLayout.IConstraints getTopAlignedConstraints(int pColumn, int pRow)
          Creates top aligned constraints for the given column and row.
 IFormLayout.IConstraints getTopAlignedConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates top aligned constraints for the given column and row.
 IFormLayout.IAnchor getTopAnchor()
          Returns the top border anchor.
 IFormLayout.IAnchor getTopMarginAnchor()
          Returns the top margin border anchor.
 IFormLayout.IConstraints getTopSpaceConstraints(IComponent pCenterComponent)
          Creates the constraints top of the center constraint.
 IFormLayout.IConstraints getVCenterConstraints(int pColumn, int pRow)
          Creates vertical centered constraints for the given column and row.
 IFormLayout.IConstraints getVCenterConstraints(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates vertical centered constraints for the given column and row.
 int getVerticalAlignment()
          Returns the alignment along the y axis.
 IFormLayout.IAnchor[] getVerticalAnchors()
          Returns all vertical anchors used by this layout.
 void setAnchorConfiguration(String pAnchorConfiguration)
          Sets the anchor configuration for default anchors.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setNewlineCount(int pNewlineCount)
          Sets the new line count.
 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, getResource, getUIResource, hashCode, 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

UIFormLayout

public UIFormLayout()
Creates a new instance of UIFormLayout.

See Also:
IFormLayout

UIFormLayout

public UIFormLayout(IFormLayout pLayout)
Creates a new instance of UIFormLayout with the given layout.

Parameters:
pLayout - the layout
See Also:
IFormLayout
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

getNewlineCount

public int getNewlineCount()
Gets the new line count.

Specified by:
getNewlineCount in interface IFormLayout
Returns:
the new line count.

setNewlineCount

public void setNewlineCount(int pNewlineCount)
Sets the new line count.

Specified by:
setNewlineCount in interface IFormLayout
Parameters:
pNewlineCount - the new line count.

getLeftAnchor

public IFormLayout.IAnchor getLeftAnchor()
Returns the left border anchor.

Specified by:
getLeftAnchor in interface IFormLayout
Returns:
the left border anchor.

getRightAnchor

public IFormLayout.IAnchor getRightAnchor()
Returns the right border anchor.

Specified by:
getRightAnchor in interface IFormLayout
Returns:
the right border anchor.

getTopAnchor

public IFormLayout.IAnchor getTopAnchor()
Returns the top border anchor.

Specified by:
getTopAnchor in interface IFormLayout
Returns:
the top border anchor.

getBottomAnchor

public IFormLayout.IAnchor getBottomAnchor()
Returns the bottom border anchor.

Specified by:
getBottomAnchor in interface IFormLayout
Returns:
the bottom border anchor.

getLeftMarginAnchor

public IFormLayout.IAnchor getLeftMarginAnchor()
Returns the left margin border anchor.

Specified by:
getLeftMarginAnchor in interface IFormLayout
Returns:
the left margin border anchor.

getRightMarginAnchor

public IFormLayout.IAnchor getRightMarginAnchor()
Returns the right margin border anchor.

Specified by:
getRightMarginAnchor in interface IFormLayout
Returns:
the right margin border anchor.

getTopMarginAnchor

public IFormLayout.IAnchor getTopMarginAnchor()
Returns the top margin border anchor.

Specified by:
getTopMarginAnchor in interface IFormLayout
Returns:
the top margin border anchor.

getBottomMarginAnchor

public IFormLayout.IAnchor getBottomMarginAnchor()
Returns the bottom margin border anchor.

Specified by:
getBottomMarginAnchor in interface IFormLayout
Returns:
the bottom margin border anchor.

getHorizontalAnchors

public IFormLayout.IAnchor[] getHorizontalAnchors()
Returns all horizontal anchors used by this layout.

Specified by:
getHorizontalAnchors in interface IFormLayout
Returns:
all horizontal anchors used by this layout.

getVerticalAnchors

public IFormLayout.IAnchor[] getVerticalAnchors()
Returns all vertical anchors used by this layout.

Specified by:
getVerticalAnchors in interface IFormLayout
Returns:
all vertical anchors used by this layout.

createAnchor

public IFormLayout.IAnchor createAnchor(IFormLayout.IAnchor pRelatedAnchor)
Constructs an anchor relative to pRelatedAnchor auto sized.

Specified by:
createAnchor in interface IFormLayout
Parameters:
pRelatedAnchor - the related anchor for this anchor.
Returns:
the anchor.

createAnchor

public IFormLayout.IAnchor createAnchor(IFormLayout.IAnchor pRelatedAnchor,
                                        int pPosition)
Constructs an anchor relative to pRelatedAnchor with pPosition pixels.

Specified by:
createAnchor in interface IFormLayout
Parameters:
pRelatedAnchor - the related anchor for this anchor.
pPosition - the position relative to the related anchor.
Returns:
the anchor.

createAnchor

public IFormLayout.IAnchor createAnchor(IFormLayout.IAnchor pRelatedAnchor,
                                        IFormLayout.IAnchor pSecondRelatedAnchor,
                                        float pRelativePosition)
Constructs an centered anchor between the related and second related anchor.

Specified by:
createAnchor in interface IFormLayout
Parameters:
pRelatedAnchor - the related anchor for this anchor.
pSecondRelatedAnchor - the second related anchor for this anchor.
pRelativePosition - the relative position between first and second anchor.
Returns:
the anchor.

getConstraints

public IFormLayout.IConstraints getConstraints(int pColumn,
                                               int pRow)
Creates the default constraints for the given column and row. Negative columns or rows counts the columns from the right or bottom border.

Specified by:
getConstraints in interface IFormLayout
Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getConstraints

public IFormLayout.IConstraints getConstraints(int pBeginColumn,
                                               int pBeginRow,
                                               int pEndColumn,
                                               int pEndRow)
Creates the default constraints for the given column and row.

Specified by:
getConstraints in interface IFormLayout
Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column count.
pEndRow - the row count.
Returns:
the constraints for the given column and row.

getConstraints

public IFormLayout.IConstraints getConstraints(IFormLayout.IAnchor pTopAnchor,
                                               IFormLayout.IAnchor pLeftAnchor,
                                               IFormLayout.IAnchor pBottomAnchor,
                                               IFormLayout.IAnchor pRightAnchor)
Creates the default constraints for the given anchors.

Specified by:
getConstraints in interface IFormLayout
Parameters:
pTopAnchor - the top anchor.
pLeftAnchor - the left anchor.
pBottomAnchor - the bottom anchor.
pRightAnchor - the right anchor.
Returns:
the constraints for the given Anchors.

getColumnLeftAnchor

public IFormLayout.IAnchor getColumnLeftAnchor(int pColumnIndex)
Gets the left anchor of the given column.

Parameters:
pColumnIndex - the column index.
Returns:
the left IAnchor

getColumnRightAnchor

public IFormLayout.IAnchor getColumnRightAnchor(int pColumnIndex)
Gets the right anchor of the given column.

Parameters:
pColumnIndex - the column index.
Returns:
the right IAnchor

getRowTopAnchor

public IFormLayout.IAnchor getRowTopAnchor(int pRowIndex)
Gets the top anchor of the given row.

Parameters:
pRowIndex - the row index.
Returns:
the top IAnchor

getRowBottomAnchor

public IFormLayout.IAnchor getRowBottomAnchor(int pRowIndex)
Gets the bottom anchor of the given row.

Parameters:
pRowIndex - the row index.
Returns:
the bottom IAnchor

getAnchorConfiguration

public String getAnchorConfiguration()
Gets the anchor configuration for default anchors.

Returns:
the anchor configuration for default anchors.

setAnchorConfiguration

public void setAnchorConfiguration(String pAnchorConfiguration)
Sets the anchor configuration for default anchors.

Parameters:
pAnchorConfiguration - the anchor configuration for default anchors.

getVCenterConstraints

public IFormLayout.IConstraints getVCenterConstraints(int pColumn,
                                                      int pRow)
Creates vertical centered constraints for the given column and row.

Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getVCenterConstraints

public IFormLayout.IConstraints getVCenterConstraints(int pBeginColumn,
                                                      int pBeginRow,
                                                      int pEndColumn,
                                                      int pEndRow)
Creates vertical centered constraints for the given column and row.

Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column count.
pEndRow - the row count.
Returns:
the constraints for the given column and row.

getHCenterConstraints

public IFormLayout.IConstraints getHCenterConstraints(int pColumn,
                                                      int pRow)
Creates vertical centered constraints for the given column and row.

Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getHCenterConstraints

public IFormLayout.IConstraints getHCenterConstraints(int pBeginColumn,
                                                      int pBeginRow,
                                                      int pEndColumn,
                                                      int pEndRow)
Creates vertical centered constraints for the given column and row.

Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column count.
pEndRow - the row count.
Returns:
the constraints for the given column and row.

getCenterConstraints

public IFormLayout.IConstraints getCenterConstraints(int pColumn,
                                                     int pRow)
Creates horizontal and vertical centered constraints for the given column and row.

Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getCenterConstraints

public IFormLayout.IConstraints getCenterConstraints(int pBeginColumn,
                                                     int pBeginRow,
                                                     int pEndColumn,
                                                     int pEndRow)
Creates horizontal and vertical centered constraints for the given column and row.

Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column count.
pEndRow - the row count.
Returns:
the constraints for the given column and row.

getLeftSpaceConstraints

public IFormLayout.IConstraints getLeftSpaceConstraints(IComponent pCenterComponent)
Creates the constraints left of the center constraint.

Parameters:
pCenterComponent - the center component.
Returns:
the constraints left of the center constraint.

getRightSpaceConstraints

public IFormLayout.IConstraints getRightSpaceConstraints(IComponent pCenterComponent)
Creates the constraints right of the center constraint.

Parameters:
pCenterComponent - the center component.
Returns:
the constraints right of the center constraint.

getTopSpaceConstraints

public IFormLayout.IConstraints getTopSpaceConstraints(IComponent pCenterComponent)
Creates the constraints top of the center constraint.

Parameters:
pCenterComponent - the center component.
Returns:
the constraints top of the center constraint.

getBottomSpaceConstraints

public IFormLayout.IConstraints getBottomSpaceConstraints(IComponent pCenterComponent)
Creates the constraints bottom of the center constraint.

Parameters:
pCenterComponent - the center component.
Returns:
the constraints bottom of the center constraint.

getTopAlignedConstraints

public IFormLayout.IConstraints getTopAlignedConstraints(int pColumn,
                                                         int pRow)
Creates top aligned constraints for the given column and row.

Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getTopAlignedConstraints

public IFormLayout.IConstraints getTopAlignedConstraints(int pBeginColumn,
                                                         int pBeginRow,
                                                         int pEndColumn,
                                                         int pEndRow)
Creates top aligned constraints for the given column and row.

Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column.
pEndRow - the row.
Returns:
the constraints for the given column and row.

getBottomAlignedConstraints

public IFormLayout.IConstraints getBottomAlignedConstraints(int pColumn,
                                                            int pRow)
Creates bottom aligned constraints for the given column and row.

Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getBottomAlignedConstraints

public IFormLayout.IConstraints getBottomAlignedConstraints(int pBeginColumn,
                                                            int pBeginRow,
                                                            int pEndColumn,
                                                            int pEndRow)
Creates bottom aligned constraints for the given column and row.

Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column.
pEndRow - the row.
Returns:
the constraints for the given column and row.

getLeftAlignedConstraints

public IFormLayout.IConstraints getLeftAlignedConstraints(int pColumn,
                                                          int pRow)
Creates left aligned constraints for the given column and row.

Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getLeftAlignedConstraints

public IFormLayout.IConstraints getLeftAlignedConstraints(int pBeginColumn,
                                                          int pBeginRow,
                                                          int pEndColumn,
                                                          int pEndRow)
Creates left aligned constraints for the given column and row.

Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column.
pEndRow - the row.
Returns:
the constraints for the given column and row.

getRightAlignedConstraints

public IFormLayout.IConstraints getRightAlignedConstraints(int pColumn,
                                                           int pRow)
Creates right aligned constraints for the given column and row.

Parameters:
pColumn - the column.
pRow - the row.
Returns:
the constraints for the given column and row.

getRightAlignedConstraints

public IFormLayout.IConstraints getRightAlignedConstraints(int pBeginColumn,
                                                           int pBeginRow,
                                                           int pEndColumn,
                                                           int pEndRow)
Creates right aligned constraints for the given column and row.

Parameters:
pBeginColumn - the column.
pBeginRow - the row.
pEndColumn - the column.
pEndRow - the row.
Returns:
the constraints for the given column and row.

getMaximizedConstraints

public IFormLayout.IConstraints getMaximizedConstraints()
Creates maximized constraints for top, left, bottom and right anchor.

Returns:
the maximized constraints.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.