Package org.jamesii.gui.application.action

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


      runExpAction =
          new RunExpAction(experiment, getWindowManager(),
              ExperimentPerspective.getExperimentObservationManager(),
              new IExperimentExecutionListener[] {}, this);
    }
    return new IAction[] { new ActionIAction(runExpAction,
        "org.jamesii.experiments.runexp", new String[] { "" }, this) };
  }
View Full Code Here


    actions.add(new SimSpExExperiment(getWindowManager(), null));

    actions.add(SeparatorAction.getSeparatorFor(
        "org.jamesii.menu.main/org.jamesii.simspex?after=org.jamesii.simspex.simspaceexp", null));
    actions.add(new ActionIAction(new ConfigurePerfDBAction(
        "Configure Performance DB..."), "org.jamesii.simspex.perfdb",
        new String[] { MENU_MAIN_SIMSPEX }, null));
    actions.add(SeparatorAction.getSeparatorFor(
        "org.jamesii.menu.main/org.jamesii.simspex?after=org.jamesii.simspex.perfdb", null));
    actions.add(new ActionIAction(new ConfigureSPDMAction("Choose ML..."),
        "org.jamesii.simspex.chooseml", new String[] { MENU_MAIN_SIMSPEX }, null));
    actions.add(new ActionIAction(new javax.swing.AbstractAction(
        "Extract Features...") {
      private static final long serialVersionUID = 1L;

      @Override
      public void actionPerformed(ActionEvent e) {
        getWindowManager().addWindow(new FeatureExtractionDialog());
      }
    }, "org.jamesii.simspex.extrfeatures", new String[] { MENU_MAIN_SIMSPEX }, null));
    actions.add(new ActionIAction(new ClearPerfDBAction(), "org.jamesii.simspex.cleardb",
        new String[] { "org.jamesii.toolbar.main?after=org.jamesii.simspex.startrec",
            "org.jamesii.menu.main/org.jamesii.simspex?after=org.jamesii.simspex.startrec" }, null));

    // TODO: return whole actions list to 're-activate' the UI
    return actions.subList(0, 1);
View Full Code Here

            }

            @Override
            protected IAction[] generateActions() {
              if (runAction != null) {
                return new IAction[] { new ActionIAction(runAction,
                    runAction.toString(), new String[] { "" }, this) };
              }
              return null;
            }
View Full Code Here

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

    // check whether label is propagated from a to ta
    a.setLabel("label2");
    assertEquals("label2", ta.getValue(Action.NAME));
    assertEquals("label2", a.getLabel());

    // check whether label is propagated from ta to a
    ta.putValue(Action.NAME, "label3");
    assertEquals("label3", a.getLabel());
    assertEquals("label3", ta.getValue(Action.NAME));
  }
View Full Code Here

   * {@link org.jamesii.gui.application.action.ActionIAction#getDescription()} .
   */
  public final void testGetDescription() {
    TestAction ta = new TestAction("label1");
    ta.putValue(Action.LONG_DESCRIPTION, "description1");
    ActionIAction a = new ActionIAction(ta, "testAction", new String[0], null);
    assertNotNull(a);
    assertEquals("description1", a.getDescription());

    // check whether description is propagated from ta to a
    ta.putValue(Action.LONG_DESCRIPTION, "description2");
    assertEquals("description2", a.getDescription());
    assertEquals("description2", ta.getValue(Action.LONG_DESCRIPTION));
  }
View Full Code Here

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

    ta.putValue(Action.SMALL_ICON, null);
    assertNull(ta.getValue(Action.SMALL_ICON));
    assertNull(a.getIcon());

    Icon i =
        new ImageIcon(new BufferedImage(16, 16, BufferedImage.TYPE_INT_RGB));
    ta.putValue(Action.SMALL_ICON, i);
    assertEquals(i, ta.getValue(Action.SMALL_ICON));
    assertEquals(i, a.getIcon());
  }
View Full Code Here

   * .
   */
  public final void testGetShortDescription() {
    TestAction ta = new TestAction("label1");
    ta.putValue(Action.SHORT_DESCRIPTION, "description1");
    ActionIAction a = new ActionIAction(ta, "testAction", new String[0], null);
    assertNotNull(a);
    assertEquals("description1", a.getShortDescription());

    // check whether description is propagated from ta to a
    ta.putValue(Action.SHORT_DESCRIPTION, "description2");
    assertEquals("description2", a.getShortDescription());
    assertEquals("description2", ta.getValue(Action.SHORT_DESCRIPTION));
  }
View Full Code Here

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

    // check whether enabled is propagated from a to ta
    a.setEnabled(true);
    assertTrue(ta.isEnabled());
    assertTrue(a.isEnabled());
    a.setEnabled(false);
    assertFalse(ta.isEnabled());
    assertFalse(a.isEnabled());

    // check whether enabled is propagated from ta to a
    ta.setEnabled(true);
    assertTrue(ta.isEnabled());
    assertTrue(a.isEnabled());
    ta.setEnabled(false);
    assertFalse(ta.isEnabled());
    assertFalse(a.isEnabled());
  }
View Full Code Here

   * Test method for
   * {@link org.jamesii.gui.application.action.ActionIAction#getKeyStroke()} .
   */
  public final void testGetKeyStroke() {
    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.ACCELERATOR_KEY, KeyStroke.getKeyStroke("ctrl A"));
    assertEquals(KeyStroke.getKeyStroke("ctrl A"),
        KeyStroke.getKeyStroke(a.getKeyStroke()));
    ta.putValue(Action.ACCELERATOR_KEY,
        KeyStroke.getKeyStroke("ctrl alt shift ENTER"));
    assertEquals(KeyStroke.getKeyStroke("ctrl alt shift ENTER"),
        KeyStroke.getKeyStroke(a.getKeyStroke()));
    ta.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("A"));
    assertEquals(KeyStroke.getKeyStroke("A"),
        KeyStroke.getKeyStroke(a.getKeyStroke()));
  }
View Full Code Here

   * Test method for
   * {@link org.jamesii.gui.application.action.ActionIAction#getMnemonic()}.
   */
  public final void testGetMnemonic() {
    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.MNEMONIC_KEY, KeyEvent.VK_0);
    assertEquals(KeyEvent.VK_0, a.getMnemonic().intValue());
    ta.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_1);
    assertEquals(KeyEvent.VK_1, a.getMnemonic().intValue());
  }
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.