com.sibvisions.rad.ui.web.impl.layout
Class WebFormLayout.WebAnchor

java.lang.Object
  extended by com.sibvisions.rad.ui.web.impl.WebResource
      extended by com.sibvisions.rad.ui.web.impl.layout.WebFormLayout.WebAnchor
All Implemented Interfaces:
IResource, IFormLayout.IAnchor
Enclosing class:
WebFormLayout

public static class WebFormLayout.WebAnchor
extends WebResource
implements IFormLayout.IAnchor

The WebAnchor gives the possible horizontal and vertical positions.


Field Summary
 
Fields inherited from interface javax.rad.ui.layout.IFormLayout.IAnchor
HORIZONTAL, VERTICAL
 
Constructor Summary
  WebFormLayout.WebAnchor(WebFormLayout.WebAnchor pRelatedAnchor)
          Constructs an anchor relative to pRelatedAnchor with pPosition pixels.
  WebFormLayout.WebAnchor(WebFormLayout.WebAnchor pRelatedAnchor, int pPosition)
          Constructs an anchor relative to pRelatedAnchor with pPosition pixels.
  WebFormLayout.WebAnchor(WebFormLayout.WebAnchor pRelatedAnchor, WebFormLayout.WebAnchor pSecondRelatedAnchor, float pRelativePosition)
          Constructs an centered anchor between the related and second related anchor.
protected WebFormLayout.WebAnchor(WebFormLayout pLayout, int pOrientation, String pName)
          Constructs a border anchor for this layout.
 
Method Summary
 int getAbsolutePosition()
          Returns the absolute position of this Anchor in this FormLayout.
 String getAsString()
          Gets this Object as String.
 WebFormLayout 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.
 WebFormLayout.WebAnchor getRelatedAnchor()
          Returns the related Anchor.
 float getRelativePosition()
          Returns the position of this Anchor.
 IFormLayout.IAnchor getSecondRelatedAnchor()
          Returns the second related Anchor.
 boolean isAutoSize()
          Returns true, if the position of this anchor is calculated automatically.
 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 setRelativePosition(float pRelativePosition)
          Sets the position of this Anchor.
 
Methods inherited from class com.sibvisions.rad.ui.web.impl.WebResource
getNullableAsString, getResource, setAsString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

WebFormLayout.WebAnchor

protected WebFormLayout.WebAnchor(WebFormLayout pLayout,
                                  int pOrientation,
                                  String pName)
Constructs a border anchor for this layout.

Parameters:
pLayout - the layout.
pOrientation - the orientation.
pName - the anchor name.

WebFormLayout.WebAnchor

public WebFormLayout.WebAnchor(WebFormLayout.WebAnchor pRelatedAnchor)
Constructs an anchor relative to pRelatedAnchor with pPosition pixels.

Parameters:
pRelatedAnchor - the related anchor for this anchor.

WebFormLayout.WebAnchor

public WebFormLayout.WebAnchor(WebFormLayout.WebAnchor 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.

WebFormLayout.WebAnchor

public WebFormLayout.WebAnchor(WebFormLayout.WebAnchor pRelatedAnchor,
                               WebFormLayout.WebAnchor 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.
Method Detail

getAsString

public String getAsString()
Gets this Object as String.

Specified by:
getAsString in class WebResource
Returns:
the String.

getLayout

public WebFormLayout getLayout()
Returns the layout to which this anchor belongs.

Specified by:
getLayout in interface IFormLayout.IAnchor
Returns:
the orientation.

getOrientation

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

Specified by:
getOrientation in interface IFormLayout.IAnchor
Returns:
the orientation.

getRelatedAnchor

public WebFormLayout.WebAnchor getRelatedAnchor()
Returns the related Anchor.

Specified by:
getRelatedAnchor in interface IFormLayout.IAnchor
Returns:
the relatedAnchor.

isAutoSize

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

Specified by:
isAutoSize in interface IFormLayout.IAnchor
Returns:
the fixed.

setAutoSize

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

Specified by:
setAutoSize in interface IFormLayout.IAnchor
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.

Specified by:
getPosition in interface IFormLayout.IAnchor
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.

Specified by:
setPosition in interface IFormLayout.IAnchor
Parameters:
pPosition - the position to set

getSecondRelatedAnchor

public IFormLayout.IAnchor 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.

Specified by:
getSecondRelatedAnchor in interface IFormLayout.IAnchor
Returns:
the secondRelatedAnchor.

getRelativePosition

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

Specified by:
getRelativePosition in interface IFormLayout.IAnchor
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.

Specified by:
setRelativePosition in interface IFormLayout.IAnchor
Parameters:
pRelativePosition - the relative position

getAbsolutePosition

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

Specified by:
getAbsolutePosition in interface IFormLayout.IAnchor
Returns:
the absolute position.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.