java.lang.Object
org.jhotdraw8.draw.locator.AbstractLocator
org.jhotdraw8.draw.locator.BoundsLocator
- All Implemented Interfaces:
Locator
A locator that specifies a point that is relative to the bounds of a figure.
The locator has the following parameters:
relativeX- Defines a position on the X-axis
of the figure, relative to its width.
Where
0.0lies at the left edge of the figure and1.0at the right edge. relativeY- Defines a position on the Y-axis
of the figure, relative to its height.
Where
0.0lies at the top edge of the figure and1.0at the bottom edge.
- Author:
- Werner Randelshofer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BoundsLocatorstatic final BoundsLocatorstatic final BoundsLocatorstatic final BoundsLocatorstatic final BoundsLocatorprotected final doubleRelative x-coordinate on the bounds of the figure.protected final doubleRelative y-coordinate on the bounds of the figure.static final BoundsLocatorstatic final BoundsLocatorstatic final BoundsLocatorstatic final BoundsLocator -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance.BoundsLocator(double relativeX, double relativeY) Creates a new instance.BoundsLocator(@NonNull javafx.geometry.Bounds bounds, double x, double y) Creates a new instance.BoundsLocator(@NonNull javafx.geometry.Bounds bounds, @NonNull javafx.geometry.Point2D p) Creates a new instance. -
Method Summary
Methods inherited from class org.jhotdraw8.draw.locator.AbstractLocator
locate
-
Field Details
-
CENTER
-
EAST
-
NORTH
-
NORTH_EAST
-
NORTH_WEST
-
SOUTH
-
SOUTH_EAST
-
SOUTH_WEST
-
WEST
-
relativeX
protected final double relativeXRelative x-coordinate on the bounds of the figure. The value 0 is on the left boundary of the figure, the value 1 on the right boundary. -
relativeY
protected final double relativeYRelative y-coordinate on the bounds of the figure. The value 0 is on the top boundary of the figure, the value 1 on the bottom boundary.
-
-
Constructor Details
-
BoundsLocator
public BoundsLocator()Creates a new instance. -
BoundsLocator
public BoundsLocator(double relativeX, double relativeY) Creates a new instance.- 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.
-
BoundsLocator
Creates a new instance.- Parameters:
bounds- current local bounds of a figurep- a local coordinate on the figure
-
BoundsLocator
Creates a new instance.- Parameters:
bounds- current local bounds of a figurex- a local coordinate on the figurey- a local coordinate on the figre
-
-
Method Details
-
getRelativeX
public double getRelativeX() -
getRelativeY
public double getRelativeY() -
locate
Description copied from interface:LocatorLocates a position on the provided figure.- Parameters:
owner- provided figure- Returns:
- a point on the figure in local coordinates.
-
equals
-
hashCode
public int hashCode()
-