You can associate an object interactor
with a representation object by using either CSS or the API.
The following extract shows how to proceed
in CSS:
Network {
interactor: true;
}
object."ilog.tgo.model.IltNetworkElement" {
interactor: @+objInteractor;
}
Subobject#objInteractor {
class: 'ilog.cpl.interactor.IlpDefaultObjectInteractor';
}
The same configuration can be achieved
through the API, as follows:
IlpNetwork network = // ...
IlpNetworkController networkController = network.getController();
// Create an object interactor
IlpObjectInteractor objectInteractor = new IlpDefaultObjectInteractor();
networkController.setObjectInteractor( bo, objectInteractor);
// Configuring the specific object interactor is similar to configuring
// a view interactor.
objectInteractor.setGestureAction(IlpGesture.BUTTON3_CLICKED, new MyAction());
Actions related to mouse and keyboard events can be customized in
the same way as for the view interactor. You can also define a
pop-up menu factory in the same way as for the view interactor.
Refer to
Interacting with the network view.
An object interactor can also be
associated with a specific decoration that is part of the
business object graphic representation in the network view. Each
decoration represents a business attribute in the model.
Therefore the customization of the interactor for a specific
decoration takes into account the business object and a business
attribute as illustrated below: