Package org.eclipse.gef.mvc.fx.models
Class SnappingModel.SnappingLocation
- java.lang.Object
-
- org.eclipse.gef.mvc.fx.models.SnappingModel.SnappingLocation
-
- Enclosing class:
- SnappingModel
public static class SnappingModel.SnappingLocation extends java.lang.Object
ASnappingModel.SnappingLocation
combines anIContentPart
, a position coordinate in the scene coordinate system, and anOrientation
. The position coordinate is evaluated in dependence of the location'sOrientation
. For horizontal locations, the position coordinate is a y-coordinate. For vertical locations, the position coordinate is an x-coordinate.
-
-
Constructor Summary
Constructors Constructor Description SnappingLocation(IContentPart<? extends javafx.scene.Node> part, javafx.geometry.Orientation orientation, double positionInScene)
Constructs a newSnappingModel.SnappingLocation
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
SnappingModel.SnappingLocation
getCopy()
Returns a copy of thisSnappingModel.SnappingLocation
.javafx.geometry.Orientation
getOrientation()
Returns theOrientation
of thisSnappingModel.SnappingLocation
.IContentPart<? extends javafx.scene.Node>
getPart()
Returns theIContentPart
from which thisSnappingModel.SnappingLocation
was derived.double
getPositionInScene()
Returns the position coordinate of thisSnappingModel.SnappingLocation
.int
hashCode()
void
setOrientation(javafx.geometry.Orientation orientation)
Sets theOrientation
of thisSnappingModel.SnappingLocation
to the given value.void
setPart(IContentPart<? extends javafx.scene.Node> part)
Sets theIContentPart
of thisSnappingModel.SnappingLocation
to the given value.void
setPositionInScene(double positionInScene)
Sets the position coordinate of thisSnappingModel.SnappingLocation
to the given value.java.lang.String
toString()
-
-
-
Constructor Detail
-
SnappingLocation
public SnappingLocation(IContentPart<? extends javafx.scene.Node> part, javafx.geometry.Orientation orientation, double positionInScene)
Constructs a newSnappingModel.SnappingLocation
.- Parameters:
part
- TheIContentPart
from which this location is derived.orientation
- TheOrientation
for thisSnappingModel.SnappingLocation
.positionInScene
- The position coordinate for thisSnappingModel.SnappingLocation
. The coordinate is either the x- or y-coordinate, depending on theOrientation
. For horizontal locations, the y-coordinate needs to be specified. For vertical locations, the x-coordinate needs to be specified.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
getCopy
public SnappingModel.SnappingLocation getCopy()
Returns a copy of thisSnappingModel.SnappingLocation
.- Returns:
- A copy of this
SnappingModel.SnappingLocation
.
-
getOrientation
public javafx.geometry.Orientation getOrientation()
Returns theOrientation
of thisSnappingModel.SnappingLocation
.- Returns:
- The
Orientation
of thisSnappingModel.SnappingLocation
.
-
getPart
public IContentPart<? extends javafx.scene.Node> getPart()
Returns theIContentPart
from which thisSnappingModel.SnappingLocation
was derived.- Returns:
- The
IContentPart
from which thisSnappingModel.SnappingLocation
was derived.
-
getPositionInScene
public double getPositionInScene()
Returns the position coordinate of thisSnappingModel.SnappingLocation
.- Returns:
- The position coordinate of this
SnappingModel.SnappingLocation
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
setOrientation
public void setOrientation(javafx.geometry.Orientation orientation)
Sets theOrientation
of thisSnappingModel.SnappingLocation
to the given value.- Parameters:
orientation
- The newOrientation
for thisSnappingModel.SnappingLocation
.
-
setPart
public void setPart(IContentPart<? extends javafx.scene.Node> part)
Sets theIContentPart
of thisSnappingModel.SnappingLocation
to the given value.- Parameters:
part
- The newIContentPart
for thisSnappingModel.SnappingLocation
.
-
setPositionInScene
public void setPositionInScene(double positionInScene)
Sets the position coordinate of thisSnappingModel.SnappingLocation
to the given value.- Parameters:
positionInScene
- The new position coordinate for thisSnappingModel.SnappingLocation
.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-