Package org.eclipse.gef.requests
Class ChangeBoundsRequest
java.lang.Object
org.eclipse.gef.Request
org.eclipse.gef.requests.GroupRequest
org.eclipse.gef.requests.ChangeBoundsRequest
- All Implemented Interfaces:
DropRequest
- Direct Known Subclasses:
AlignmentRequest
A Request to change the bounds of the EditPart(s).
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ChangeBoundsRequest
(Object type) Creates a ChangeBoundsRequest with the given type. -
Method Summary
Modifier and TypeMethodDescriptionReturns the location of the mouse pointer.Deprecated.Returns a Point representing the distance the EditPart has moved.int
Returns the direction the figure is being resized.Returns a Dimension representing how much the EditPart has been resized.Transforms a copy of the passed in rectangle to account for the move and/or resize deltas and returns this copy.boolean
Returns true if the request is for a centered resize.boolean
Returnstrue
if the request is for a constrained moveboolean
Returnstrue
if the request is for a constrained resizeboolean
Returnstrue
if snap-to is enabledvoid
setCenteredResize
(boolean value) Used to set whether a centered resize is being performed.void
setConstrainedMove
(boolean value) Used to set whether a constrained move is being performed.void
setConstrainedResize
(boolean value) Used to set whether a constrained resize is being performed.void
setLocation
(Point p) Sets the location of the mouse pointer.void
Deprecated.void
Sets the move delta.void
setResizeDirection
(int dir) Sets the direction the figure is being resized.void
Sets the size delta.void
setSnapToEnabled
(boolean value) Used to set whether snap-to is being performed.Methods inherited from class org.eclipse.gef.requests.GroupRequest
getEditParts, setEditParts, setEditParts
Methods inherited from class org.eclipse.gef.Request
getExtendedData, getType, setExtendedData, setType
-
Constructor Details
-
ChangeBoundsRequest
public ChangeBoundsRequest()Default constructor. -
ChangeBoundsRequest
Creates a ChangeBoundsRequest with the given type.- Parameters:
type
- The type of Request.
-
-
Method Details
-
getLocation
Returns the location of the mouse pointer.- Specified by:
getLocation
in interfaceDropRequest
- Returns:
- The location of the mouse pointer.
-
getMouseLocation
Deprecated.UsegetLocation()
- Returns:
- The location of the mouse pointer.
-
getMoveDelta
Returns a Point representing the distance the EditPart has moved.- Returns:
- A Point representing the distance the EditPart has moved.
-
getResizeDirection
public int getResizeDirection()Returns the direction the figure is being resized. Possible values are- Returns:
- the resize direction
-
getSizeDelta
Returns a Dimension representing how much the EditPart has been resized.- Returns:
- A Dimension representing how much the EditPart has been resized.
-
getTransformedRectangle
Transforms a copy of the passed in rectangle to account for the move and/or resize deltas and returns this copy.- Parameters:
rect
- the rectangle to transform- Returns:
- a copy of the passed in rectangle representing the new bounds
-
isCenteredResize
public boolean isCenteredResize()Returns true if the request is for a centered resize.- Returns:
true
if centered resize- Since:
- 3.0
-
isConstrainedMove
public boolean isConstrainedMove()Returnstrue
if the request is for a constrained move- Returns:
true
if a constrained move- Since:
- 3.0
-
isConstrainedResize
public boolean isConstrainedResize()Returnstrue
if the request is for a constrained resize- Returns:
true
if a constrained resize- Since:
- 3.0
-
isSnapToEnabled
public boolean isSnapToEnabled()Returnstrue
if snap-to is enabled- Returns:
true
if the request is for a creation with snap-to enabled- Since:
- 3.7
-
setCenteredResize
public void setCenteredResize(boolean value) Used to set whether a centered resize is being performed.- Parameters:
value
-true
if the request is for a centered resize- Since:
- 3.0
-
setConstrainedMove
public void setConstrainedMove(boolean value) Used to set whether a constrained move is being performed.- Parameters:
value
-true
if the request is for a constrained move- Since:
- 3.0
-
setConstrainedResize
public void setConstrainedResize(boolean value) Used to set whether a constrained resize is being performed.- Parameters:
value
-true
if the request is for a constrained resize- Since:
- 3.0
-
setLocation
Sets the location of the mouse pointer.- Parameters:
p
- The location of the mouse pointer.
-
setMouseLocation
Deprecated.- Parameters:
p
- The location of the mouse pointer.
-
setMoveDelta
Sets the move delta.- Parameters:
p
- The Point representing the move delta
-
setResizeDirection
public void setResizeDirection(int dir) Sets the direction the figure is being resized.- Parameters:
dir
- the direction of the resize- See Also:
-
setSizeDelta
Sets the size delta.- Parameters:
d
- The Dimension representing the size delta.
-
setSnapToEnabled
public void setSnapToEnabled(boolean value) Used to set whether snap-to is being performed.- Parameters:
value
-true
if the request is for a creation with snap-to enabled- Since:
- 3.7
-
getLocation()