com.miginfocom.util.gfx.geometry.links
Class AShapeLinkNumber

java.lang.Object
  extended by com.miginfocom.util.gfx.geometry.links.BoundsLinkNumber
      extended by com.miginfocom.util.gfx.geometry.links.AShapeLinkNumber
All Implemented Interfaces:
AtNumber, AtRefNumber, AtRefRangeNumber, java.io.Serializable

public class AShapeLinkNumber
extends BoundsLinkNumber

A link to some part of the bounds of a AShape.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.miginfocom.util.gfx.geometry.links.BoundsLinkNumber
align, dim, X, Y
 
Constructor Summary
AShapeLinkNumber(AShape aShape, AtRefRangeNumber align, int dim, boolean toRefBounds)
          Constructor for a relative (percentage) value.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 AShape getAShape()
          Returns the shape.
protected  float getHorizontalValue(AtRefRangeNumber align)
          Uses the horizontal start and end value to get the value.
 boolean getToRefBounds()
          Returns if linked to the reference bounds of the AShape.
protected  float getVerticalValue(AtRefRangeNumber align)
          Uses the vertival start and end value to get the value.
 java.lang.String toString()
           
 
Methods inherited from class com.miginfocom.util.gfx.geometry.links.BoundsLinkNumber
getAlign, getDimension, getIntValue, getIntValue, getIntValue, getValue, getValue, getValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AShapeLinkNumber

public AShapeLinkNumber(AShape aShape,
                        AtRefRangeNumber align,
                        int dim,
                        boolean toRefBounds)
Constructor for a relative (percentage) value.

Parameters:
aShape - The AShape which's bounds to link to.
align - If the value that this link represents. Can be relative to the left, right or both bounds edges of the shape. The start and end position in dim will be ussed to get the value.
dim - The dimension. ShapeLinkNumber.X or ShapeLinkNumber.Y.
toRefBounds - If toRefBounds linked to the reference bounds of the AShape. If false it is linked to the actual bounds that the AShape will have (slower).
See Also:
AShape.getReferenceBounds(), AShape.getShapeBounds()
Method Detail

getHorizontalValue

protected float getHorizontalValue(AtRefRangeNumber align)
Description copied from class: BoundsLinkNumber
Uses the horizontal start and end value to get the value.

Specified by:
getHorizontalValue in class BoundsLinkNumber
Parameters:
align - The value to call AtRefRangeNumber.getValue(float, float) on.
Returns:
The value that getValue returns.

getVerticalValue

protected float getVerticalValue(AtRefRangeNumber align)
Description copied from class: BoundsLinkNumber
Uses the vertival start and end value to get the value.

Specified by:
getVerticalValue in class BoundsLinkNumber
Parameters:
align - The value to call AtRefRangeNumber.getValue(float, float) on.
Returns:
The value that getValue returns.

getAShape

public AShape getAShape()
Returns the shape.

Returns:
he shape. Not null.

getToRefBounds

public boolean getToRefBounds()
Returns if linked to the reference bounds of the AShape. If false it is linked to the actual bounds that the AShape will have (slower).

Returns:
If linked to the reference bounds of the AShape.
See Also:
AShape.getReferenceBounds(), AShape.getShapeBounds()

toString

public java.lang.String toString()
Overrides:
toString in class BoundsLinkNumber

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class BoundsLinkNumber


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.