ilog.views
Class IlvReshapeSelection

java.lang.Object
  extended by ilog.views.IlvObjectInteractor
      extended by ilog.views.IlvReshapeSelection
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IlvTextEditor

public class IlvReshapeSelection
extends IlvObjectInteractor

An object interactor that reshapes an instance of IlvDrawSelection.

Since JViews 8.0, this interactor can reshape graphic object that implement IlvDefinitionRectInterface.

See Also:
Serialized Form

Constructor Summary
IlvReshapeSelection()
          Creates an IlvReshapeSelection.
 
Method Summary
protected  void drawGhost(IlvDrawSelection obj, Graphics g, IlvObjectInteractorContext context)
          Draws a rectangle while reshaping.
protected  void drawGhost(IlvObjectInteractorContext context)
          Deprecated. Beginning with ILOG JViews 5.0, use the method drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext) instead.
protected  IlvRect getBoundingBox(IlvGraphic obj, IlvTransformer t)
          Returns the rectangle that defines the bounds of the graphic object.
 Cursor getCursor(int direction)
          Returns the cursor used for editing.
protected  boolean handleButtonDown(IlvDrawSelection sel, MouseEvent event, IlvObjectInteractorContext context)
          Processes the button down events.
protected  boolean handleButtonDragged(IlvDrawSelection sel, MouseEvent event, IlvObjectInteractorContext context)
          Processes the button dragged events.
protected  boolean handleButtonUp(IlvDrawSelection sel, MouseEvent event, IlvObjectInteractorContext context)
          Processes the button up events.
 void handleExpose(IlvGraphic obj, Graphics g, IlvObjectInteractorContext context)
          Called when the view that draws the polypoints object is drawn.
 boolean isOpaqueMode()
          Returns an indication of whether the interactor is in Opaque mode or not.
 void onEnter(IlvGraphic sel, IlvObjectInteractorContext context)
          Called when the selection is entered.
 void onExit(IlvGraphic sel, IlvObjectInteractorContext context)
          Called when the selection is exited.
 boolean processEvent(IlvGraphic obj, AWTEvent event, IlvObjectInteractorContext context)
          Processes the events.
protected  void reshapeObject(IlvGraphic graphic, IlvRect rect)
          Called to let the interactor reshape an object.
 void setOpaqueMode(boolean set)
          Sets the interactor in Opaque mode.
 
Methods inherited from class ilog.views.IlvObjectInteractor
Get, Put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvReshapeSelection

public IlvReshapeSelection()
Creates an IlvReshapeSelection.

Method Detail

getCursor

public Cursor getCursor(int direction)
Returns the cursor used for editing.

Parameters:
direction - The reshaping direction.

reshapeObject

protected void reshapeObject(IlvGraphic graphic,
                             IlvRect rect)
Called to let the interactor reshape an object.

Parameters:
graphic - The IlvGraphic to reshape.
rect - The new rectangle defining the object.

handleButtonDown

protected boolean handleButtonDown(IlvDrawSelection sel,
                                   MouseEvent event,
                                   IlvObjectInteractorContext context)
Processes the button down events.

Returns:
true if the event has been processed, false otherwise.

getBoundingBox

protected IlvRect getBoundingBox(IlvGraphic obj,
                                 IlvTransformer t)
Returns the rectangle that defines the bounds of the graphic object. The default implementation uses the method IlvGraphic.boundingBox(IlvTransformer).

Since:
JViews 5.0

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 size of the object that the user resizes is changed for each drag event. In Ghost mode, the size of the object is changed only when the user releases the mouse button.

The default mode is the Ghost mode.

Since:
JViews 5.0
See Also:
isOpaqueMode(), IlvSelectInteractor.setOpaqueResize(boolean)

isOpaqueMode

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

Since:
JViews 5.0
See Also:
setOpaqueMode(boolean), IlvSelectInteractor.setOpaqueResize(boolean)

handleButtonDragged

protected boolean handleButtonDragged(IlvDrawSelection sel,
                                      MouseEvent event,
                                      IlvObjectInteractorContext context)
Processes the button dragged events.

Returns:
true if the event has been processed, false otherwise.

handleButtonUp

protected boolean handleButtonUp(IlvDrawSelection sel,
                                 MouseEvent event,
                                 IlvObjectInteractorContext context)
Processes the button up events.


processEvent

public boolean processEvent(IlvGraphic obj,
                            AWTEvent event,
                            IlvObjectInteractorContext context)
Processes the events.

Specified by:
processEvent in class IlvObjectInteractor
Parameters:
obj - The graphic object.
event - The event to process.
context - The context in which the event occurred.
Returns:
true if the event was handled by this processEvent invocation, false otherwise.

handleExpose

public void handleExpose(IlvGraphic obj,
                         Graphics g,
                         IlvObjectInteractorContext context)
Called when the view that draws the polypoints object is drawn. It actually calls the method drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext) if the interactor is in ghost mode, and does nothing otherwise.

Overrides:
handleExpose in class IlvObjectInteractor
Parameters:
obj - The graphic object to which the object interactor is associated.
g - The Graphics where obj is drawn.
context - The interactor context.
Since:
JViews 5.0
See Also:
drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext)

drawGhost

protected void drawGhost(IlvObjectInteractorContext context)
Deprecated. Beginning with ILOG JViews 5.0, use the method drawGhost(IlvDrawSelection, Graphics, IlvObjectInteractorContext) instead.

Draws a rectangle while reshaping.


drawGhost

protected void drawGhost(IlvDrawSelection obj,
                         Graphics g,
                         IlvObjectInteractorContext context)
Draws a rectangle while reshaping. This method does nothing if the interactor is in opaque mode.

Parameters:
obj - The graphic object to which the object interactor is associated.
g - The Graphics where obj is drawn.
context - The interactor context.
Since:
JViews 5.0
See Also:
isOpaqueMode()

onEnter

public void onEnter(IlvGraphic sel,
                    IlvObjectInteractorContext context)
Called when the selection is entered. This is used if the object interactor is associated with a selection object (see IlvSelection.onEnter(ilog.views.IlvObjectInteractorContext)). The selection is entered if the select interactor moves the mouse over the selection so that mouse events are dispatched to the object interactor of this selection.

Overrides:
onEnter in class IlvObjectInteractor
Parameters:
sel - The selection object.
context - The context for the object interactor.
Since:
JViews 8.0

onExit

public void onExit(IlvGraphic sel,
                   IlvObjectInteractorContext context)
Called when the selection is exited. This is used if the object interactor is associated with a selection object (see IlvSelection.onExit(ilog.views.IlvObjectInteractorContext)). The selection is exited if the select interactor moves the mouse to a blanc area of the view, or to another selection so that mouse events are no longer dispatched to the object interactor of this selection.

Overrides:
onExit in class IlvObjectInteractor
Parameters:
sel - The selection object.
context - The context for the object interactor.
Since:
JViews 8.0


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