ilog.views.interactor
Class IlvRotateInteractor

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

public class IlvRotateInteractor
extends IlvManagerViewInteractor
implements IlvPermanentInteractorInterface

This interactor allows you to rotate one of the selected objects. You can rotate it by dragging handles of the selection object. Note that this interactor can only rotate objects whose selection object is a subclass of IlvHandlesSelection which is the case for all standard ILOG JViews objects.

See Also:
Serialized Form

Constructor Summary
IlvRotateInteractor()
          Constructs an IlvRotateInteractor.
 
Method Summary
protected  boolean allowsRotation(IlvGraphic obj)
          Checks if the rotation of the specified object is allowed.
protected  void attach(IlvManagerView view)
          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 a ghost when an object is being rotated.
protected  boolean handleButtonDown(MouseEvent event)
          Processes the button down events.
protected  boolean handleButtonDragged(MouseEvent event)
          Processes the button dragged events.
protected  boolean handleButtonUp(MouseEvent event)
          Processes the button up events.
 boolean isOpaqueMode()
          Returns whether the interactor is in Opaque mode or not.
 boolean isPermanent()
          Returns true if the interactor operates in permanent mode; false otherwise.
 boolean isXORGhost()
          Returns the ghost drawing mode.
protected  void processMouseEvent(MouseEvent event)
          Processes the mouse events.
protected  void processMouseMotionEvent(MouseEvent event)
          Processes the mouse motion events.
protected  void rotateObject(IlvGraphic object, IlvPoint center, double angle)
          Called when rotating an object.
 void setOpaqueMode(boolean set)
          Sets the interactor in Opaque mode.
 void setPermanent(boolean set)
          Changes the mode of the interactor.
 
Methods inherited from class ilog.views.IlvManagerViewInteractor
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, handleExpose, processEvent, 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

IlvRotateInteractor

public IlvRotateInteractor()
Constructs an IlvRotateInteractor.

Method Detail

attach

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

Overrides:
attach in class IlvManagerViewInteractor
Parameters:
view - 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)

allowsRotation

protected boolean allowsRotation(IlvGraphic obj)
Checks if the rotation of the specified object is allowed.

Parameters:
obj - The object about to be rotated.

setOpaqueMode

public void setOpaqueMode(boolean set)
Sets the interactor in Opaque mode. The interactor has two modes: the Opaque mode and the Ghost mode. In Opaque mode, the object that the user rotates is rotated for each drag event. In Ghost mode, the object is rotated only when the user releases the mouse button.

The default mode is the Ghost mode.

Since:
JViews 5.0
See Also:
isOpaqueMode()

isOpaqueMode

public boolean isOpaqueMode()
Returns whether the interactor is in Opaque mode or not.

Since:
JViews 5.0
See Also:
setOpaqueMode(boolean)

isXORGhost

public final boolean isXORGhost()
Returns the ghost drawing mode. It overrides the method of the superclass to force the XOR mode when the method isOpaqueMode() returns false.

Overrides:
isXORGhost in class IlvManagerViewInteractor
Returns:
true if the drawing will be performed in XOR mode, false otherwise.
Since:
JViews 5.0
See Also:
IlvManagerViewInteractor.setXORGhost(boolean), IlvManagerViewInteractor.handleExpose(java.awt.Graphics), IlvManagerViewInteractor.drawGhost(java.awt.Graphics)

rotateObject

protected void rotateObject(IlvGraphic object,
                            IlvPoint center,
                            double angle)
Called when rotating an object.

Parameters:
object - The graphic to rotate.
center - The rotation center in manager coordinates.
angle - The angle in degrees.

drawGhost

protected void drawGhost(Graphics g)
Draws a ghost when an object is being rotated.

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

isPermanent

public boolean isPermanent()
Returns true if the interactor operates in permanent mode; false otherwise.

Specified by:
isPermanent in interface IlvPermanentInteractorInterface
See Also:
setPermanent(boolean)

setPermanent

public void setPermanent(boolean set)
Changes the mode of the interactor.

Specified by:
setPermanent in interface IlvPermanentInteractorInterface
Parameters:
set - The new mode.
See Also:
isPermanent()

processMouseEvent

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

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

handleButtonDown

protected boolean handleButtonDown(MouseEvent event)
Processes the button down events.

Parameters:
event - The event.
Returns:
true if the event has been processed, false otherwise.
Since:
JViews 5.0

handleButtonUp

protected boolean handleButtonUp(MouseEvent event)
Processes the button up events.

Parameters:
event - The event.
Returns:
true if the event has been processed, false otherwise.
Since:
JViews 5.0

processMouseMotionEvent

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

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

handleButtonDragged

protected boolean handleButtonDragged(MouseEvent event)
Processes the button dragged events.

Parameters:
event - The event.
Returns:
true if the event has been processed, false otherwise.
Since:
JViews 5.0


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