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

java.lang.Object
  extended by com.sibvisions.rad.ui.swing.ext.layout.JVxFormLayout.Anchor
Enclosing class:
JVxFormLayout

public static class JVxFormLayout.Anchor
extends Object

The Anchor gives the possible horizontal and vertical positions.


Field Summary
static int HORIZONTAL
          Constant for horizontal anchors.
static int VERTICAL
          Constant for vertical anchors.
 
Constructor Summary
JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor)
          Constructs an anchor relative to pRelatedAnchor auto sized.
JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor, int pPosition)
          Constructs an anchor relative to pRelatedAnchor with pPosition pixels.
JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor, JVxFormLayout.Anchor pSecondRelatedAnchor)
          Constructs an centered anchor between the related and second related anchor.
JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor, JVxFormLayout.Anchor pSecondRelatedAnchor, float pRelativePosition)
          Constructs an centered anchor between the related and second related anchor.
 
Method Summary
 int getAbsolutePosition()
          Returns the absolute position of this Anchor in this FormLayout.
 JVxFormLayout.Anchor getBorderAnchor()
          Gets the related border anchor to this anchor.
 JVxFormLayout getLayout()
          Returns the Layout to which this Anchor belongs.
 int getOrientation()
          Returns whether the orientation of this Anchor is HORIZONTAL or VERTICAL.
 int getPosition()
          Returns the position of this Anchor.
 JVxFormLayout.Anchor getRelatedAnchor()
          Returns the related Anchor.
 JVxFormLayout.Anchor getRelativeAnchor()
          Gets the related unused auto size anchor.
 float getRelativePosition()
          Returns the position of this Anchor.
 JVxFormLayout.Anchor getSecondRelatedAnchor()
          Returns the second related Anchor.
 boolean isAutoSize()
          Returns true, if the position of this anchor is calculated automatically.
 boolean isBorderAnchor()
          Returns true, if this anchor is the border anchor.
 boolean isRelative()
          true, if the anchor is relative.
 void setAutoSize(boolean pAutoSize)
          Sets, if the position of this anchor is calculated automatically.
 void setPosition(int pPosition)
          Sets the position of this Anchor.
 void setRelatedAnchor(JVxFormLayout.Anchor pRelatedAnchor)
          Sets the related Anchor.
 void setRelativePosition(float pRelativePosition)
          Sets the position of this Anchor.
 void setSecondRelatedAnchor(JVxFormLayout.Anchor pSecondRelatedAnchor)
          Sets the seocnd related Anchor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
Constant for horizontal anchors.

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
Constant for vertical anchors.

See Also:
Constant Field Values
Constructor Detail

JVxFormLayout.Anchor

public JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor)
Constructs an anchor relative to pRelatedAnchor auto sized.

Parameters:
pRelatedAnchor - the related anchor for this anchor.

JVxFormLayout.Anchor

public JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor,
                            int pPosition)
Constructs an anchor relative to pRelatedAnchor with pPosition pixels.

Parameters:
pRelatedAnchor - the related anchor for this anchor.
pPosition - the position relative to the related anchor.

JVxFormLayout.Anchor

public JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor,
                            JVxFormLayout.Anchor pSecondRelatedAnchor,
                            float pRelativePosition)
Constructs an centered anchor between the related and second related anchor.

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.

JVxFormLayout.Anchor

public JVxFormLayout.Anchor(JVxFormLayout.Anchor pRelatedAnchor,
                            JVxFormLayout.Anchor pSecondRelatedAnchor)
Constructs an centered anchor between the related and second related anchor.

Parameters:
pRelatedAnchor - the related anchor for this anchor.
pSecondRelatedAnchor - the second related anchor for this anchor.
Method Detail

getLayout

public JVxFormLayout getLayout()
Returns the Layout to which this Anchor belongs.

Returns:
the layout.

getOrientation

public int getOrientation()
Returns whether the orientation of this Anchor is HORIZONTAL or VERTICAL.

Returns:
the orientation.

isBorderAnchor

public boolean isBorderAnchor()
Returns true, if this anchor is the border anchor.

Returns:
the fixed.

getRelatedAnchor

public JVxFormLayout.Anchor getRelatedAnchor()
Returns the related Anchor.

Returns:
the relatedAnchor.

setRelatedAnchor

public void setRelatedAnchor(JVxFormLayout.Anchor pRelatedAnchor)
Sets the related Anchor. It is only allowed to choose an anchor with same orientation from the same layout.

Parameters:
pRelatedAnchor - the relatedAnchor to set.

getSecondRelatedAnchor

public JVxFormLayout.Anchor getSecondRelatedAnchor()
Returns the second related Anchor. If the second Anchor is not null the autosize and position has no effect. The position of the anchor is only calculated relative to the two related anchors.

Returns:
the secondRelatedAnchor.

setSecondRelatedAnchor

public void setSecondRelatedAnchor(JVxFormLayout.Anchor pSecondRelatedAnchor)
Sets the seocnd related Anchor. It is only allowed to choose an anchor with same orientation from the same layout. If the second Anchor is not null the autosize and position has no effect. The position of the anchor is only calculated relative to the two related anchors.

Parameters:
pSecondRelatedAnchor - the relatedAnchor to set.

getRelativePosition

public float getRelativePosition()
Returns the position of this Anchor. The position is only correct if the layout is valid.

Returns:
the position.

setRelativePosition

public void setRelativePosition(float pRelativePosition)
Sets the position of this Anchor. It is not allowed to set the position of a border anchor.

Parameters:
pRelativePosition - the relative position

isAutoSize

public boolean isAutoSize()
Returns true, if the position of this anchor is calculated automatically.

Returns:
the fixed.

setAutoSize

public void setAutoSize(boolean pAutoSize)
Sets, if the position of this anchor is calculated automatically.

Parameters:
pAutoSize - the fixed to set.

getPosition

public int getPosition()
Returns the position of this Anchor. The position is only correct if the layout is valid.

Returns:
the position.

setPosition

public void setPosition(int pPosition)
Sets the position of this Anchor. It is not allowed to set the position of a border anchor.

Parameters:
pPosition - the position to set

getAbsolutePosition

public int getAbsolutePosition()
Returns the absolute position of this Anchor in this FormLayout. The position is only correct if the layout is valid.

Returns:
the absolute position.

getBorderAnchor

public JVxFormLayout.Anchor getBorderAnchor()
Gets the related border anchor to this anchor.

Returns:
the related border anchor.

isRelative

public boolean isRelative()
true, if the anchor is relative.

Returns:
true, if the anchor is relative.

getRelativeAnchor

public JVxFormLayout.Anchor getRelativeAnchor()
Gets the related unused auto size anchor.

Returns:
the related unused auto size anchor.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.