org.jhotdraw.draw.locator
Class RelativeLocator
- java.lang.Object
-
- org.jhotdraw.draw.locator.AbstractLocator
-
- org.jhotdraw.draw.locator.RelativeLocator
-
- All Implemented Interfaces:
- java.io.Serializable, Locator, DOMStorable
- Direct Known Subclasses:
- RelativeDecoratorLocator
public class RelativeLocator extends AbstractLocator
A locator that specfies a point that is relative to the bounds of a figure.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RelativeLocator()Creates a new instance.RelativeLocator(double relativeX, double relativeY)Creates a new instance.RelativeLocator(double relativeX, double relativeY, boolean isTransform)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static Locatorcenter()Non-transforming Center.static Locatorcenter(boolean isTransform)Center.static Locatoreast()Non-transforming East.static Locatoreast(boolean isTransform)East.booleanequals(java.lang.Object obj)inthashCode()java.awt.geom.Point2D.Doublelocate(Figure owner)Locates a position on the provided figure.static Locatornorth()Non-transforming North.static Locatornorth(boolean isTransform)North.static LocatornorthEast()Non-transforming North east.static LocatornorthEast(boolean isTransform)Norht East.static LocatornorthWest()Non-transforming North west.static LocatornorthWest(boolean isTransform)North West.voidread(DOMInput in)static Locatorsouth()Non-transforming South.static Locatorsouth(boolean isTransform)South.static LocatorsouthEast()Non-transforming South east.static LocatorsouthEast(boolean isTransform)South East.static LocatorsouthWest()Non-transforming South west.static LocatorsouthWest(boolean isTransform)South West.static Locatorwest()Non-transforming West.static Locatorwest(boolean isTransform)West.voidwrite(DOMOutput out)-
Methods inherited from class org.jhotdraw.draw.locator.AbstractLocator
locate
-
-
-
-
Constructor Detail
-
RelativeLocator
public RelativeLocator()
Creates a new instance.
-
RelativeLocator
public RelativeLocator(double relativeX, double relativeY)Creates a new instance.
-
RelativeLocator
public RelativeLocator(double relativeX, double relativeY, boolean isTransform)- Parameters:
relativeX- x-position relative to bounds expressed as a value between 0 and 1.relativeY- y-position relative to bounds expressed as a value between 0 and 1.isTransform- Set this to true, if the locator shall honor the TRANSFORM attribute of the Figure.
-
-
Method Detail
-
locate
public java.awt.geom.Point2D.Double locate(Figure owner)
Description copied from interface:LocatorLocates a position on the provided figure.- Returns:
- a point on the figure.
-
east
public static Locator east()
Non-transforming East.
-
east
public static Locator east(boolean isTransform)
East.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
north
public static Locator north()
Non-transforming North.
-
north
public static Locator north(boolean isTransform)
North.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
west
public static Locator west()
Non-transforming West.
-
west
public static Locator west(boolean isTransform)
West.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
northEast
public static Locator northEast()
Non-transforming North east.
-
northEast
public static Locator northEast(boolean isTransform)
Norht East.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
northWest
public static Locator northWest()
Non-transforming North west.
-
northWest
public static Locator northWest(boolean isTransform)
North West.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
south
public static Locator south()
Non-transforming South.
-
south
public static Locator south(boolean isTransform)
South.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
southEast
public static Locator southEast()
Non-transforming South east.
-
southEast
public static Locator southEast(boolean isTransform)
South East.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
southWest
public static Locator southWest()
Non-transforming South west.
-
southWest
public static Locator southWest(boolean isTransform)
South West.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
center
public static Locator center()
Non-transforming Center.
-
center
public static Locator center(boolean isTransform)
Center.- Parameters:
isTransform- Set this to true, if RelativeLocator shall honour the AttributesKey.TRANSFORM attribute of the Figure.
-
write
public void write(DOMOutput out)
-
read
public void read(DOMInput in)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG