ilog.views.interactor
Class IlvPanInteractor

java.lang.Object
  extended by ilog.views.IlvManagerViewInteractor
      extended by ilog.views.interactor.IlvPanInteractor
All Implemented Interfaces:
IlvPermanentInteractorInterface, Serializable

public class IlvPanInteractor
extends IlvManagerViewInteractor
implements IlvPermanentInteractorInterface

An interactor designed to translate a view without using scroll bars. The translation is done while dragging the mouse. It is particularly useful when the zoom level is important (because in this case, using scroll bars will imply a "jump" out of the zoomed zone).

Since:
JViews 3.0
See Also:
Serialized Form

Constructor Summary
IlvPanInteractor()
          Constructs and initializes a new instance of this interactor.
 
Method Summary
protected  void attach(IlvManagerView v)
          Called when the interactor is attached to the manager view.
protected  void detach()
          Called when the interactor is detached from the view.
protected  void drawGhost(Graphics g)
          Draws the rectangle ghost.
protected  IlvPoint getCurrentTranslation(MouseEvent event)
          Returns the current translation factors.
 Cursor getDefaultCursor()
          Returns the default Cursor that is set on the associated view when no mouse drag is performed.
 Cursor getDragCursor()
          Returns the drag Cursor.
 boolean isOpaqueMove()
          Returns whether the interactor is in Opaque Move mode or not.
 boolean isPermanent()
          Returns false if the interactor will be removed from the view once the object is created.
protected  void processEvent(AWTEvent event)
          Processes the events.
protected  void processMouseEvent(MouseEvent event)
          Processes the mouse events.
protected  void processMouseMotionEvent(MouseEvent event)
          Processes the mouse motion events.
 void setDefaultCursor(Cursor c)
          Sets the default Cursor on the associated view while this view is not being translated.
 void setDragCursor(Cursor c)
          Sets the drag Cursor on the associated view while the left mouse button is pressed (while dragging, for instance).
 void setOpaqueMove(boolean set)
          Sets the interactor in Opaque Move mode.
 void setPermanent(boolean permanent)
          Allows you to specify if the interactor will or will not be removed from the view once the object is created.
 
Methods inherited from class ilog.views.IlvManagerViewInteractor
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, isXORGhost, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvPanInteractor

public IlvPanInteractor()
Constructs and initializes a new instance of this interactor.

Method Detail

isPermanent

public final boolean isPermanent()
Returns false if the interactor will be removed from the view once the object is created. The default value is true.

Specified by:
isPermanent in interface IlvPermanentInteractorInterface
Since:
JViews 5.5

setPermanent

public final void setPermanent(boolean permanent)
Allows you to specify if the interactor will or will not be removed from the view once the object is created. The default value is true.

Specified by:
setPermanent in interface IlvPermanentInteractorInterface
Parameters:
permanent - the new mode.
Since:
JViews 5.5

attach

protected void attach(IlvManagerView v)
Called when the interactor is attached to the manager view.

Overrides:
attach in class IlvManagerViewInteractor
Parameters:
v - The manager view.
See Also:
IlvManagerViewInteractor.detach()

detach

protected void detach()
Called when the interactor is detached from the view.

Overrides:
detach in class IlvManagerViewInteractor
See Also:
IlvManagerViewInteractor.attach(ilog.views.IlvManagerView)

setDragCursor

public void setDragCursor(Cursor c)
Sets the drag Cursor on the associated view while the left mouse button is pressed (while dragging, for instance).

Parameters:
c - The Cursor object.
See Also:
getDragCursor()

setDefaultCursor

public void setDefaultCursor(Cursor c)
Sets the default Cursor on the associated view while this view is not being translated. (The left mouse button is not pressed).

Parameters:
c - The Cursor object.
See Also:
getDefaultCursor()

getDragCursor

public Cursor getDragCursor()
Returns the drag Cursor.

See Also:
setDragCursor(java.awt.Cursor)

getDefaultCursor

public Cursor getDefaultCursor()
Returns the default Cursor that is set on the associated view when no mouse drag is performed.

See Also:
setDefaultCursor(java.awt.Cursor)

setOpaqueMove

public final void setOpaqueMove(boolean set)
Sets the interactor in Opaque Move mode. The interactor has two modes to translate the attached view: The Opaque Move mode and the Ghost Move mode. In Opaque Move mode, the position of the view is changed for each drag event. In the other mode, the view is translated only when the user releases the mouse button. The default mode is the Opaque Move mode.


isOpaqueMove

public final boolean isOpaqueMove()
Returns whether the interactor is in Opaque Move mode or not. The interactor has two modes to translate the attached view: The Opaque Move mode and the Ghost Move mode. In Opaque Move mode, the position of the view is changed for each drag event. In the other mode, the view is translated only when the user releases the mouse button. The default mode is the Opaque Move mode.


getCurrentTranslation

protected IlvPoint getCurrentTranslation(MouseEvent event)
Returns the current translation factors. This method is used in the non-opaque mode and is called each time the mouse button is released. The x and y factors of the view's translation are returned inside an IlvPoint.

Parameters:
event - The MouseEvent corresponding to a MOUSE_RELEASED.

drawGhost

protected void drawGhost(Graphics g)
Draws the rectangle ghost.

Overrides:
drawGhost in class IlvManagerViewInteractor
Parameters:
g - The Graphics.
See Also:
IlvManagerViewInteractor.drawGhost(java.awt.Graphics)

processMouseEvent

protected void processMouseEvent(MouseEvent event)
Processes the mouse events.

Overrides:
processMouseEvent in class IlvManagerViewInteractor
Parameters:
event - The event.
See Also:
IlvManagerViewInteractor.processMouseEvent(java.awt.event.MouseEvent)

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent event)
Processes the mouse motion events.

Overrides:
processMouseMotionEvent in class IlvManagerViewInteractor
Parameters:
event - The event.
See Also:
IlvManagerViewInteractor.processMouseMotionEvent(java.awt.event.MouseEvent)

processEvent

protected void processEvent(AWTEvent event)
Processes the events. This method has been overridden in order to shortcut the event.

Overrides:
processEvent in class IlvManagerViewInteractor
Parameters:
event - The event.
See Also:
IlvManagerViewInteractor.processEvent(java.awt.AWTEvent)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.