Examples of PtolemyMenuFactory


Examples of ptolemy.vergil.toolbox.PtolemyMenuFactory

        interactor.addInteractor(_menuCreator);

        // The contents of the menu is determined by the associated
        // menu factory, which is a protected member of this class.
        // Derived classes can add menu items to it.
        _menuFactory = new PtolemyMenuFactory(controller);

        List configsList = Configuration.configurations();

        Configuration config = null;
        for (Iterator it = configsList.iterator(); it.hasNext();) {
            config = (Configuration) it.next();
            if (config != null)
                break;
        }

        //If a MenuFactory has been defined in the configuration, use this
        //one; otherwise, use the default Ptolemy one:
        if (config != null && _contextMenuFactoryCreator == null) {
            _contextMenuFactoryCreator = (ContextMenuFactoryCreator) config
                    .getAttribute("contextMenuFactory");
        }
        if (_contextMenuFactoryCreator != null) {
            try {
                _menuFactory = (PtolemyMenuFactory) _contextMenuFactoryCreator
                        .createContextMenuFactory(controller);
            } catch (Exception ex) {
                //do nothing - will default to ptii right-click menus
                System.out
                        .println("Unable to use the alternative right-click menu "
                                + "handler that was specified in the "
                                + "configuration; defaulting to ptii handler. "
                                + "Exception was: " + ex);
            }

        }

        // If the above has failed in any way, _menuFactory will still be null,
        // in which case we should default to ptii context menus
        if (_menuFactory == null) {
            _menuFactory = new PtolemyMenuFactory(controller);
        }

        // In this base class, there is only one configure command, so
        // there won't be a submenu. Subclasses convert this to a submenu.
        _configureMenuFactory = new MenuActionFactory(_configureAction);
View Full Code Here

Examples of ptolemy.vergil.toolbox.PtolemyMenuFactory

        interactor.addInteractor(_menuCreator);

        // The contents of the menu is determined by the associated
        // menu factory, which is a protected member of this class.
        // Derived classes can add menu items to it.
        _menuFactory = new PtolemyMenuFactory(controller);
        _menuFactory
                .addMenuItemFactory(new MenuActionFactory(_configureAction));
        _menuCreator.setMenuFactory(_menuFactory);

        // Add a double click interactor.
View Full Code Here

Examples of ptolemy.vergil.toolbox.PtolemyMenuFactory

        interactor.addInteractor(_menuCreator);

        // The contents of the menu is determined by the associated
        // menu factory, which is a protected member of this class.
        // Derived classes can add menu items to it.
        _menuFactory = new PtolemyMenuFactory(controller);
        _menuFactory
                .addMenuItemFactory(new MenuActionFactory(_configureAction));
        _menuCreator.setMenuFactory(_menuFactory);

        // Add a double click interactor.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.