public class IltMoveInteractor extends IlvManagerViewInteractor
This interactor expects to be pushed onto a view like this:
AWTEvent event = ...; // a mouse down event
view.pushInteractor(new IltMoveInteractor(composite),event);
The interactor removes itself from the manager view after calling the
trigger method.| Constructor and Description |
|---|
IltMoveInteractor(IltcCompositeGraphic composite)
Creates the interactor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
drawGhost(Graphics g)
Draws an outline of the composite graphic object being moved.
|
IltcCompositeGraphic |
getGraphic()
Returns the composite graphic object.
|
protected void |
processMouseEvent(MouseEvent event)
Processes the mouse events.
|
protected void |
processMouseMotionEvent(MouseEvent event)
Processes the mouse moved and mouse dragged events.
|
protected void |
trigger(AWTEvent event,
double dx,
double dy)
This method is called when the user has released the mouse, thus
finishing the move operation.
|
protected boolean |
validate(IlvPoint pos,
IlvPoint origpos)
Returns true if the moved distance is sufficiently large for warranting
a move of the object.
|
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, attach, detach, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, isXORGhost, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhostpublic IltMoveInteractor(IltcCompositeGraphic composite)
composite - the composite graphic object which received the
initial mouse-down eventpublic IltcCompositeGraphic getGraphic()
protected boolean validate(IlvPoint pos, IlvPoint origpos)
The default implementation of this function returns true when the distance between pos and and origpos is at least 4 pixels.
pos - current position (in view coordinates)origpos - original position (in view coordinates)protected void drawGhost(Graphics g)
drawGhost in class IlvManagerViewInteractorg - a graphics context in XOR modeIlvManagerViewInteractor.handleExpose(java.awt.Graphics),
IlvManagerViewInteractor.setXORGhost(boolean)protected void trigger(AWTEvent event, double dx, double dy)
event - the event that launched the method.dx - the horizontal movedy - the vertical moveprotected void processMouseEvent(MouseEvent event)
IlvManagerViewInteractorMouseListener
registered with this interactor (if any).processMouseEvent in class IlvManagerViewInteractorevent - The event.IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)protected void processMouseMotionEvent(MouseEvent event)
IlvManagerViewInteractorMouseMotionListener
registered with this interactor (if any).processMouseMotionEvent in class IlvManagerViewInteractorevent - The event.IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.