Package javax.swing

Examples of javax.swing.AbstractAction.actionPerformed()


        myProvider = provider;
    }

    public void actionPerformed(ActionEvent e) {
        AbstractAction activeAction = myProvider.getActiveAction();
        activeAction.actionPerformed(e);
    }

    public static interface ActiveActionProvider {
        public AbstractAction getActiveAction();
    }
View Full Code Here


        public void hyperlinkUpdate(HyperlinkEvent e) {
          if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
            if (e.getDescription().equals("StartTutorial")) {
              startTutorial.actionPerformed(null);
            } else if (e.getDescription().equals("StopTutorial")) {
              stopTutorial.actionPerformed(null);
            } else {
              try {
                tutorialArea.setPage(e.getURL());
              } catch (IOException e1) {
                MessageCenter.getInstance().getLogger().error(
View Full Code Here

        public void hyperlinkUpdate(HyperlinkEvent e) {
          if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
            if (e.getDescription().equals("StartTutorial")) {
              startTutorial.actionPerformed(null);
            } else if (e.getDescription().equals("StopTutorial")) {
              stopTutorial.actionPerformed(null);
            } else {
              try {
                tutorialArea.setPage(e.getURL());
              } catch (IOException e1) {
                MessageCenter.getInstance().getLogger().error(
View Full Code Here

    AbstractAction aa=lastActions.get(jb);
    if (aa==null) {
      JOptionPane.showMessageDialog(this, "Keine Aktion gewählt", "Aktion nicht möglich", JOptionPane.WARNING_MESSAGE);
      return;
    }
    aa.actionPerformed(e);
  }
 
  private class CreateGenreAction extends AbstractAction {
    public CreateGenreAction() {
      super("G");
View Full Code Here

                a = new DecreaseSpeedAction();
                break;
            default:
                return;
            }
            a.actionPerformed(null);
        }
    }

    public Locomotive getMyLocomotive() {
        return myLocomotive;
View Full Code Here

        frame.getContentPane().add(b1, 0);
        frame.getContentPane().add(b2, 2);
        AbstractAction action = ui.new NavigateAction();
        action.putValue(Action.NAME, "navigateNext");
        b1.requestedFocus = false;
        action.actionPerformed(null);
        assertTrue(b1.requestedFocus);
        action.putValue(Action.NAME, "navigatePrevious");
        b2.requestedFocus = false;
        action.actionPerformed(null);
        assertTrue(b2.requestedFocus);
View Full Code Here

        assertTrue(b2.requestedFocus);
    }

    public void testCloseAction() {
        AbstractAction action = ui.new CloseAction();
        action.actionPerformed(null);
        assertTrue(desktop.getSelectedFrame().isClosed());
    }

    public void testMaximizeAction() {
        AbstractAction action = ui.new MaximizeAction();
View Full Code Here

        assertTrue(desktop.getSelectedFrame().isClosed());
    }

    public void testMaximizeAction() {
        AbstractAction action = ui.new MaximizeAction();
        action.actionPerformed(null);
        assertTrue(desktop.getSelectedFrame().isMaximum());
    }

    public void testMinimizeAction() {
        AbstractAction action = ui.new MinimizeAction();
View Full Code Here

        assertTrue(desktop.getSelectedFrame().isMaximum());
    }

    public void testMinimizeAction() {
        AbstractAction action = ui.new MinimizeAction();
        action.actionPerformed(null);
        assertTrue(desktop.getSelectedFrame().isIcon());
    }

    public void testOpenAction() throws PropertyVetoException {
        AbstractAction action = ui.new OpenAction();
View Full Code Here

    }

    public void testOpenAction() throws PropertyVetoException {
        AbstractAction action = ui.new OpenAction();
        desktop.getSelectedFrame().setMaximum(true);
        action.actionPerformed(null);
        assertFalse(desktop.getSelectedFrame().isMaximum());
        desktop.getSelectedFrame().setIcon(true);
        action.actionPerformed(null);
        assertFalse(desktop.getSelectedFrame().isIcon());
    }
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.