ilog.cpl.interactor
Class IlpDefaultViewInteractionContext

java.lang.Object
  extended by ilog.cpl.interactor.IlpDefaultInteractionContext
      extended by ilog.cpl.interactor.IlpDefaultViewInteractionContext
All Implemented Interfaces:
IlpInteractionContext, IlpViewInteractionContext
Direct Known Subclasses:
IlpTableHeaderInteractionContext, IlpTableViewInteractionContext

public class IlpDefaultViewInteractionContext
extends IlpDefaultInteractionContext
implements IlpViewInteractionContext

Provides a default implementation of IlpViewInteractionContext A view interaction context is used to store contextual information about the events that occur over a graphic view.

Since:
JTGO 3.0
See Also:
IlpViewInteractionContext, IlpGraphicView

Constructor Summary
IlpDefaultViewInteractionContext(IlpGraphicView view)
          Constructs an interaction context dedicated to a view.
 
Method Summary
 void addGraphic(IlpGraphic graphic)
          Adds a graphic to the collection of graphics involved in a gesture.
 void addRepresentationObject(IlpRepresentationObject object)
          Adds a representation object to the collection of representation objects involved in a gesture.
 Collection getGraphics()
          Returns the collection of IlpGraphics involved in a gesture.
 IlpObjectInteractionContext getObjectContext()
          Returns the object interaction context used when the event management is delegated to an object interactor.
 Collection getRepresentationObjects()
          Returns the collection of IlpRepresentationObjects involved in a gesture.
 boolean removeGraphic(IlpGraphic graphic)
          Removes a graphic from the collection of graphics involved in a gesture.
 boolean removeRepresentationObject(IlpRepresentationObject object)
          Removes a representation object from the collection of representation objects involved in a gesture.
 void reset()
          Redefined here to reset the collection of representation objects and graphics involved in the gesture.
 void setObjectContext(IlpObjectInteractionContext objectContext)
          Sets the object interaction context used when the event management is delegated to an object interactor.
 
Methods inherited from class ilog.cpl.interactor.IlpDefaultInteractionContext
getPosition, getView, setPosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.cpl.interactor.IlpInteractionContext
getPosition, getView, setPosition
 

Constructor Detail

IlpDefaultViewInteractionContext

public IlpDefaultViewInteractionContext(IlpGraphicView view)
Constructs an interaction context dedicated to a view.

Parameters:
view - The view this context is dedicated to.
Throws:
IllegalArgumentException - if the given view is null.
Method Detail

getRepresentationObjects

public Collection getRepresentationObjects()
Returns the collection of IlpRepresentationObjects involved in a gesture. The collection may be empty.

Specified by:
getRepresentationObjects in interface IlpViewInteractionContext
See Also:
addRepresentationObject(ilog.cpl.model.IlpRepresentationObject), removeRepresentationObject(ilog.cpl.model.IlpRepresentationObject)

addRepresentationObject

public void addRepresentationObject(IlpRepresentationObject object)
Adds a representation object to the collection of representation objects involved in a gesture.

Specified by:
addRepresentationObject in interface IlpViewInteractionContext
Parameters:
object - The representation object to be added.
Throws:
IllegalArgumentException - if the given representation object is null.
See Also:
getRepresentationObjects(), removeRepresentationObject(ilog.cpl.model.IlpRepresentationObject)

removeRepresentationObject

public boolean removeRepresentationObject(IlpRepresentationObject object)
Removes a representation object from the collection of representation objects involved in a gesture.

Specified by:
removeRepresentationObject in interface IlpViewInteractionContext
Parameters:
object - The representation object to be removed.
Returns:
true if the given representation object has been removed.
See Also:
getRepresentationObjects(), addRepresentationObject(ilog.cpl.model.IlpRepresentationObject)

getGraphics

public Collection getGraphics()
Returns the collection of IlpGraphics involved in a gesture. The collection may be empty.

Specified by:
getGraphics in interface IlpViewInteractionContext
See Also:
addGraphic(ilog.cpl.graphic.IlpGraphic), removeGraphic(ilog.cpl.graphic.IlpGraphic)

addGraphic

public void addGraphic(IlpGraphic graphic)
Adds a graphic to the collection of graphics involved in a gesture. Adding a graphic also adds its representation object.

Specified by:
addGraphic in interface IlpViewInteractionContext
Parameters:
graphic - The graphic to be added.
Throws:
IllegalArgumentException - if the given graphic is null.
See Also:
getGraphics(), removeGraphic(ilog.cpl.graphic.IlpGraphic)

removeGraphic

public boolean removeGraphic(IlpGraphic graphic)
Removes a graphic from the collection of graphics involved in a gesture. Removing a graphic also removes its representation object.

Specified by:
removeGraphic in interface IlpViewInteractionContext
Parameters:
graphic - The graphic to be removed.
Returns:
true if the given graphic has been removed.
See Also:
getGraphics(), addGraphic(ilog.cpl.graphic.IlpGraphic)

getObjectContext

public IlpObjectInteractionContext getObjectContext()
Returns the object interaction context used when the event management is delegated to an object interactor. The context may be null.

Specified by:
getObjectContext in interface IlpViewInteractionContext
See Also:
setObjectContext(ilog.cpl.interactor.IlpObjectInteractionContext)

setObjectContext

public void setObjectContext(IlpObjectInteractionContext objectContext)
Sets the object interaction context used when the event management is delegated to an object interactor.

Specified by:
setObjectContext in interface IlpViewInteractionContext
Parameters:
objectContext - The object interaction context used to delegate the event management. May be null.
See Also:
getObjectContext()

reset

public void reset()
Redefined here to reset the collection of representation objects and graphics involved in the gesture.

Specified by:
reset in interface IlpInteractionContext
Overrides:
reset in class IlpDefaultInteractionContext


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