public abstract class IlpGraphController extends IlpAbstractGraphicController
lastInteractedObject, lastInteractionStates| Modifier | Constructor and Description |
|---|---|
protected |
IlpGraphController(IlpContext context)
Creates a controller.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanMutableStyleSheet(Collection objects)
Removes dynamic rules that have been added to the component
mutable style sheet.
|
void |
cloneObject(Collection objects)
Requests the creation of a set of copied objects.
|
void |
collapseObject(IlpRepresentationObject object)
Requests the collapse of a container object.
|
Object |
createObject(Class clazz,
IlpAttributeGroup attributes,
Map properties,
IlpPosition position)
Requests the creation of an object belonging to a given class,
with a set of attributes, and with a given position.
|
void |
expandObject(IlpRepresentationObject object)
Requests the expansion of a container object.
|
IlpObjectInteractor |
getCollapsionBackgroundInteractor()
Returns the interactor attached to the background of a subnetwork.
|
IlpObjectInteractor |
getCollapsionIconInteractor()
Returns the interactor attached to the collapse icon of a subnetwork.
|
IlpObjectInteractor |
getCompleteObjectInteractor(IlpRepresentationObject object)
Returns the interactor responsible for handling events on the given object
in the graphic view controlled by this instance.
|
protected abstract Logger |
getControllerLogger()
Access the logger.
|
protected abstract IlpGraphHandler |
getDefaultHandler()
Retrieves the default handler.
|
protected abstract Class |
getDefaultHandlerClass()
Retrieves the default handler class.
|
IlpExpansionHandler |
getExpansionHandler()
Returns the handler for container operations.
|
IlpObjectInteractor |
getExpansionIconInteractor()
Returns the interactor attached to the icon of a collapsed subnetwork.
|
IlpObjectInteractor |
getExpansionInteractor()
Returns the interactor attached to the base element of a collapsed
subnetwork.
|
Component |
getFocusEventComponent()
Returns the component, closely related to the view, whose focus events
shall be forwarded to the interactor.
|
IlpGraphHandler |
getGraphHandler()
Returns the handler for everything.
|
protected IlpGraphView |
getGraphView()
Access the view.
|
Component |
getKeyEventComponent()
Returns the component, closely related to the view, whose key events
shall be forwarded to the interactor.
|
IlpLoadHandler |
getLoadHandler()
Returns the handler for load operations.
|
Component |
getMouseEventComponent()
Returns the component, closely related to the view, whose mouse events
shall be forwarded to the interactor.
|
IlpNodeHandler |
getNodeHandler()
Returns the handler for object-related operations.
|
IlpInteractionState |
getObjectInteractionState(IlpObjectInteractor oInteractor,
IlpObjectInteractionContext context)
Looks up the interaction state corresponding to the given context
used by object interaction.
|
IlpPositionHandler |
getPositionHandler()
Returns the handler for move/reshape operations.
|
void |
handleChangeRelationship(IlpRepresentationNode object,
IlpRepresentationNode parent,
IlpPosition position)
Requests the change of relationship of an object.
|
boolean |
isUsingCustomHandler()
Verifies which handler is being used.
|
void |
load(URL modelDescription)
Erases the model and loads a new set of objects, given as a URL, into it.
|
void |
moveObject(Map newPositions)
Requests a change to the position or shape of a set of representation
objects.
|
void |
removeObject(Collection objects)
Requests the deletion of a set of objects.
|
void |
removeObjectInteractors(IlpRepresentationObject object)
Removes all the interactors associated with the given object.
|
void |
setCollapsionBackgroundInteractor(IlpObjectInteractor collapsionBackgroundInteractor)
Sets the interactor attached to the background of a subnetwork.
|
void |
setCollapsionIconInteractor(IlpObjectInteractor collapsionIconInteractor)
Sets the interactor attached to the collapse icon of a subnetwork.
|
void |
setExpansionHandler(IlpExpansionHandler expansionHandler)
Sets the handler for container operations.
|
void |
setExpansionIconInteractor(IlpObjectInteractor expansionIconInteractor)
Sets the interactor attached to the icon of a collapsed subnetwork.
|
void |
setExpansionInteractor(IlpObjectInteractor expansionInteractor)
Sets the interactor attached to the base element of a collapsed subnetwork.
|
void |
setGraphHandler(IlpGraphHandler handler)
Sets the handler for everything.
|
void |
setLoadHandler(IlpLoadHandler loadHandler)
Sets the handler for load operations.
|
void |
setNodeHandler(IlpNodeHandler nHandler)
Sets the handler for object-related operations.
|
void |
setPositionHandler(IlpPositionHandler positionHandler)
Sets the handler for move/reshape operations.
|
void |
setViewInteractor(IlpViewInteractor interactor)
Sets the interactor associated with the view.
|
void |
updateObject(IlpRepresentationNode object,
Map newValues)
Requests a change to some properties of an object.
|
attach, attachView, createGraphicViewStyleManager, createViewInteractionContext, detach, focusGained, focusLost, getContext, getDefaultInteractorManager, getDefaultViewInteractor, getObjectInteractor, getObjectInteractor, getObjectInteractor, getObjectInteractor, getObjectInteractor, getView, getViewInteractionContext, getViewInteractor, initGraphicViewStyleManager, initInteractorManager, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, removeObjectInteractors, removeObjectInteractors, setDefaultInteractorManager, setDefaultViewInteractor, setObjectInteractor, setObjectInteractor, setObjectInteractor, setObjectInteractor, setObjectInteractorprotected IlpGraphController(IlpContext context)
IlpGraphView by calling setController
on the view.context - The context to be used within the controller.protected abstract Logger getControllerLogger()
protected IlpGraphView getGraphView()
public Component getMouseEventComponent()
IlpAbstractGraphicControllergetMouseEventComponent in class IlpAbstractGraphicControllerpublic Component getKeyEventComponent()
IlpAbstractGraphicControllergetKeyEventComponent in class IlpAbstractGraphicControllerpublic Component getFocusEventComponent()
IlpAbstractGraphicControllergetFocusEventComponent in class IlpAbstractGraphicControllerpublic void setViewInteractor(IlpViewInteractor interactor)
IlpAbstractGraphicControllersetViewInteractor in interface IlpGraphicControllersetViewInteractor in class IlpAbstractGraphicControllerprotected abstract Class getDefaultHandlerClass()
protected abstract IlpGraphHandler getDefaultHandler()
public IlpNodeHandler getNodeHandler()
public void setNodeHandler(IlpNodeHandler nHandler)
public IlpPositionHandler getPositionHandler()
public void setPositionHandler(IlpPositionHandler positionHandler)
public IlpExpansionHandler getExpansionHandler()
public void setExpansionHandler(IlpExpansionHandler expansionHandler)
public IlpLoadHandler getLoadHandler()
public void setLoadHandler(IlpLoadHandler loadHandler)
public IlpGraphHandler getGraphHandler()
This method returns the handler if set through setGraphHandler.
The method returns null if individual handlers have been
installed for object-related, move/reshape, container, loading or editing
operations.
null.setGraphHandler(ilog.cpl.graph.IlpGraphHandler),
getNodeHandler(),
getPositionHandler(),
getExpansionHandler(),
getLoadHandler()public void setGraphHandler(IlpGraphHandler handler)
The default handler for the network component is
IlpNetworkHandlerWithoutDataSource; there is a predefined
handler to be used with data source
(IlpNetworkHandlerWithDataSource).
Similarly, there is the IlpEquipmentHandlerWithoutDataSource
and IlpEquipmentHandlerWithDataSource for the equipment
component.
IlpNetworkHandlerWithoutDataSource,
IlpNetworkHandlerWithDataSource,
IlpEquipmentHandlerWithoutDataSource,
IlpEquipmentHandlerWithDataSourcepublic boolean isUsingCustomHandler()
true if the user has installed a non-default
(custom) handler. false if otherwise.public Object createObject(Class clazz, IlpAttributeGroup attributes, Map properties, IlpPosition position)
clazz - A subclass 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.position - The desired position/shape of the object,
or null.null if the object could not be created by
this controller.IlpNodeHandler.handleCreateObject(java.lang.Class<?>, ilog.cpl.model.IlpAttributeGroup, java.util.Map<java.lang.String, java.lang.Object>, ilog.cpl.graphic.IlpPosition)public void removeObject(Collection objects)
objects - A collection of IlpRepresentationNodes.IlpNodeHandler.handleRemoveObject(java.util.Collection<? extends ilog.cpl.model.container.IlpRepresentationNode>)protected void cleanMutableStyleSheet(Collection objects)
This method is used to remove object selectors from the mutable
style sheet when the objects are removed from the model after a user
interaction. Selectors of type: #id and #id:linkLayoutRenderer
are removed.
objects - Collection of IlpRepresentationObjectremoveObject(Collection)public void updateObject(IlpRepresentationNode object, Map newValues)
object - The representation object.newValues - A map, mapping each IlpAttribute to be
changed to its new values.public void cloneObject(Collection objects)
objects - A collection of IlpRepresentationNodes.IlpNodeHandler.handleCloneObject(java.util.Collection<? extends ilog.cpl.model.container.IlpRepresentationNode>)public void handleChangeRelationship(IlpRepresentationNode object, IlpRepresentationNode parent, IlpPosition position)
object - The representation object.parent - The new parent of the object; null
implies a root object.position - The position of the object.IlpNodeHandler.handleChangeRelationship(ilog.cpl.model.IlpRepresentationObject, ilog.cpl.model.IlpRepresentationObject, ilog.cpl.graphic.IlpPosition)public void moveObject(Map newPositions)
newPositions - A map from IlpRepresentationNode to
IlpPositionChange.IlpPositionHandler.handleMoveObject(java.util.Map<ilog.cpl.model.container.IlpRepresentationNode, ilog.cpl.graph.IlpPositionChange>)public void expandObject(IlpRepresentationObject object)
object - The container to be expanded.IlpExpansionHandler.handleExpandObject(ilog.cpl.model.IlpRepresentationObject)public void collapseObject(IlpRepresentationObject object)
object - The container to be collapsed.IlpExpansionHandler.handleCollapseObject(ilog.cpl.model.IlpRepresentationObject)public void load(URL modelDescription)
IlpLoadHandler.handleLoad(java.net.URL)public void removeObjectInteractors(IlpRepresentationObject object)
removeObjectInteractors in interface IlpMutableInteractorManagerremoveObjectInteractors in class IlpAbstractGraphicControllerpublic IlpObjectInteractor getCompleteObjectInteractor(IlpRepresentationObject object)
getCompleteObjectInteractor in class IlpAbstractGraphicControllerpublic IlpInteractionState getObjectInteractionState(IlpObjectInteractor oInteractor, IlpObjectInteractionContext context)
getObjectInteractionState in class IlpAbstractGraphicControlleroInteractor - The object interactor.context - The context in which the event occurred.public IlpObjectInteractor getCollapsionIconInteractor()
public void setCollapsionIconInteractor(IlpObjectInteractor collapsionIconInteractor)
collapsionIconInteractor - The new interactor.public IlpObjectInteractor getCollapsionBackgroundInteractor()
public void setCollapsionBackgroundInteractor(IlpObjectInteractor collapsionBackgroundInteractor)
collapsionBackgroundInteractor - The new interactor.public IlpObjectInteractor getExpansionIconInteractor()
public void setExpansionIconInteractor(IlpObjectInteractor expansionIconInteractor)
expansionIconInteractor - The new interactor.public IlpObjectInteractor getExpansionInteractor()
public void setExpansionInteractor(IlpObjectInteractor expansionInteractor)
expansionInteractor - The new interactor.© Copyright Rogue Wave Software, Inc. 1997, 2017. All Rights Reserved.