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

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

public class JVxFormLayout
extends Object
implements LayoutManager2, JVxConstants

The FormLayout is a simple to use Layout which allows complex forms.


Nested Class Summary
static class JVxFormLayout.Anchor
          The Anchor gives the possible horizontal and vertical positions.
static class JVxFormLayout.Constraint
          The Constraint stores the top, left, bottom and right Anchor for layouting a component.
 
Field Summary
static String NEWLINE
          Constraint for starting a new row for the given component.
 
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
JVxFormLayout()
          Constructs a new FormLayout.
 
Method Summary
 void addLayoutComponent(Component pComponent, Object pConstraint)
          
 void addLayoutComponent(String pName, Component pComponent)
          
 JVxFormLayout.Constraint createConstraint(int pColumn, int pRow)
          Creates the default constraints for the given column and row.
 JVxFormLayout.Constraint createConstraint(int pBeginColumn, int pBeginRow, int pEndColumn, int pEndRow)
          Creates the default constraints for the given column and row.
 JVxFormLayout.Anchor getBottomAnchor()
          Returns the bottom border anchor.
 JVxFormLayout.Anchor getBottomMarginAnchor()
          Returns the bottom margin border anchor.
 JVxFormLayout.Constraint getConstraint(Component pComponent)
          Gets the constraints for given component.
 int getHorizontalAlignment()
          Returns the alignment for the x axis.
 JVxFormLayout.Anchor[] getHorizontalAnchors()
          Returns all horizontal anchors used by this layout.
 int getHorizontalGap()
          Gets the horizontal gap.
 float getLayoutAlignmentX(Container pTarget)
          
 float getLayoutAlignmentY(Container pTarget)
          
 JVxFormLayout.Anchor getLeftAnchor()
          Returns the left border anchor.
 JVxFormLayout.Anchor getLeftMarginAnchor()
          Returns the left margin border anchor.
 Insets getMargins()
          Gets the margins.
 int getNewlineCount()
          Gets the new line count.
 JVxFormLayout.Anchor getRightAnchor()
          Returns the right border anchor.
 JVxFormLayout.Anchor getRightMarginAnchor()
          Returns the right margin border anchor.
 JVxFormLayout.Anchor getTopAnchor()
          Returns the top border anchor.
 JVxFormLayout.Anchor getTopMarginAnchor()
          Returns the top margin border anchor.
 int getVerticalAlignment()
          Gets the alignment for the y axis.
 JVxFormLayout.Anchor[] getVerticalAnchors()
          Returns all vertical anchors used by this layout.
 int getVerticalGap()
          Gets the vertical gap.
 void invalidateLayout(Container pTarget)
          
 void layoutContainer(Container pTarget)
          
 Dimension maximumLayoutSize(Container pTarget)
          
 Dimension minimumLayoutSize(Container pTarget)
          
 Dimension preferredLayoutSize(Container pTarget)
          
 void removeLayoutComponent(Component pComponent)
          
 void setConstraint(Component pComponent, JVxFormLayout.Constraint pConstraint)
          Sets the constraints for given component.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the alignment for the x axis.
 void setHorizontalGap(int pGap)
          Sets the horizontal gap.
 void setMargins(Insets pMargins)
          Sets the margins.
 void setNewlineCount(int pNewlineCount)
          Sets the new line count.
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the alignment for the y axis.
 void setVerticalGap(int pGap)
          Sets the vertical gap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEWLINE

public static final String NEWLINE
Constraint for starting a new row for the given component.

See Also:
Constant Field Values
Constructor Detail

JVxFormLayout

public JVxFormLayout()
Constructs a new FormLayout.

Method Detail

getLayoutAlignmentX

public float getLayoutAlignmentX(Container pTarget)

Specified by:
getLayoutAlignmentX in interface LayoutManager2

getLayoutAlignmentY

public float getLayoutAlignmentY(Container pTarget)

Specified by:
getLayoutAlignmentY in interface LayoutManager2

invalidateLayout

public void invalidateLayout(Container pTarget)

Specified by:
invalidateLayout in interface LayoutManager2

addLayoutComponent

public void addLayoutComponent(Component pComponent,
                               Object pConstraint)

Specified by:
addLayoutComponent in interface LayoutManager2

