|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.IlvManagerViewInteractor
ilog.tgo.interactor.IltMoveInteractor
public class IltMoveInteractor
This class is a view interactor which lets the user move a ILOG JTGO composite graphic object, triggering a method when it is done.
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 Summary | |
|---|---|
IltMoveInteractor(IltcCompositeGraphic composite)
Creates the interactor. |
|
| Method Summary | |
|---|---|
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,
float dx,
float 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IltMoveInteractor(IltcCompositeGraphic composite)
composite - the composite graphic object which received the
initial mouse-down event| Method Detail |
|---|
public 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,
float dx,
float 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)
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||