ilog.views
Class IlvPolyPointsSelection

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

public class IlvPolyPointsSelection
extends IlvHandlesSelection

This class is a selection object used to select graphic objects that implements the IlvPolyPointsInterface. It is a sub class of the class IlvHandlesSelection where the handles correspond to the points defining the shape of the object.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ilog.views.IlvHandlesSelection
CIRCLE_SHAPE, defaultHandleBackgroundColor, defaultHandleColor, defaultHandleShape, defaultHandleSize, FILLED_CIRCLE_SHAPE, FILLED_SQUARE_SHAPE, SQUARE_SHAPE
 
Constructor Summary
IlvPolyPointsSelection(IlvPolyPointsInterface obj)
          Creates a new selection object.
 
Method Summary
 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 or inside the selected object.
 String getDefaultInteractor()
          Returns the class name of the interactor used to edit polypoints.
 IlvPoint getHandle(int i, IlvTransformer t)
          Returns the location of a handle.
 int getHandleCardinal()
          Returns the number of handles for this object.
 IlvPolyPointsInterface getPolyPoints()
          Returns the selected object.
 boolean isClosedMode()
          Returns true if this object is in closed mode.
 boolean isOptimizedDrawingEnabled()
          The optimization is allowed if getPolyPoints().pointsInBBox() returns true.
 void setClosedMode(boolean set)
          Sets the selection in closed mode.
static void SetDefaultInteractor(String interactor)
          This method allows you to change the default interactor for instances of this class.
 
Methods inherited from class ilog.views.IlvHandlesSelection
afterLoopAllHandles, beforeLoopAllHandles, draw, drawWithoutHandles, getActiveHandlesColor, getHandle, getHandlesColor, getHandlesShape, getHandlesSize, isActive, onEnter, onExit, setActiveHandlesColor, setHandlesColor, setHandlesShape, setHandlesSize, zoomable
 
Methods inherited from class ilog.views.IlvSelection
applyTransform, copy, getObject, isVisible
 
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
 

Constructor Detail

IlvPolyPointsSelection

public IlvPolyPointsSelection(IlvPolyPointsInterface obj)
Creates a new selection object.

Parameters:
obj - the selected object.
Method Detail

getPolyPoints

public IlvPolyPointsInterface getPolyPoints()
Returns the selected object.


getHandle

public IlvPoint getHandle(int i,
                          IlvTransformer t)
Returns the location of a handle. It calls the getPointAt method of the selected IlvPolyPointsInterface object.

Specified by:
getHandle in class IlvHandlesSelection
Parameters:
i - the index of the handle.
t - the transformer through which the object is drawn.

getHandleCardinal

public int getHandleCardinal()
Returns the number of handles for this object. The number of handle is the same as the number of points in the selected IlvPolyPointsInterface object.

Specified by:
getHandleCardinal in class IlvHandlesSelection

setClosedMode

public void setClosedMode(boolean set)
Sets the selection in closed mode. In closed mode, this object will draw a closed polyline when editing. Otherwise it draws a polyline.

See Also:
isClosedMode()

isClosedMode

public boolean isClosedMode()
Returns true if this object is in closed mode. In closed mode, this object will draw a closed polyline when editing. Otherwise it draws a polyline.

See Also:
setClosedMode(boolean)

contains

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

Overrides:
contains in class IlvHandlesSelection
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

boundingBox

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

Overrides:
boundingBox in class IlvHandlesSelection
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

isOptimizedDrawingEnabled

public boolean isOptimizedDrawingEnabled()
The optimization is allowed if getPolyPoints().pointsInBBox() returns true.

Overrides:
isOptimizedDrawingEnabled in class IlvSelection
Since:
JViews 5.0

getDefaultInteractor

public String getDefaultInteractor()
Returns the class name of the interactor used to edit polypoints. The interactor is an IlvPolyPointsEdition.

Overrides:
getDefaultInteractor in class IlvSelection
See Also:
IlvPolyPointsEdition

SetDefaultInteractor

public static void SetDefaultInteractor(String interactor)
This method allows you to change the default interactor for instances of this class. It is useful to change the interactor used for editing polypoint objects. Setting it to null will recover the initial interactor.

Parameters:
interactor - The new interactor.
See Also:
getDefaultInteractor()


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