Package org.eclipse.gef.requests
Class AlignmentRequest
- java.lang.Object
-
- org.eclipse.gef.Request
-
- org.eclipse.gef.requests.GroupRequest
-
- org.eclipse.gef.requests.ChangeBoundsRequest
-
- org.eclipse.gef.requests.AlignmentRequest
-
- All Implemented Interfaces:
DropRequest
public class AlignmentRequest extends ChangeBoundsRequest
A request to align multiple objects.
-
-
Constructor Summary
Constructors Constructor Description AlignmentRequest()
Default constructor.AlignmentRequest(java.lang.Object type)
Constructs a new AlignmentRequest with the new type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getAlignment()
Returns the alignment.org.eclipse.draw2d.geometry.Rectangle
getAlignmentRectangle()
Returns the rectangle used to align the edit part with.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.void
setAlignment(int align)
Sets the alignment.void
setAlignmentRectangle(org.eclipse.draw2d.geometry.Rectangle rect)
Sets the alignment rectangle.-
Methods inherited from class org.eclipse.gef.requests.ChangeBoundsRequest
getLocation, getMouseLocation, getMoveDelta, getResizeDirection, getSizeDelta, isCenteredResize, isConstrainedMove, isConstrainedResize, isSnapToEnabled, setCenteredResize, setConstrainedMove, setConstrainedResize, setLocation, setMouseLocation, setMoveDelta, setResizeDirection, setSizeDelta, setSnapToEnabled
-
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
-
getAlignment
public int getAlignment()
Returns the alignment. Possible values arePositionConstants.LEFT
,PositionConstants.RIGHT
,PositionConstants.TOP
andPositionConstants.BOTTOM
.- Returns:
- the alignment
-
getAlignmentRectangle
public org.eclipse.draw2d.geometry.Rectangle getAlignmentRectangle()
Returns the rectangle used to align the edit part with.- Returns:
- the alignment rectangle
-
getTransformedRectangle
public org.eclipse.draw2d.geometry.Rectangle getTransformedRectangle(org.eclipse.draw2d.geometry.Rectangle rect)
Description copied from class:ChangeBoundsRequest
Transforms a copy of the passed in rectangle to account for the move and/or resize deltas and returns this copy.- Overrides:
getTransformedRectangle
in classChangeBoundsRequest
- Parameters:
rect
- the rectangle to transform- Returns:
- a copy of the passed in rectangle representing the new bounds
- See Also:
ChangeBoundsRequest.getTransformedRectangle(Rectangle)
-
setAlignment
public void setAlignment(int align)
Sets the alignment.- Parameters:
align
- the alignment- See Also:
getAlignment()
-
setAlignmentRectangle
public void setAlignmentRectangle(org.eclipse.draw2d.geometry.Rectangle rect)
Sets the alignment rectangle.- Parameters:
rect
- the alignment rectangle- See Also:
getAlignmentRectangle()
-
-