public class ReshapeHandlerHandle extends Object implements IHandle
IHandle
implementation that delegates to a IReshapeHandler
.
This class works on an IReshapeHandler
.
Constructor and Description |
---|
ReshapeHandlerHandle(HandlePositions position,
IReshapeHandler reshapeHandler)
Subclass constructor that creates a handle for the given position using the location instance as the
Location
for the handle. |
ReshapeHandlerHandle(HandlePositions position,
IReshapeHandler reshapeHandler,
ISize minimumSize)
Subclass constructor that creates a handle for the given position using the location instance as the
Location
for the handle. |
ReshapeHandlerHandle(HandlePositions position,
IReshapeHandler reshapeHandler,
ISize minimumSize,
ISize maximumSize)
Subclass constructor that creates a handle for the given position using the location instance as the
Location
for the handle. |
Modifier and Type | Method and Description |
---|---|
void |
cancelDrag(IInputModeContext context,
PointD originalLocation)
Delegates the cancel request to the
IReshapeHandler . |
void |
dragFinished(IInputModeContext context,
PointD originalLocation,
PointD newLocation)
Delegates the finish request to the
IReshapeHandler . |
Cursor |
getCursor()
Gets the cursor to display when the mouse hovers over or drags this handle.
|
IPoint |
getLocation()
Returns a view of the center of the handle.
|
ISize |
getMaximumSize()
Gets the maximum size allowed for the reshapeable.
|
IRectangle |
getMinimumEnclosedArea()
Gets the minimum enclosed area that needs to be encompassed by this reshapeable.
|
ISize |
getMinimumSize()
Gets the minimum size allowed for the reshapeable.
|
protected IReshapeHandler |
getReshapeHandler()
The reshapeable instance to write the changes to.
|
HandleTypes |
getType()
Gets the type of the handle that can be used by the rendering engine to render types differently.
|
void |
handleMove(IInputModeContext context,
PointD originalLocation,
PointD newLocation)
Delegates the move request to the
IReshapeHandler.handleReshape(IInputModeContext, RectD, RectD) method. |
void |
initializeDrag(IInputModeContext context)
This implementation does nothing.
|
void |
setCursor(Cursor value)
Sets the cursor to display when the mouse hovers over or drags this handle.
|
void |
setMaximumSize(ISize value)
Sets the maximum size allowed for the reshapeable.
|
void |
setMinimumEnclosedArea(IRectangle value)
Sets the minimum enclosed area that needs to be encompassed by this reshapeable.
|
void |
setMinimumSize(ISize value)
Sets the minimum size allowed for the reshapeable.
|
void |
setType(HandleTypes value)
Sets the type of the handle that can be used by the rendering engine to render types differently.
|
public ReshapeHandlerHandle(HandlePositions position, IReshapeHandler reshapeHandler)
Location
for the handle.
The instance modifies the instances using the reshapeable interface and reads the current state using the rect. The handle will automatically trim changes of the rectangle to the specified minimum and maximum size.
position
- The position of the handle.reshapeHandler
- The reshapeable to write the changes to.public ReshapeHandlerHandle(HandlePositions position, IReshapeHandler reshapeHandler, ISize minimumSize)
Location
for the handle.
The instance modifies the instances using the reshapeable interface and reads the current state using the rect. The handle will automatically trim changes of the rectangle to the specified minimum and maximum size.
position
- The position of the handle.reshapeHandler
- The reshapeable to write the changes to.minimumSize
- The minimum size allowed for the rectangle.public ReshapeHandlerHandle(HandlePositions position, IReshapeHandler reshapeHandler, ISize minimumSize, ISize maximumSize)
Location
for the handle.
The instance modifies the instances using the reshapeable interface and reads the current state using the rect. The handle will automatically trim changes of the rectangle to the specified minimum and maximum size.
position
- The position of the handle.reshapeHandler
- The reshapeable to write the changes to.maximumSize
- The maximum size allowed for the rectangle.minimumSize
- The minimum size allowed for the rectangle.public void cancelDrag(IInputModeContext context, PointD originalLocation)
IReshapeHandler
.cancelDrag
in interface IDragHandler
context
- The context to retrieve information about the drag from.originalLocation
- The value of the coordinate of the Location
property at the time of
IDragHandler.initializeDrag(IInputModeContext)
.public void dragFinished(IInputModeContext context, PointD originalLocation, PointD newLocation)
IReshapeHandler
.dragFinished
in interface IDragHandler
context
- The context to retrieve information about the drag from.originalLocation
- The value of the Location
property at the time of IDragHandler.initializeDrag(IInputModeContext)
.newLocation
- The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the
implementation the Location
may or may not be modified to reflect the new value. This is the same
value as delivered in the last invocation of IDragHandler.handleMove(IInputModeContext, PointD, PointD)
public final Cursor getCursor()
getCursor
in interface IHandle
setCursor(Cursor)
public final IPoint getLocation()
The point describes the current world coordinate of the element that can be modified by this handle.
getLocation
in interface IDragHandler
public final ISize getMaximumSize()
The value is stored by reference. The default is SizeD.INFINITE
.
setMaximumSize(ISize)
public final IRectangle getMinimumEnclosedArea()
The value is stored by reference. The default is SizeD.ZERO
, which does not restrict the area at all.
setMinimumEnclosedArea(IRectangle)
public final ISize getMinimumSize()
The value is stored by reference. The default is SizeD.ZERO
.
setMinimumSize(ISize)
protected final IReshapeHandler getReshapeHandler()
public final HandleTypes getType()
getType
in interface IHandle
setType(HandleTypes)
public void handleMove(IInputModeContext context, PointD originalLocation, PointD newLocation)
IReshapeHandler.handleReshape(IInputModeContext, RectD, RectD)
method.handleMove
in interface IDragHandler
context
- The context to retrieve information about the drag from.originalLocation
- The value of the Location
property at the time of IDragHandler.initializeDrag(IInputModeContext)
.newLocation
- The coordinates in the world coordinate system that the client wants the handle to be at. Depending on the
implementation the Location
may or may not be modified to reflect the new value.public void initializeDrag(IInputModeContext context)
initializeDrag
in interface IDragHandler
context
- The context to retrieve information about the drag from.public final void setCursor(Cursor value)
value
- The Cursor to set.getCursor()
public final void setMaximumSize(ISize value)
The value is stored by reference. The default is SizeD.INFINITE
.
value
- The MaximumSize to set.getMaximumSize()
public final void setMinimumEnclosedArea(IRectangle value)
The value is stored by reference. The default is SizeD.ZERO
, which does not restrict the area at all.
value
- The MinimumEnclosedArea to set.getMinimumEnclosedArea()
public final void setMinimumSize(ISize value)
The value is stored by reference. The default is SizeD.ZERO
.
value
- The MinimumSize to set.getMinimumSize()
public final void setType(HandleTypes value)
value
- The Type to set.getType()