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, setXORGhost
public 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 IlvManagerViewInteractor
g
- 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)
IlvManagerViewInteractor
MouseListener
registered with this interactor (if any).processMouseEvent
in class IlvManagerViewInteractor
event
- The event.IlvManagerViewInteractor.addMouseListener(java.awt.event.MouseListener)
protected void processMouseMotionEvent(MouseEvent event)
IlvManagerViewInteractor
MouseMotionListener
registered with this interactor (if any).processMouseMotionEvent
in class IlvManagerViewInteractor
event
- The event.IlvManagerViewInteractor.addMouseMotionListener(java.awt.event.MouseMotionListener)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.