ilog.views.maps.graphic
Class IlvMapPolyPointEdition

java.lang.Object
  extended by ilog.views.IlvObjectInteractor
      extended by ilog.views.IlvPolyPointsEdition
          extended by ilog.views.maps.graphic.IlvMapPolyPointEdition
All Implemented Interfaces:
Serializable

public class IlvMapPolyPointEdition
extends IlvPolyPointsEdition

A IlvPolyPointsEdition that takes care of the MINIMUM_POINTS and MAXIMUM_POINTS properties if such properties are attached to the edited IlvGraphic. This object interactor will not add a point if the number of points will exceed the MAXIMUM_POINTS Integer property and will not remove a point if the number of points will be less than the MINIMUM_POINTS Integer property.

Since:
JViews 7.5
See Also:
Serialized Form

Field Summary
static String MAXIMUM_POINTS
          Name of the property that is used to fix the maximum of points the graphic object should have.
static String MINIMUM_POINTS
          Name of the property that is used to fix the minimum of points the graphic object should have.
 
Constructor Summary
IlvMapPolyPointEdition()
          Creates a new IlvMapPolyPointEdition.
 
Method Summary
 Cursor getAddCursor()
          Retrieves the cursor used to indicate that the user can add a point.
 Cursor getMoveHandleCursor()
          Retrieves the cursor used to indicate that the user can move a point.
 Cursor getMoveObjectCursor()
          Retrieves the cursor used to indicate that the user can mode an handle.
 Cursor getRemoveCursor()
          Retrieves the cursor used to indicate that the user can remove a point.
protected  void insertPoint(IlvPolyPointsInterface obj, IlvPoint p, IlvObjectInteractorContext context)
          Called when a point is inserted.
 boolean processEvent(IlvGraphic obj, AWTEvent event, IlvObjectInteractorContext context)
          Processes the events.
protected  void removePoint(IlvPolyPointsInterface obj, IlvObjectInteractorContext context)
          Called when a point is removed.
 void setAddCursor(Cursor addCursor)
          Sets the cursor used to indicate that the user can add a point.
 void setMoveHandleCursor(Cursor moveHandleCursor)
          Sets the cursor used to indicate that the user can mode an handle.
 void setMoveObjectCursor(Cursor moveObjectCursor)
          Sets the cursor used to indicate that the user can mode an object.
 void setRemoveCursor(Cursor removeCursor)
          Sets the cursor used to indicate that the user can remove a point.
 
Methods inherited from class ilog.views.IlvPolyPointsEdition
allowPointAddition, allowPointAddition, allowPointRemoval, allowPointRemoval, allowsPointInsertion, allowsPointMove, allowsPointRemoval, drawGhost, drawGhost, getAddRemovePointModifier, getAddRemovePointModifierEx, getCursor, getIndex, handleButtonDown, handleButtonDragged, handleButtonUp, handleExpose, handleMouseMoved, isAddRemovePointModifierDown, isOpaqueMode, movePoint, onEnter, onExit, setAddRemovePointModifier, setCursor, setOpaqueMode
 
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
 

Field Detail

MINIMUM_POINTS

public static final String MINIMUM_POINTS
Name of the property that is used to fix the minimum of points the graphic object should have. This IlvMapPolypointEdition will not remove points if the number of points is less or equal the Integer property found under this name.

See Also:
Constant Field Values

MAXIMUM_POINTS

public static final String MAXIMUM_POINTS
Name of the property that is used to fix the maximum of points the graphic object should have. This IlvMapPolypointEdition will not add points if the number of points is greater or equal the Integer property found under this name.

See Also:
Constant Field Values
Constructor Detail

IlvMapPolyPointEdition

public IlvMapPolyPointEdition()
Creates a new IlvMapPolyPointEdition.

Method Detail

insertPoint

protected void insertPoint(IlvPolyPointsInterface obj,
                           IlvPoint p,
                           IlvObjectInteractorContext context)
Called when a point is inserted.

Overrides:
insertPoint in class IlvPolyPointsEdition
Parameters:
obj - The object to modify.
p - The position of the point in untransformed IlvManager coordinates.
context - The interactor context.
See Also:
IlvPolyPointsEdition.insertPoint(ilog.views.IlvPolyPointsInterface, ilog.views.IlvPoint, ilog.views.IlvObjectInteractorContext)

removePoint

protected void removePoint(IlvPolyPointsInterface obj,
                           IlvObjectInteractorContext context)
Called when a point is removed. You can get the index of the point using getIndex.

Overrides:
removePoint in class IlvPolyPointsEdition
Parameters:
obj - The object to modify.
context - The interactor context.
See Also:
IlvPolyPointsEdition.removePoint(ilog.views.IlvPolyPointsInterface, ilog.views.IlvObjectInteractorContext)

processEvent

public boolean processEvent(IlvGraphic obj,
                            AWTEvent event,
                            IlvObjectInteractorContext context)
Processes the events. The events are dispatched to the following methods depending on the type of the event: handleButtonDown for a MOUSE_PRESSED event, handleButtonUp for a MOUSE_RELEASED event, or handleButtonDragged for a MOUSE_DRAGGED event.

Overrides:
processEvent in class IlvPolyPointsEdition
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.
See Also:
IlvPolyPointsEdition.processEvent(ilog.views.IlvGraphic, java.awt.AWTEvent, ilog.views.IlvObjectInteractorContext)

getAddCursor

public Cursor getAddCursor()
Retrieves the cursor used to indicate that the user can add a point.

Returns:
The cursor used to indicate that the user can add a point.

setAddCursor

public void setAddCursor(Cursor addCursor)
Sets the cursor used to indicate that the user can add a point.

Parameters:
addCursor - the cursor used to indicate that the user can add a point.

getMoveHandleCursor

public Cursor getMoveHandleCursor()
Retrieves the cursor used to indicate that the user can move a point.

Returns:
the cursor used to indicate that the user can move a point.

setMoveHandleCursor

public void setMoveHandleCursor(Cursor moveHandleCursor)
Sets the cursor used to indicate that the user can mode an handle.

Parameters:
moveHandleCursor - the cursor used to indicate that the user can mode an handle.

getMoveObjectCursor

public Cursor getMoveObjectCursor()
Retrieves the cursor used to indicate that the user can mode an handle.

Returns:
the cursor used to indicate that the user can mode an handle.

setMoveObjectCursor

public void setMoveObjectCursor(Cursor moveObjectCursor)
Sets the cursor used to indicate that the user can mode an object.

Parameters:
moveObjectCursor - the cursor used to indicate that the user can mode an object.

getRemoveCursor

public Cursor getRemoveCursor()
Retrieves the cursor used to indicate that the user can remove a point.

Returns:
the cursor used to indicate that the user can remove a point.

setRemoveCursor

public void setRemoveCursor(Cursor removeCursor)
Sets the cursor used to indicate that the user can remove a point.

Parameters:
removeCursor - the cursor used to indicate that the user can remove a point.


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