Package java.awt.event

Examples of java.awt.event.ActionEvent


            listeners.removeElement(l);
        }
    }

    public boolean action() {
        ActionEvent evt = null;
        for (int i = listeners == null ? -1 : listeners.size() - 1; i >= 0; i--) {
            if (evt == null) {
                evt = new ActionEvent(this, 1001, getName());
            }
            ((ActionListener) listeners.elementAt(i)).actionPerformed(evt);
        }
        return false;
    }
View Full Code Here


   */
  public void setSelectedTab(int idx) {
    sel = idx;
    if (sel != -1) {
      int s = listenerList.size();
      ActionEvent aevt = null;
      for (int i = s - 1; i >= 0; i--) {
        if (aevt == null) {
          aevt = new ActionEvent(TabbedPanel.this, ActionEvent.ACTION_PERFORMED,
                                 ""); //$NON-NLS-1$
        }
        ( (ActionListener) listenerList.elementAt(i)).actionPerformed(aevt);
      }
      Component c = getComponent(sel);
View Full Code Here

      return preferredSize;
    }

    public void mouseClicked(MouseEvent e) {
      if (callback != null) {
        callback.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "clicked")); //$NON-NLS-1$
      }
      hideAndRemove(this);
    }
View Full Code Here

            return preferredSize;
        }

        public void mouseClicked(MouseEvent e) {
            if (callback != null) {
                callback.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "clicked"));
            }
            hideAndRemove(this);
        }
View Full Code Here

        public void mouseClicked(MouseEvent e) {
            if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) {
                int clicked = getIndexForLocation(e.getX(), e.getY());
                if (clicked != -1 && clicked < menu.getChildCount()) {
                    Action action = menu.getChild(clicked);
                    action.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, action.getName(), e.getModifiers()));
                }
            }
            hideMenuWindow();

        }
View Full Code Here

            else if (arg.equals(correctLabel(language.getText("settings")))) {
                launchOptionsDialog();
            }
        } else if (evt.getSource() instanceof Document) {
            if (checkCurrentProject()) {
                final ActionEvent ae = evt;
                getUndoManager().undoableEdit("StartupDocument",
                        new Runnable() {
                            public void run() {
                                openStartupDocument((Document) ae.getSource());
                            }
                        });
            }
        } // //////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Test if it's buttons actions
View Full Code Here

            putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(
                    SHORTCUT_KEYS[index - 1], MENU_MASK));
    }

    public void actionPerformed(ActionEvent e) {
        listener.actionPerformed(new ActionEvent(document, e.getID(), e
                .getActionCommand()));
    }
View Full Code Here

    addApplicationListener( new ApplicationAdapter() {

      public void handleAbout( ApplicationEvent event ) {
        if (aboutAction != null) {
          event.setHandled( true );        
          aboutAction.actionPerformed( new ActionEvent(event.getSource(),
                  MacApp.this.sequence++,
                  Parser.ATTR_MACOS_ABOUT ));
        } else {
          super.handleAbout( event );
        }
      }

      public void handleOpenApplication( ApplicationEvent event ) {
        if (appAction != null) {
          appAction.actionPerformed( new ActionEvent(event.getSource(),
                  MacApp.this.sequence++,
                  Parser.ATTR_MACOS_OPENAPP) );
          event.setHandled( true );
        } else {
          super.handleOpenApplication( event );
        }
      }

      public void handleOpenFile( ApplicationEvent event ) {
        if (fileAction != null) {
          fileAction.actionPerformed( new ActionEvent(event.getSource(),
                  MacApp.this.sequence++,
                  Parser.ATTR_MACOS_OPENFILE) );
          event.setHandled( true );
        } else {
          super.handleOpenFile( event );
        }
      }

      public void handlePreferences( ApplicationEvent event ) {
        if (prefAction != null) {
          prefAction.actionPerformed( new ActionEvent(event.getSource(),
                  MacApp.this.sequence++,
                  Parser.ATTR_MACOS_PREF) );
          event.setHandled( true );
        } else {
          super.handlePreferences( event );
        }
      }

      public void handlePrintFile( ApplicationEvent event ) {
        if (printAction != null) {
          printAction.actionPerformed( new ActionEvent(event.getSource(),
                  MacApp.this.sequence++,
                  Parser.ATTR_MACOS_PRINT) );
          event.setHandled( true );
        } else {
          super.handlePrintFile( event );
        }
      }

      public void handleQuit( ApplicationEvent event ) {
        if (quitAction != null) {
          quitAction.actionPerformed( new ActionEvent(event.getSource(),
                  MacApp.this.sequence++,
                  Parser.ATTR_MACOS_QUIT) );
          event.setHandled( true );
        } else {
          super.handleQuit( event );
        }
      }

      public void handleReOpenApplication( ApplicationEvent event ) {
        if (reopenAction != null) {
          reopenAction.actionPerformed( new ActionEvent(event.getSource(),
                  MacApp.this.sequence++,
                  Parser.ATTR_MACOS_OPENAPP) );
          event.setHandled( true );
        } else {
          super.handleReOpenApplication( event );
View Full Code Here

    // right click
    if (button == MouseEvent.BUTTON2 || button == MouseEvent.BUTTON3) {
      ActionListener actionListener = _pane.getRightClickActionListener(clickedTabIndex);
      if (actionListener != null) {
        actionListener.actionPerformed(new ActionEvent(e, clickedTabIndex, "right-click"));
      }
    }
  }
View Full Code Here

      }
    }
  }

  private void notifyListeners() {
    ActionEvent event = new ActionEvent(this, _windows.size(), null);
    for (ActionListener listener : _windowListeners) {
      listener.actionPerformed(event);
    }
  }
View Full Code Here

TOP

Related Classes of java.awt.event.ActionEvent

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.