Package org.jamesii.gui.application.action

Examples of org.jamesii.gui.application.action.ActionIAction


   * Test method for
   * {@link org.jamesii.gui.application.action.ActionIAction#isToggleOn()}.
   */
  public final void testIsToggleOn() {
    TestAction ta = new TestAction("label1");
    ActionIAction a = new ActionIAction(ta, "testAction", new String[0], null);
    assertNotNull(a);

    // check whether keystroke is propagate from ta to a
    ta.putValue(Action.SELECTED_KEY, false);
    assertEquals(false, a.isToggleOn());
    ta.putValue(Action.SELECTED_KEY, true);
    assertEquals(true, a.isToggleOn());
  }
View Full Code Here


   * Test method for
   * {@link org.jamesii.gui.application.action.ActionIAction#ActionIAction(Action, String, String[], org.jamesii.gui.application.IWindow)}
   * .
   */
  public final void testActionIAction() {
    assertNotNull(new ActionIAction(new TestAction(""), "testAction",
        new String[0], null));

    try {
      new ActionIAction(new TestAction(""), "testAction", null, null);
      fail("Created IAction with paths == null");
    } catch (Exception e) {
    }
    try {
      new ActionIAction(null, "testAction", new String[0], null);
      fail("Created IAction from null Action");
    } catch (Exception e) {
    }
  }
View Full Code Here

   * Test method for
   * {@link org.jamesii.gui.application.action.ActionIAction#execute()}.
   */
  public final void testExecute() {
    TestAction ta = new TestAction("label1");
    ActionIAction a = new ActionIAction(ta, "testAction", new String[0], null);
    assertNotNull(a);

    assertFalse(ta.actionPerformed);
    a.execute();
    assertTrue(ta.actionPerformed);
  }
View Full Code Here

    l.taskInfo(this, "Creating Perspectives...");
    ActionManager.registerAction(new ActionSet("org.jamesii.file", "File",
        "org.jamesii.menu.main?first", null));

    ActionManager.registerAction(new ActionIAction(new QuitAction(manager),
        "quit", new String[] { "org.jamesii.menu.main/org.jamesii.file?last" },
        null));

    initPerspectives(l, 1f / (taskCount) * task, 1f / (taskCount));

View Full Code Here

    actions.add(new SeparatorAction("org.jamesii.toolbar.edit",
        new String[] { "org.jamesii.toolbar.main?after=org.jamesii.save" },
        null));

    actions.add(new ActionIAction(new UndoAction(windowManager),
        "org.jamesii.undo", new String[] {
            "org.jamesii.toolbar.main?after=org.jamesii.toolbar.edit",
            "org.jamesii.menu.main/org.jamesii.edit?first" }, null));

    actions.add(new ActionIAction(new RedoAction(windowManager),
        "org.jamesii.redo", new String[] {
            "org.jamesii.toolbar.main?after=org.jamesii.undo",
            "org.jamesii.menu.main/org.jamesii.edit?after=org.jamesii.undo" },
        null));

    actions.add(new SeparatorAction("org.jamesii.toolbar.additionals",
        new String[] { "org.jamesii.toolbar.main?after=org.jamesii.redo" },
        null));
    actions
        .add(new SeparatorAction(
            "org.jamesii.edit.additionals",
            new String[] { "org.jamesii.menu.main/org.jamesii.edit?after=org.jamesii.redo" },
            null));

    actions.add(new ActionSet("org.jamesii.help", "Help",
        "org.jamesii.menu.main?last", null));

    actions.add(new AbstractAction("org.jamesii.showSystemInfo",
        "Show System Information",
        new String[] { "org.jamesii.menu.main/org.jamesii.help?first" }, null) {

      @Override
      public void execute() {
        BasicUtilities.invokeLaterOnEDT(new Runnable() {
          @Override
          public void run() {
            JavaInfo info = new JavaInfo();
            windowManager.addWindow(new SystemInfoView(info, "this system",
                Contribution.DIALOG));
          }
        });
      }

    });

    actions
        .add(new AbstractAction(
            "org.jamesii.showPlugInInfo",
            "Inspect PlugIns",
            new String[] { "org.jamesii.menu.main/org.jamesii.help?after=org.jamesii.showSystemInfo" },
            null) {

          @Override
          public void execute() {
            BasicUtilities.invokeLaterOnEDT(new Runnable() {
              @Override
              public void run() {
                windowManager.addWindow(new PlugInView(Contribution.DIALOG));
              }
            });
          }

        });

    actions
        .add(new AbstractAction(
            "org.jamesii.showLogView",
            "Show Log View",
            new String[] { "org.jamesii.menu.main/org.jamesii.help?after=org.jamesii.showPlugInInfo" },
            null) {

          @Override
          public void execute() {
            BasicUtilities.invokeLaterOnEDT(new Runnable() {
              @Override
              public void run() {
                windowManager.addWindow(LogView.getInstance());
              }
            });
          }

        });

    actions.add(new ActionIAction(new HelpAction(), "help",
        new String[] { "org.jamesii.menu.main/org.jamesii.help" }, null));

    actions
        .add(new AbstractAction(
            "org.jamesii.showBackgroundTaskManager",
View Full Code Here

          ExperimentReadAction a =
              new ExperimentReadAction(this, dialog,
                  dialog.getMenuDescription());
          actions
              .add(new ActionIAction(
                  a,
                  "org.jamesii.experiment." + dialog.hashCode(),
                  new String[] {
                      "org.jamesii.menu.main/org.jamesii.file/org.jamesii.open/org.jamesii.open.experiment",
                      "org.jamesii.toolbar.main/org.jamesii.open/org.jamesii.open.experiment" },
                  null));
        } catch (Exception e) {
          SimSystem.report(e);
        }

      }

      // TODO: integrate experiment suites
      // actions
      // .add(new ActionSet(
      // "org.jamesii.experimentsuites.open",
      // "Experiment Suite",
      // new String[] {
      // "org.jamesii.menu.main/org.jamesii.file/org.jamesii.open?after=org.jamesii.experiment.open",
      // "org.jamesii.toolbar.main/org.jamesii.open?after=org.jamesii.experiment.open"
      // }));
      // actions.addAll(initMenu("org.jamesii.experimentsuites.open", new
      // String[] {
      // "org.jamesii.menu.main/org.jamesii.file/org.jamesii.open",
      // "org.jamesii.toolbar.main/org.jamesii.open" }, DialogTask.READ_SUITE));

      paramBlock =
          FactoryParameterDialogParameter.getParameterBlock(
              ExperimentSuiteReaderFactory.class, null);

      factories =
          SimSystem.getRegistry().getFactoryList(
              AbstractFactoryParameterDialogFactory.class, paramBlock);

      for (FactoryParameterDialogFactory<?, ?, ?> f : factories) {
        IFactoryParameterDialog<?> dialog = f.create(paramBlock, SimSystem.getRegistry().createContext());

        ExperimentSuiteReadAction a =
            new ExperimentSuiteReadAction(this, dialog,
                dialog.getMenuDescription());
        actions
            .add(new ActionIAction(
                a,
                "org.jamesii.experiment." + dialog.hashCode(),
                new String[] {
                    "org.jamesii.menu.main/org.jamesii.file/org.jamesii.open/org.jamesii.open.experimentsuite",
                    "org.jamesii.toolbar.main/org.jamesii.open/org.jamesii.open.experimentsuite" },
View Full Code Here

            }
          }
        };

    IAction runExpAct =
        new ActionIAction(runExpAction, "expoverview.runexpaction",
            new String[] { "" }, this);

    IAction stopSimAct =
        new ActionIAction(stopSimAction, "expoverview.stopsimaction",
            new String[] { "" }, this);

    IAction runSimAct =
        new ActionIAction(runSimAction, "expoverview.runsimaction",
            new String[] { "" }, this);

    IAction nextStepSimAct =
        new ActionIAction(nextStepSimAction, "expoverview.nextstepsimaction",
            new String[] { "" }, this);

    IAction nStepsSimAct =
        new ActionIAction(nStepsSimAction, "expoverview.nstepssimaction",
            new String[] { "" }, this);

    IAction sliderAction =
        new ActionIAction(sliderSimAction, "expoverview.slideraction",
            new String[] { "" }, this);

    IAction strucViewAction =
        new ActionIAction(strucModelViewAction, "expoverview.strucviewaction",
            new String[] { "" }, this);

    return new IAction[] { clearAction, exportAction,
        SeparatorAction.getSeparatorFor("", this), runExpAct,
        SeparatorAction.getSeparatorFor("", this), stopSimAct, runSimAct,
View Full Code Here

TOP

Related Classes of org.jamesii.gui.application.action.ActionIAction

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.