public class IlvReshapeSelection extends IlvObjectInteractor
IlvDrawSelection
.
Since JViews 8.0, this interactor can reshape graphic object that implement
IlvDefinitionRectInterface
.
Constructor and Description |
---|
IlvReshapeSelection()
Creates an
IlvReshapeSelection . |
Modifier and Type | Method and Description |
---|---|
protected void |
drawGhost(IlvDrawSelection obj,
Graphics g,
IlvObjectInteractorContext context)
Draws a rectangle while reshaping.
|
protected void |
drawGhost(IlvObjectInteractorContext context)
Deprecated.
Beginning with Perforce JViews 5.0, use the method
drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext)
instead. |
protected IlvRect |
getBoundingBox(IlvGraphic obj,
IlvTransformer t)
Returns the rectangle that defines the bounds of
the graphic object.
|
Cursor |
getCursor(int direction)
Returns the cursor used for editing.
|
static int |
getPreserveAspectModifier()
Returns the modifier for preserving aspect ratio during reshape.
|
static int |
getPreserveAspectModifierEx()
Returns the extended modifier for preserving aspect ratio during reshape.
|
protected boolean |
handleButtonDown(IlvDrawSelection sel,
MouseEvent event,
IlvObjectInteractorContext context)
Processes the button down events.
|
protected boolean |
handleButtonDragged(IlvDrawSelection sel,
MouseEvent event,
IlvObjectInteractorContext context)
Processes the button dragged events.
|
protected boolean |
handleButtonUp(IlvDrawSelection sel,
MouseEvent event,
IlvObjectInteractorContext context)
Processes the button up events.
|
void |
handleExpose(IlvGraphic obj,
Graphics g,
IlvObjectInteractorContext context)
Called when the view that draws the polypoints object
is drawn.
|
boolean |
isOpaqueMode()
Returns an indication of whether the interactor is in Opaque mode or not.
|
static boolean |
isPredictionCursorMode()
Returns whether the interactor uses the prediction cursor mode.
|
protected boolean |
isPreserveAspectModifierDown(InputEvent event)
Tests if the mouse event modifier for preserving aspect ratio during
reshape is currently down.
|
void |
onEnter(IlvGraphic sel,
IlvObjectInteractorContext context)
Called when the selection is entered.
|
void |
onExit(IlvGraphic sel,
IlvObjectInteractorContext context)
Called when the selection is exited.
|
boolean |
processEvent(IlvGraphic obj,
AWTEvent event,
IlvObjectInteractorContext context)
Processes the events.
|
protected void |
reshapeObject(IlvGraphic graphic,
IlvRect rect)
Called to let the interactor reshape an object.
|
void |
setOpaqueMode(boolean set)
Sets the interactor in Opaque mode.
|
static void |
setPredictionCursorMode(boolean flag)
Sets the prediction cursor mode.
|
static void |
setPreserveAspectModifier(int modifier)
Sets the modifier for preserving aspect ratio during reshape.
|
Get, Put
public Cursor getCursor(int direction)
direction
- The reshaping direction.protected void reshapeObject(IlvGraphic graphic, IlvRect rect)
graphic
- The IlvGraphic
to reshape.rect
- The new rectangle defining the object.protected boolean handleButtonDown(IlvDrawSelection sel, MouseEvent event, IlvObjectInteractorContext context)
true
if the event has been processed,
false
otherwise.protected IlvRect getBoundingBox(IlvGraphic obj, IlvTransformer t)
IlvGraphic.boundingBox(IlvTransformer)
.public void setOpaqueMode(boolean set)
The default mode is the Ghost mode.
isOpaqueMode()
,
IlvSelectInteractor.setOpaqueResize(boolean)
public boolean isOpaqueMode()
setOpaqueMode(boolean)
,
IlvSelectInteractor.setOpaqueResize(boolean)
protected boolean handleButtonDragged(IlvDrawSelection sel, MouseEvent event, IlvObjectInteractorContext context)
true
if the event has been processed,
false
otherwise.protected boolean handleButtonUp(IlvDrawSelection sel, MouseEvent event, IlvObjectInteractorContext context)
public boolean processEvent(IlvGraphic obj, AWTEvent event, IlvObjectInteractorContext context)
processEvent
in class IlvObjectInteractor
obj
- The graphic object.event
- The event to process.context
- The context in which the event occurred.true
if the event was handled
by this processEvent
invocation,
false
otherwise.public void handleExpose(IlvGraphic obj, Graphics g, IlvObjectInteractorContext context)
drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext)
if the interactor is in ghost mode, and does nothing otherwise.handleExpose
in class IlvObjectInteractor
obj
- The graphic object to which the object interactor is associated.g
- The Graphics
where obj
is drawn.context
- The interactor context.drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext)
@Deprecated protected void drawGhost(IlvObjectInteractorContext context)
drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext)
instead.protected void drawGhost(IlvDrawSelection obj, Graphics g, IlvObjectInteractorContext context)
obj
- The graphic object to which the object interactor is associated.g
- The Graphics
where obj
is drawn.context
- The interactor context.isOpaqueMode()
public void onEnter(IlvGraphic sel, IlvObjectInteractorContext context)
IlvSelection.onEnter(ilog.views.IlvObjectInteractorContext)
).
The selection is entered if the select interactor moves the mouse over
the selection so that mouse events are dispatched to the object interactor
of this selection.
onEnter
in class IlvObjectInteractor
sel
- The selection object.context
- The context for the object interactor.IlvSelection.onEnter(ilog.views.IlvObjectInteractorContext)
public void onExit(IlvGraphic sel, IlvObjectInteractorContext context)
IlvSelection.onExit(ilog.views.IlvObjectInteractorContext)
).
The selection is exited if the select interactor moves the mouse to
a blank area of the view, or to another selection so that mouse events
are no longer dispatched to the object interactor of this selection.
onExit
in class IlvObjectInteractor
sel
- The selection object.context
- The context for the object interactor.IlvSelection.onExit(ilog.views.IlvObjectInteractorContext)
public static void setPreserveAspectModifier(int modifier)
InputEvent.CTRL_MASK
.
This method can be used to set normal modifiers and extended
modifiers (see java.awt.event.InputEvent.getModifiersEx()
since JDK 1.4).
Note: In the mask, InputEvent.ALT_DOWN_MASK
should be used instead of InputEvent.ALT_MASK
, and
InputEvent.META_DOWN_MASK
should be used instead of InputEvent.META_MASK
,
because the values of ALT_MASK/BUTTON2_MASK
and
META_MASK/BUTTON3_MASK
overlap.
getPreserveAspectModifier()
,
getPreserveAspectModifierEx()
,
isPreserveAspectModifierDown(java.awt.event.InputEvent)
public static int getPreserveAspectModifier()
InputEvent.CTRL_MASK
.
setPreserveAspectModifier(int)
,
isPreserveAspectModifierDown(java.awt.event.InputEvent)
public static int getPreserveAspectModifierEx()
InputEvent.CTRL_DOWN_MASK
.
See java.awt.event.InputEvent.getModifiersEx()
since
JDK 1.4 for information about extended modifiers.
This mask is computed from setPreserveAspectModifier(int)
.
setPreserveAspectModifier(int)
,
isPreserveAspectModifierDown(java.awt.event.InputEvent)
protected boolean isPreserveAspectModifierDown(InputEvent event)
getPreserveAspectModifierEx()
.
If the modifier key is pressed when clicking on a handle to
reshape the object, the aspect ratio of the object is preserved.
The default modifier is InputEvent.CTRL_DOWN_MASK
.setPreserveAspectModifier(int)
public static void setPredictionCursorMode(boolean flag)
isPredictionCursorMode()
public static boolean isPredictionCursorMode()
setPredictionCursorMode(boolean)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.