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
public class ChangeBoundsRequest extends GroupRequest implements DropRequest
A Request to change the bounds of the EditPart(s).
-
-
Constructor Summary
Constructors Constructor Description ChangeBoundsRequest()Default constructor.ChangeBoundsRequest(java.lang.Object type)Creates a ChangeBoundsRequest with the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.eclipse.draw2d.geometry.PointgetLocation()Returns the location of the mouse pointer.org.eclipse.draw2d.geometry.PointgetMouseLocation()Deprecated.UsegetLocation()org.eclipse.draw2d.geometry.PointgetMoveDelta()Returns a Point representing the distance the EditPart has moved.intgetResizeDirection()Returns the direction the figure is being resized.org.eclipse.draw2d.geometry.DimensiongetSizeDelta()Returns a Dimension representing how much the EditPart has been resized.org.eclipse.draw2d.geometry.RectanglegetTransformedRectangle(org.eclipse.draw2d.geometry.Rectangle rect)Transforms a copy of the passed in rectangle to account for the move and/or resize deltas and returns this copy.booleanisCenteredResize()Returns true if the request is for a centered resize.booleanisConstrainedMove()Returnstrueif the request is for a constrained movebooleanisConstrainedResize()Returnstrueif the request is for a constrained resizebooleanisSnapToEnabled()Returnstrueif snap-to is enabledvoidsetCenteredResize(boolean value)Used to set whether a centered resize is being performed.voidsetConstrainedMove(boolean value)Used to set whether a constrained move is being performed.voidsetConstrainedResize(boolean value)Used to set whether a constrained resize is being performed.voidsetLocation(org.eclipse.draw2d.geometry.Point p)Sets the location of the mouse pointer.voidsetMouseLocation(org.eclipse.draw2d.geometry.Point p)Deprecated.voidsetMoveDelta(org.eclipse.draw2d.geometry.Point p)Sets the move delta.voidsetResizeDirection(int dir)Sets the direction the figure is being resized.voidsetSizeDelta(org.eclipse.draw2d.geometry.Dimension d)Sets the size delta.voidsetSnapToEnabled(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
-
-
-
-
Method Detail
-
getLocation
public org.eclipse.draw2d.geometry.Point getLocation()
Returns the location of the mouse pointer.- Specified by:
getLocationin interfaceDropRequest- Returns:
- The location of the mouse pointer.
-
getMouseLocation
public org.eclipse.draw2d.geometry.Point getMouseLocation()
Deprecated.UsegetLocation()- Returns:
- The location of the mouse pointer.
-
getMoveDelta
public org.eclipse.draw2d.geometry.Point 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 arePositionConstants.EASTPositionConstants.WESTPositionConstants.NORTHPositionConstants.SOUTHPositionConstants.NORTH_EASTPositionConstants.NORTH_WESTPositionConstants.SOUTH_EASTPositionConstants.SOUTH_WEST
- Returns:
- the resize direction
-
getSizeDelta
public org.eclipse.draw2d.geometry.Dimension getSizeDelta()
Returns a Dimension representing how much the EditPart has been resized.- Returns:
- A Dimension representing how much the EditPart has been resized.
-
getTransformedRectangle
public org.eclipse.draw2d.geometry.Rectangle getTransformedRectangle(org.eclipse.draw2d.geometry.Rectangle rect)
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:
trueif centered resize- Since:
- 3.0
-
isConstrainedMove
public boolean isConstrainedMove()
Returnstrueif the request is for a constrained move- Returns:
trueif a constrained move- Since:
- 3.0
-
isConstrainedResize
public boolean isConstrainedResize()
Returnstrueif the request is for a constrained resize- Returns:
trueif a constrained resize- Since:
- 3.0
-
isSnapToEnabled
public boolean isSnapToEnabled()
Returnstrueif snap-to is enabled- Returns:
trueif 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-trueif 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-trueif 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-trueif the request is for a constrained resize- Since:
- 3.0
-
setLocation
public void setLocation(org.eclipse.draw2d.geometry.Point p)
Sets the location of the mouse pointer.- Parameters:
p- The location of the mouse pointer.
-
setMouseLocation
public void setMouseLocation(org.eclipse.draw2d.geometry.Point p)
Deprecated.- Parameters:
p- The location of the mouse pointer.
-
setMoveDelta
public void setMoveDelta(org.eclipse.draw2d.geometry.Point p)
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:
getResizeDirection()
-
setSizeDelta
public void setSizeDelta(org.eclipse.draw2d.geometry.Dimension d)
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-trueif the request is for a creation with snap-to enabled- Since:
- 3.7
-
-