addLayoutComponent

public void addLayoutComponent(String pName,
                               Component pComponent)

Specified by:
addLayoutComponent in interface LayoutManager

removeLayoutComponent

public void removeLayoutComponent(Component pComponent)

Specified by:
removeLayoutComponent in interface LayoutManager

minimumLayoutSize

public Dimension minimumLayoutSize(Container pTarget)

Specified by:
minimumLayoutSize in interface LayoutManager

preferredLayoutSize

public Dimension preferredLayoutSize(Container pTarget)

Specified by:
preferredLayoutSize in interface LayoutManager

maximumLayoutSize

public Dimension maximumLayoutSize(Container pTarget)

Specified by:
maximumLayoutSize in interface LayoutManager2

layoutContainer

public void layoutContainer(Container pTarget)

Specified by:
layoutContainer in interface LayoutManager

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

getHorizontalGap

public int getHorizontalGap()
Gets the horizontal gap.

Returns:
the horizontal gap.

setHorizontalGap

public void setHorizontalGap(int pGap)
Sets the horizontal gap.

Parameters:
pGap - the horizontal gap.

getVerticalGap

public int getVerticalGap()
Gets the vertical gap.

Returns:
the vertical gap.

setVerticalGap

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

Parameters:
pGap - the vertical gap.

getMargins

public Insets getMargins()
Gets the margins.

Returns:
the margins.

setMargins

public void setMargins(Insets pMargins)
Sets the margins.

Parameters:
pMargins - the margins.

getNewlineCount

public int getNewlineCount()
Gets the new line count.

Returns:
the new line count.

setNewlineCount

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

Parameters:
pNewlineCount - the new line count.

getLeftAnchor

public JVxFormLayout.Anchor getLeftAnchor()
Returns the left border anchor.

Returns:
the left border anchor.

getRightAnchor

public JVxFormLayout.Anchor getRightAnchor()
Returns the right border anchor.

Returns:
the right border anchor.

getTopAnchor

public JVxFormLayout.Anchor getTopAnchor()
Returns the top border anchor.

Returns:
the top border anchor.

getBottomAnchor

public JVxFormLayout.Anchor getBottomAnchor()
Returns the bottom border anchor.

Returns:
the bottom border anchor.

getLeftMarginAnchor

public JVxFormLayout.Anchor getLeftMarginAnchor()
Returns the left margin border anchor.

Returns:
the left margin border anchor.

getRightMarginAnchor

public JVxFormLayout.Anchor getRightMarginAnchor()
Returns the right margin border anchor.

Returns:
the right margin border anchor.

getTopMarginAnchor

public JVxFormLayout.Anchor getTopMarginAnchor()
Returns the top margin border anchor.

Returns:
the top margin border anchor.

getBottomMarginAnchor

public JVxFormLayout.Anchor getBottomMarginAnchor()
Returns the bottom margin border anchor.

Returns:
the bottom margin border anchor.

getHorizontalAnchors

public JVxFormLayout.Anchor[] getHorizontalAnchors()
Returns all horizontal anchors used by this layout.

Returns:
all horizontal anchors used by this layout.

getVerticalAnchors

public JVxFormLayout.Anchor[] getVerticalAnchors()
Returns all vertical anchors used by this layout.

Returns:
all vertical anchors used by this layout.

getConstraint

public JVxFormLayout.Constraint getConstraint(Component pComponent)
Gets the constraints for given component.

Parameters:
pComponent - the component.
Returns:
the constraints for the given component.

setConstraint

public void setConstraint(Component pComponent,
                          JVxFormLayout.Constraint pConstraint)
Sets the constraints for given component.

Parameters:
pComponent - the component.
pConstraint - the constraints for the given component.

createConstraint

public JVxFormLayout.Constraint createConstraint(int pColumn,
                                                 int pRow)
Creates the default constraints for the given column and row.

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

createConstraint

public JVxFormLayout.Constraint createConstraint(int pBeginColumn,
                                                 int pBeginRow,
                                                 int pEndColumn,
                                                 int pEndRow)
Creates the default constraints for the given column and row.

Parameters:
pBeginColumn - the begin column.
pBeginRow - the begin row.
pEndColumn - the end column.
pEndRow - the end row.
Returns:
the constraints for the given component.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.