Package javax.swing.event

Examples of javax.swing.event.MenuListener


        });

        // Arrange to always set the current window for use by the
        // CatalogHistoryItem class,
        // since the same items may be in the menus of multiple catalog windows
        _goMenu.addMenuListener(new MenuListener() {
            public void menuSelected(MenuEvent e) {
                _currentCatalogNavigator = _navigator;
            }

            public void menuDeselected(MenuEvent e) {
            }

            public void menuCanceled(MenuEvent e) {
            }
        });

        // Receive notification whenever a new catalog is displayed
        _navigator.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                // keep the Go history menu up to date
                _updateGoMenu();

                // Check if the catalog tree should be visible with this catalog
                updateCatalogTree();
            }
        });

        // Keep the query menu up to date
        _queryMenu.addMenuListener(new MenuListener() {
            public void menuSelected(MenuEvent e) {
                _currentCatalogNavigator = _navigator;
                _updateQueryMenu();
            }
View Full Code Here


        add(viewMenu = createViewMenu());
        add(goMenu = createGoMenu(null));

        // Arrange to always set the current window to use,
        // since the same items may be in the menus of multiple windows
        goMenu.addMenuListener(new MenuListener() {

            public void menuSelected(MenuEvent e) {
                currentHTMLViewer = htmlViewer;
            }
View Full Code Here

        add(_goMenu = createGoMenu(null));
        add(_graphicsMenu = new ImageGraphicsMenu(imageDisplay.getCanvasDraw()));

        // Arrange to always set the current image display for use by the ImageHistoryItem class,
        // since the same items may be in the menus of multiple image displays
        _goMenu.addMenuListener(new MenuListener() {

            public void menuSelected(MenuEvent e) {
                _currentImageDisplay = imageDisplay;
            }
View Full Code Here

       
        xbayaMenuItem.addSeparator();
       
        xbayaMenuItem.add(exitItem);
       
        xbayaMenuItem.addMenuListener(new MenuListener() {
     
      @Override
      public void menuSelected(MenuEvent e) {
        GraphCanvas graphCanvas = engine.getGUI().getGraphCanvas();
        saveAsWorkflowItem.setEnabled(isWorkflowTabPresent() && graphCanvas.getWorkflowFile()!=null);
View Full Code Here

        runMenu.add(this.resumeMonitoringItem);
        runMenu.add(this.pauseMonitoringItem);
        runMenu.add(this.resetMonitoringItem);
        runMenu.add(this.configMonitorItem);
       
        runMenu.addMenuListener(new MenuListener(){
      @Override
      public void menuCanceled(MenuEvent e) {}
      @Override
      public void menuDeselected(MenuEvent e) {}
      @Override
View Full Code Here

    private JMenu buildInstrumentManagerMenu()
    {
        m_menuInstrumentManagers = new LargeMenu( "Instrument Managers" );
        m_menuInstrumentManagers.setMnemonic( 'I' );

        m_menuInstrumentManagers.addMenuListener( new MenuListener()
        {
            public void menuSelected( MenuEvent event )
            {
                rebuildInstrumentManagersMenu();
            }
View Full Code Here

                action.putValue( "InstrumentManagerConnection", connection );

                JMenu menu = new LargeMenu( action );

                // Set up a Listener to handle the selected event.
                menu.addMenuListener( new MenuListener()
                {
                    public void menuSelected( MenuEvent event )
                    {
                        JMenu menu = (JMenu)event.getSource();
                        Action action = menu.getAction();
View Full Code Here

                    action.putValue( "InstrumentableData", instrumentable );

                    JMenu menu = new LargeMenu( action );

                    // Set up a Listener to handle the selected event.
                    menu.addMenuListener( new MenuListener()
                    {
                        public void menuSelected( MenuEvent event )
                        {
                            JMenu menu = (JMenu)event.getSource();
                            Action action = menu.getAction();
View Full Code Here

                action.putValue( "InstrumentableData", child );

                JMenu menu = new LargeMenu( action );

                // Set up a Listener to handle the selected event.
                menu.addMenuListener( new MenuListener()
                {
                    public void menuSelected( MenuEvent event )
                    {
                        JMenu menu = (JMenu)event.getSource();
                        Action action = menu.getAction();

                        rebuildInstrumentableMenu(
                            menu,
                            (InstrumentManagerConnection)action.getValue(
                                "InstrumentManagerConnection" ),
                            (InstrumentableData)action.getValue(
                                "InstrumentableData" ) );
                    }

                    public void menuDeselected( MenuEvent event )
                    {
                    }

                    public void menuCanceled( MenuEvent event )
                    {
                    }
                } );

                instrumentableMenu.add( menu );
            }
        }
       
        // Instruments
        InstrumentData[] instruments = instrumentable.getInstruments();

        for( int i = 0; i < instruments.length; i++ )
        {
            InstrumentData instrument = instruments[ i ];

            if( showAll || instrument.isConfigured() )
            {
                String description = instrument.getDescription();

                Action action = new AbstractAction( description )
                {
                    public void actionPerformed( ActionEvent event )
                    {
                    }
                };
                action.putValue( "InstrumentManagerConnection", connection );
                action.putValue( "InstrumentableData", instrumentable );
                action.putValue( "InstrumentData", instrument );

                JMenu menu = new LargeMenu( action );

                // Set up a Listener to handle the selected event.
                menu.addMenuListener( new MenuListener()
                {
                    public void menuSelected( MenuEvent event )
                    {
                        JMenu menu = (JMenu)event.getSource();
                        Action action = menu.getAction();
View Full Code Here

    private JMenu buildOptionsMenu()
    {
        m_menuOptions = new LargeMenu( "Options" );
        m_menuOptions.setMnemonic( 'O' );

        m_menuOptions.addMenuListener( new MenuListener()
        {
            public void menuSelected( MenuEvent event )
            {
                rebuildOptionsMenu();
            }
View Full Code Here

TOP

Related Classes of javax.swing.event.MenuListener

Copyright © 2018 www.massapicom. 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.