ilog.cpl.graph
Class IlpAbstractGraphHandler

java.lang.Object
  extended by ilog.cpl.graph.IlpAbstractGraphHandler
All Implemented Interfaces:
IlpExpansionHandler, IlpGraphHandler, IlpLoadHandler, IlpNodeHandler, IlpPositionHandler
Direct Known Subclasses:
IlpGraphHandlerWithDataSource, IlpGraphHandlerWithoutDataSource

public abstract class IlpAbstractGraphHandler
extends Object
implements IlpGraphHandler

This class provides basic infrastructure to handler classes.

The handler performs editing operations by accessing the representation objects and the model.

Since:
JTGO 4.0
See Also:
IlpGraphController.setGraphHandler(ilog.cpl.graph.IlpGraphHandler)

Field Summary
 
Fields inherited from interface ilog.cpl.graph.IlpNodeHandler
LINK_FROM_NODE, LINK_FROM_PORT, LINK_TO_NODE, LINK_TO_PORT
 
Constructor Summary
protected IlpAbstractGraphHandler(IlpGraphController contr)
          Creates the handler.
 
Method Summary
protected abstract  IlpDefaultClass createDefaultClass()
          Returns the graph handler default position attribute class.
protected  IlpObject createObject(Class clazz, IlpAttributeGroup attributes, Map properties, Object id)
          Returns a new object corresponding to an object id returned by createObjectId.
protected abstract  Object createObjectId(Class clazz, IlpAttributeGroup attributes, Map properties)
          Returns an object id for the creation of a new object.
protected  void endBatch()
          Terminates a batch of modifications in the underlying model.
protected  IlpClass findIlpClass(Class clazz, IlpAttributeGroup attributes)
          Returns an IlpClass for the creation of a new object.
protected abstract  String getClassName(IlpAttributeGroup attributes)
          Returns the class name for objects created by this handler.
protected  IlpClass getDefaultClass()
          Returns the default business class for the objects created using this handler.
protected  IlpGraphController getGraphController()
          Returns the controller component.
protected  IlpMutableGraphModel getGraphModel()
          Returns the model component.
protected abstract  Logger getHandlerLogger()
          Returns the logger used to log messages by this handler.
protected  void setGraphController(IlpGraphController controller)
          Sets the controller component.
protected  void startBatch()
          Start a batch of modifications in the underlying model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ilog.cpl.graph.IlpNodeHandler
handleChangeRelationship, handleCloneObject, handleCreateObject, handleRemoveObject, handleUpdateObject
 
Methods inherited from interface ilog.cpl.graph.IlpPositionHandler
handleMoveObject
 
Methods inherited from interface ilog.cpl.graph.IlpExpansionHandler
handleCollapseObject, handleExpandObject
 
Methods inherited from interface ilog.cpl.graph.IlpLoadHandler
handleLoad
 

Constructor Detail

IlpAbstractGraphHandler

protected IlpAbstractGraphHandler(IlpGraphController contr)
Creates the handler.

Parameters:
contr - The controller.
Method Detail

getHandlerLogger

protected abstract Logger getHandlerLogger()
Returns the logger used to log messages by this handler.


getDefaultClass

protected IlpClass getDefaultClass()
Returns the default business class for the objects created using this handler.

See Also:
createObject(Class, IlpAttributeGroup, Map, Object)

getGraphController

protected IlpGraphController getGraphController()
Returns the controller component.


setGraphController

protected void setGraphController(IlpGraphController controller)
Sets the controller component.


getGraphModel

protected IlpMutableGraphModel getGraphModel()
Returns the model component.


startBatch

protected void startBatch()
Start a batch of modifications in the underlying model.


endBatch

protected void endBatch()
Terminates a batch of modifications in the underlying model.


createObjectId

protected abstract Object createObjectId(Class clazz,
                                         IlpAttributeGroup attributes,
                                         Map properties)
Returns an object id for the creation of a new object.

This method should be overridden in subclasses. The default implementation returns a String.

Note that object identifiers are subject to some constraints; for details, see IlpObject.getIdentifier().

Parameters:
clazz - An implementation of IlpRepresentationNode.
attributes - A set of attributes for the object to be created, or null.
properties - A set of hints for the object to be created, or null.
Returns:
An object id for object creation.

createObject

protected IlpObject createObject(Class clazz,
                                 IlpAttributeGroup attributes,
                                 Map properties,
                                 Object id)
Returns a new object corresponding to an object id returned by createObjectId.

This method should be overridden in subclasses. The default implementation returns the id itself, assuming it is an IlpObject.

Parameters:
clazz - An implementation of IlpRepresentationNode.
attributes - A set of attributes for the object to be created, or null.
properties - A set of hints for the object to be created, or null.
id - The object identifier to use for object creation.
Returns:
The new IlpObject>.

findIlpClass

protected IlpClass findIlpClass(Class clazz,
                                IlpAttributeGroup attributes)
Returns an IlpClass for the creation of a new object.

This method should be overridden in subclasses. The default implementation uses an IlpDefaultClassManager to return an IlpClass containing the given attributes.

Parameters:
clazz - An implementation of IlpRepresentationNode.
attributes - A set of attributes for the object to be created, or null.
See Also:
createObject(Class, IlpAttributeGroup, Map, Object)

createDefaultClass

protected abstract IlpDefaultClass createDefaultClass()
Returns the graph handler default position attribute class.

See Also:
getDefaultClass(), createObject(Class, IlpAttributeGroup, Map, Object)

getClassName

protected abstract String getClassName(IlpAttributeGroup attributes)
Returns the class name for objects created by this handler.

Parameters:
attributes - The attribute group set in the created representation objects.
See Also:
findIlpClass(Class, IlpAttributeGroup)
Internal method or field: do not use!


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