ilog.cpl.network
Class IlpNetworkHandlerWithDataSource

java.lang.Object
  extended by ilog.cpl.graph.IlpAbstractGraphHandler
      extended by ilog.cpl.graph.IlpGraphHandlerWithDataSource
          extended by ilog.cpl.network.IlpNetworkHandlerWithDataSource
All Implemented Interfaces:
IlpExpansionHandler, IlpGraphHandler, IlpLoadHandler, IlpNodeHandler, IlpPositionHandler, IlpNetworkHandler

public class IlpNetworkHandlerWithDataSource
extends IlpGraphHandlerWithDataSource
implements IlpNetworkHandler

This class is the recommended handler for the network component. It should be set when an IlpMutableDataSource and an IlpNetworkAdapter are in use.

The handler performs editing operations by accessing the data source. Any changes in the data source are then extended to the network model through the adapter.

The handler also directly communicates with the adapter.

The methods createObjectId, createObject and others can be overridden in subclasses.

Since:
JTGO 3.0
See Also:
IlpNetworkController.setHandler(ilog.cpl.network.IlpNetworkHandler), IlpNetworkAdapter, IlpDataSource

Field Summary
 
Fields inherited from interface ilog.cpl.graph.IlpNodeHandler
LINK_FROM_NODE, LINK_FROM_PORT, LINK_TO_NODE, LINK_TO_PORT
 
Constructor Summary
IlpNetworkHandlerWithDataSource(IlpMutableNetworkModel model, IlpNetworkView view, IlpNetworkController controller, IlpAbstractNodeAdapter adapter, IlpMutableDataSource datasource)
          Creates the handler.
IlpNetworkHandlerWithDataSource(IlpNetwork network)
          Creates the handler.
IlpNetworkHandlerWithDataSource(IlpNetwork network, IlpAbstractNodeAdapter adapter, IlpMutableDataSource datasource)
          Creates the handler.
 
Method Summary
protected  IlpDefaultClass createDefaultClass()
          Returns the graph handler default position attribute class.
protected  Object createObjectId(Class clazz, IlpAttributeGroup attributes, Map properties)
          Returns an object id for the creation of a new object.
protected  IlpGraphHandlerWithoutDataSource createSimpleHandler()
          Instantiates the non-datasource handler (an instance of IlpNetworkHandlerWithoutDataSource).
protected  String getClassName(IlpAttributeGroup attributes)
          Returns the class name for objects created by this handler.
protected  Logger getHandlerLogger()
          Use the correct logger for either IlpNetworkHandlerWithDataSource or IlpEquipmentHandlerWithDataSource.
 IlpNetwork getNetwork()
          Deprecated. Please use getNetworkModel, getNetworkView, getNetworkController instead.
 IlpNetworkController getNetworkController()
          Returns the controller that is associated to this handler and from which it gets its requests.
 IlpMutableNetworkModel getNetworkModel()
          Returns the model that is associated to this handler.
 IlpNetworkView getNetworkView()
          Returns the view that is associated to this handler.
 
Methods inherited from class ilog.cpl.graph.IlpGraphHandlerWithDataSource
findIlpClass, getAdapter, getDataSource, getGraphModel, getGraphView, handleChangeRelationship, handleCloneObject, handleCollapseObject, handleCreateObject, handleExpandObject, handleLoad, handleMoveObject, handleRemoveObject, handleUpdateObject, propagatePositionToDataSource, setDataSource, setGraphController, setGraphModel, setGraphView, setPropagatePositionToDataSource
 
Methods inherited from class ilog.cpl.graph.IlpAbstractGraphHandler
createObject, endBatch, getDefaultClass, getGraphController, startBatch
 
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

IlpNetworkHandlerWithDataSource

public IlpNetworkHandlerWithDataSource(IlpNetwork network)
Creates the handler.

Parameters:
network - The network component.

IlpNetworkHandlerWithDataSource

public IlpNetworkHandlerWithDataSource(IlpNetwork network,
                                       IlpAbstractNodeAdapter adapter,
                                       IlpMutableDataSource datasource)
Creates the handler.

Parameters:
network - The network component.
adapter - The adapter between the data source and the network model, usually an IlpNetworkAdapter.
datasource - The data source.

IlpNetworkHandlerWithDataSource

public IlpNetworkHandlerWithDataSource(IlpMutableNetworkModel model,
                                       IlpNetworkView view,
                                       IlpNetworkController controller,
                                       IlpAbstractNodeAdapter adapter,
                                       IlpMutableDataSource datasource)
Creates the handler.

Parameters:
model - The network component model.
view - The network component view.
controller - The network component controller.
adapter - The adapter between the data source and the network model.It is usually an IlpNetworkAdapter.
datasource - The data source.
Method Detail

getHandlerLogger

protected Logger getHandlerLogger()
Use the correct logger for either IlpNetworkHandlerWithDataSource or IlpEquipmentHandlerWithDataSource.

Specified by:
getHandlerLogger in class IlpAbstractGraphHandler
Returns:
The proper network logger for handler log messages.

createSimpleHandler

protected IlpGraphHandlerWithoutDataSource createSimpleHandler()
Instantiates the non-datasource handler (an instance of IlpNetworkHandlerWithoutDataSource).

Specified by:
createSimpleHandler in class IlpGraphHandlerWithDataSource
Internal method or field: do not use!

getClassName

protected String getClassName(IlpAttributeGroup attributes)
Description copied from class: IlpAbstractGraphHandler
Returns the class name for objects created by this handler.

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

createObjectId

protected Object createObjectId(Class clazz,
                                IlpAttributeGroup attributes,
                                Map properties)
Description copied from class: IlpAbstractGraphHandler
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().

Specified by:
createObjectId in class IlpAbstractGraphHandler
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.

createDefaultClass

protected IlpDefaultClass createDefaultClass()
Returns the graph handler default position attribute class. It is overridden by subclasses, but not documented.

Specified by:
createDefaultClass in class IlpAbstractGraphHandler
See Also:
IlpAbstractGraphHandler.getDefaultClass(), IlpAbstractGraphHandler.createObject(Class, IlpAttributeGroup, Map, Object)
Internal method or field: do not use!

getNetwork

public IlpNetwork getNetwork()
Deprecated. Please use getNetworkModel, getNetworkView, getNetworkController instead.

Gets the network that is associated to this handler.

Deprecated Since:
JTGO 3.1

getNetworkModel

public IlpMutableNetworkModel getNetworkModel()
Returns the model that is associated to this handler.


getNetworkView

public IlpNetworkView getNetworkView()
Returns the view that is associated to this handler.


getNetworkController

public IlpNetworkController getNetworkController()
Returns the controller that is associated to this handler and from which it gets its requests.



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