Set a select interactor to a network

Article ID: 2138
Last updated: 28 May, 2018
Article ID: 2138
Last updated: 28 May, 2018
Revision: 3
Views: 584
Posted: 02 Mar, 2011
by Dean J.
Updated: 28 May, 2018
by Gargani A.

Question

How do I set a select interactor to a network?

Answer

There are several ways to set a select interactor to a network.

  • Using the configuration file

    You can configure the toolbar to contain the select interactor button,through CSS in the following way:

    Network {
    interactor: true;
    toolbar: true;
    ...
    }
    ToolBar {
    enabled: true;
    button[0]: @+SelectButton;
    ...
    }
    #SelectButton {
    actionType: "Select";
    //Adjusting bean properties of interactor...
    usingObjectInteractor: true;
    opaqueMove: true;
    ...
    }
    ...

    Then you can also set the select interactor as the default view interactor in the network, as follows:

    Interactor {
    name: "Select";
    }

  • Using the predefined interactors

    Some interactors are recognized by their name. You can use the method setDefaultViewInteractorName with the string "Select" as parameter, in the following way:
    network.getView().setDefaultViewInteractorName("Select");

  • Using the class IltSelectInteractor

    This alternative can be useful when you want to customize your select interactor, that is, when you need to work with an instance of the class IltSelectInteractor.
    To add an IltSelectInteractor through the API, you must create an instance of the class IlpViewsViewInteractor with the select interactor as parameter in the constructor of this class. Then, you can set this view interactor to the network.
    The following code extract illustrates this alternative:

    IltSelectInteractor selInteractor = new IltSelectInteractor();
    selInteractor.setMoveAllowed(false);
    IlpViewsViewInteractor graphicViewsInteractor =
    new IlpViewsViewInteractor(selInteractor);
    network.setViewInteractor(viewsInteractor);

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2138
Last updated: 28 May, 2018
Revision: 3
Views: 584
Posted: 02 Mar, 2011 by Dean J.
Updated: 28 May, 2018 by Gargani A.
Also listed in


Others in this category