ilog.views
Class IlvHandlesSelection

java.lang.Object
  extended by ilog.views.IlvGraphic
      extended by ilog.views.IlvSelection
          extended by ilog.views.IlvHandlesSelection
All Implemented Interfaces:
IlvPersistentObject, Transferable, Serializable
Direct Known Subclasses:
IlvDrawSelection, IlvGraphicHandleSelection, IlvHyperEdgeSelection, IlvPolyPointsSelection

public abstract class IlvHandlesSelection
extends IlvSelection

A selection object that displays several handles. The handles are drawn as small markers (squares or circles).

See Also:
Serialized Form

Field Summary
static int CIRCLE_SHAPE
          The circle shape for handles.
static Color defaultHandleBackgroundColor
          The default background color used when drawing a handle of shape SQUARE_SHAPE.
static Color defaultHandleColor
          The default color used when creating an IlvHandlesSelection object.
static int defaultHandleShape
          The default shape used when drawing an IlvHandlesSelection object.
static float defaultHandleSize
          The default size of handles when creating an IlvHandlesSelection object.
static int FILLED_CIRCLE_SHAPE
          The filled circle shape for handles.
static int FILLED_SQUARE_SHAPE
          The filled square shape for handles.
static int SQUARE_SHAPE
          The square shape for handles.
 
Constructor Summary
IlvHandlesSelection(IlvGraphic obj)
          Creates a new selection object.
 
Method Summary
protected  void afterLoopAllHandles()
          This is called by this class after iterating over all handles and calling getHandle(int, ilog.views.IlvTransformer).
protected  void beforeLoopAllHandles(IlvTransformer t)
          This is called by this class before iterating over all handles and calling getHandle(int, ilog.views.IlvTransformer).
 IlvRect boundingBox(IlvTransformer t)
          Returns the bounding box of the object.
 boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
          Test if the specified point is inside a handle.
 void draw(Graphics dst, IlvTransformer t)
          Draws the object.
 void drawWithoutHandles(Graphics dst, IlvTransformer t)
          Draws the decorations without the handles.
 Color getActiveHandlesColor()
          Returns the foreground color of the handles when the mouse is over the handles.
 int getHandle(IlvPoint p, IlvTransformer t)
          Searches for a handle located at point p, when the object is drawn with the transformer t.
abstract  IlvPoint getHandle(int i, IlvTransformer t)
          Returns the location of a handle.
abstract  int getHandleCardinal()
          Returns the number of handles for this object.
 Color getHandlesColor()
          Returns the foreground color of the handles when the mouse is not over the handles.
 int getHandlesShape()
          Returns the shape of the handles.
 float getHandlesSize()
          Returns the size of the handles.
 boolean isActive()
          Returns true if the selection is active.
 void onEnter(IlvObjectInteractorContext context)
          Called when the selection is entered.
 void onExit(IlvObjectInteractorContext context)
          Called when the selection is exited.
 void setActiveHandlesColor(Color c)
          Sets the foreground color of the handles when the mouse is over the handles.
 void setHandlesColor(Color c)
          Sets the foreground color of the handles when the mouse is not over the handles.
 void setHandlesShape(int shape)
          Changes the shape of the handles.
 void setHandlesSize(float size)
          Changes the size of the handles.
 boolean zoomable()
          Returns false, this object is not zoomable.
 
Methods inherited from class ilog.views.IlvSelection
applyTransform, copy, getDefaultInteractor, getObject, isOptimizedDrawingEnabled, isVisible, SetDefaultInteractor
 
Methods inherited from class ilog.views.IlvGraphic
addActionListener, addNamedPropertyListener, boundingBox, getAndAssociateObjectInteractor, getCenter, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, hasProperty, inside, intersects, isDataFlavorSupported, isEditable, isInApplyToObject, isMovable, isPersistent, isSelectable, makeSelection, move, move, moveResize, notifyObjectInteractorToManager, processActionEvent, reDraw, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setEditable, setFillOn, setForeground, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipText, setVisible, toString, translate, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILLED_SQUARE_SHAPE

public static final int FILLED_SQUARE_SHAPE
The filled square shape for handles.

See Also:
Constant Field Values

SQUARE_SHAPE

public static final int SQUARE_SHAPE
The square shape for handles.

See Also:
Constant Field Values

FILLED_CIRCLE_SHAPE

public static final int FILLED_CIRCLE_SHAPE
The filled circle shape for handles.

Since:
JViews 5.5
See Also:
Constant Field Values

CIRCLE_SHAPE

public static final int CIRCLE_SHAPE
The circle shape for handles.

Since:
JViews 5.5
See Also:
Constant Field Values

defaultHandleShape

public static int defaultHandleShape
The default shape used when drawing an IlvHandlesSelection object. The value can be IlvHandlesSelection.FILLED_SQUARE_SHAPE or IlvHandlesSelection.SQUARE_SHAPE. The default value is FILLED_SQUARE_SHAPE.


defaultHandleColor

public static Color defaultHandleColor
The default color used when creating an IlvHandlesSelection object.


defaultHandleBackgroundColor

public static Color defaultHandleBackgroundColor
The default background color used when drawing a handle of shape SQUARE_SHAPE.


defaultHandleSize

public static float defaultHandleSize
The default size of handles when creating an IlvHandlesSelection object. The value is 3.

Constructor Detail

IlvHandlesSelection

public IlvHandlesSelection(IlvGraphic obj)
Creates a new selection object.

Parameters:
obj - the selected object.
Method Detail

getHandlesColor

public Color getHandlesColor()
Returns the foreground color of the handles when the mouse is not over the handles.

See Also:
setHandlesColor(java.awt.Color)

setHandlesColor

public void setHandlesColor(Color c)
Sets the foreground color of the handles when the mouse is not over the handles.

See Also:
getHandlesColor()

getActiveHandlesColor

public Color getActiveHandlesColor()
Returns the foreground color of the handles when the mouse is over the handles.

Since:
JViews 8.0
See Also:
setHandlesColor(java.awt.Color)

setActiveHandlesColor

public void setActiveHandlesColor(Color c)
Sets the foreground color of the handles when the mouse is over the handles.

Since:
JViews 8.0
See Also:
getHandlesColor()

isActive

public boolean isActive()
Returns true if the selection is active. Usually this means that events are passed to the object interactor of the selection. Visually, it means that the handles color and the active handles color are swapped.

Since:
JViews 8.0

getHandlesSize

public final float getHandlesSize()
Returns the size of the handles.

See Also:
setHandlesSize(float)

setHandlesSize

public final void setHandlesSize(float size)
Changes the size of the handles.

Parameters:
size - the new size.
See Also:
getHandlesSize()

getHandlesShape

public final int getHandlesShape()
Returns the shape of the handles.

Returns:
IlvHandlesSelection.FILLED_SQUARE_SHAPE or IlvHandlesSelection.SQUARE_SHAPE
See Also:
setHandlesShape(int)

setHandlesShape

public final void setHandlesShape(int shape)
Changes the shape of the handles.

Parameters:
shape - The value can be IlvHandlesSelection.FILLED_SQUARE_SHAPE or IlvHandlesSelection.SQUARE_SHAPE
See Also:
getHandlesShape()

getHandle

public abstract IlvPoint getHandle(int i,
                                   IlvTransformer t)
Returns the location of a handle.

Parameters:
i - the index of the handle.
t - the transformer through which the object is drawn.

getHandleCardinal

public abstract int getHandleCardinal()
Returns the number of handles for this object.


getHandle

public int getHandle(IlvPoint p,
                     IlvTransformer t)
Searches for a handle located at point p, when the object is drawn with the transformer t.

Returns:
the index of the handle, or -1 if no handle was found.

contains

public boolean contains(IlvPoint p,
                        IlvPoint tp,
                        IlvTransformer t)
Test if the specified point is inside a handle.

Overrides:
contains in class IlvGraphic
Parameters:
p - The point to be tested.
tp - The point p transformed by the transformer t.
t - The transformation used to draw the object.
Returns:
true if the point lies inside this graphic object.
See Also:
IlvGraphic

draw

public void draw(Graphics dst,
                 IlvTransformer t)
Draws the object.

Specified by:
draw in class IlvGraphic
Parameters:
dst - The destination Graphics.
t - The transformation used to draw the object.
See Also:
IlvGraphic.boundingBox(ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

drawWithoutHandles

public void drawWithoutHandles(Graphics dst,
                               IlvTransformer t)
Draws the decorations without the handles.

Since:
JViews 8.0

zoomable

public boolean zoomable()
Returns false, this object is not zoomable.

Overrides:
zoomable in class IlvGraphic
See Also:
IlvGraphic, IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.boundingBox(IlvTransformer), IlvManager

boundingBox

public IlvRect boundingBox(IlvTransformer t)
Returns the bounding box of the object.

Specified by:
boundingBox in class IlvGraphic
Parameters:
t - The transformer used to draw the object. If the transformer is null, the bounding box for the identity transformer is returned.
See Also:
IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer), IlvGraphic.zoomable(), IlvGraphic

beforeLoopAllHandles

protected void beforeLoopAllHandles(IlvTransformer t)
This is called by this class before iterating over all handles and calling getHandle(int, ilog.views.IlvTransformer). Subclasses can override this method to do preparations so that getHandle(int, ilog.views.IlvTransformer) is fast, e.g. fill certain caches that are needed by getHandle(int, ilog.views.IlvTransformer).

Parameters:
t - The transformer to draw this object.
Since:
JViews 8.0
See Also:
afterLoopAllHandles()

afterLoopAllHandles

protected void afterLoopAllHandles()
This is called by this class after iterating over all handles and calling getHandle(int, ilog.views.IlvTransformer). Subclasses can override this method to do cleanup caches that were needed by getHandle(int, ilog.views.IlvTransformer).

Since:
JViews 8.0
See Also:
beforeLoopAllHandles(ilog.views.IlvTransformer)

onEnter

public void onEnter(IlvObjectInteractorContext context)
Called when the selection is entered. 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.

Subclasses can override this method to perform specific tasks when the selection is entered. The default implementation does nothing.

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

onExit

public void onExit(IlvObjectInteractorContext context)
Called when the selection is exited. 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.

Subclasses can override this method to perform specific tasks when the selection is entered. The default implementation does nothing.

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


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