Class Position
java.lang.Object
com._1c.g5.v8.dt.common.gef.drow2d.Position
The position information: - point - direction - assigned obstacle
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of the rectilinear directions (UP, RIGHT, DOWN, LEFT) -
Method Summary
Modifier and TypeMethodDescriptionstatic Position
create
(org.eclipse.draw2d.geometry.Rectangle obstacle, org.eclipse.draw2d.geometry.Point point) Factory method for create new instance of thePosition
usingpoint
andobstacle
.getCopy()
Gets the directionorg.eclipse.draw2d.geometry.Rectangle
Gets the obstacle: the area assigned with figure - source of the rayorg.eclipse.draw2d.geometry.Point
getPoint()
Gets the pointboolean
Checks, isdirection
not specified or horizontalboolean
Checks, isdirection
not specified or verticalmoveOnDirection
(int length) Shifts the start point by the specifiedlength
using the current direction.toString()
Returns the string in the format: "(<x>,<y>) <direction>"
-
Method Details
-
getPoint
public org.eclipse.draw2d.geometry.Point getPoint()Gets the point- Returns:
- the point
-
getDirection
Gets the direction- Returns:
- the direction
-
getObstacle
public org.eclipse.draw2d.geometry.Rectangle getObstacle()Gets the obstacle: the area assigned with figure - source of the ray- Returns:
- the obstacle: the area assigned with figure - source of the ray
-
isHorizontal
public boolean isHorizontal()Checks, isdirection
not specified or horizontal- Returns:
true
in case direction not specified or horizontal andfalse
otherwise
-
isVertical
public boolean isVertical()Checks, isdirection
not specified or vertical- Returns:
true
in case direction not specified or vertical andfalse
otherwise
-
create
public static Position create(org.eclipse.draw2d.geometry.Rectangle obstacle, org.eclipse.draw2d.geometry.Point point) Factory method for create new instance of thePosition
usingpoint
andobstacle
. Calculates the rectangle side nearest to a point and sets the ray direction to opposite. Ifobstacle
isnull
then Ray with empty direction will created.- Parameters:
obstacle
- the area assigned with figure - source of the raypoint
- the point of ray- Returns:
- new instance of the
Position
-
getCopy
- Returns:
- a copy of this Position
-
moveOnDirection
Shifts the start point by the specifiedlength
using the current direction.- Parameters:
length
- - a length- Returns:
this
for convenience
-
toString
Returns the string in the format: "(<x>,<y>) <direction>"
-