Examples of JCPAction


Examples of org.openscience.jchempaint.action.JCPAction

        try {
            // For some reason this does not work
            // applet.button("undo").click();
            // panel.get2DHub().updateView();
            // so we crank the lever manually
            JCPAction act = new JCPAction().getAction(panel, "org.openscience.jchempaint.action.UndoAction");
            act.actionPerformed(null);
    } catch (Exception e) {
      Assert.fail();
    }
        panel.get2DHub().updateView();
        applet.panel("renderpanel").robot.waitForIdle();
View Full Code Here

Examples of org.openscience.jchempaint.action.JCPAction

    Assert.assertEquals(6, atomCount);
    Assert.assertEquals(5, bondCount);
    Assert.assertEquals(14, implicitHCount);
 
    try {
            JCPAction act = new JCPAction().getAction(panel, "org.openscience.jchempaint.action.UndoAction");
            act.actionPerformed(null);
    } catch (NullPointerException e) {
          Assert.fail();
    }

        atomCount=0; bondCount=0;
View Full Code Here

Examples of org.openscience.jchempaint.action.JCPAction

        try {
            // For some reason this does not work
            // applet.button("cleanup").click();
            // panel.get2DHub().updateView();
            // so we crank the lever manually
            JCPAction act = new JCPAction().getAction(panel, "org.openscience.jchempaint.action.CleanupAction");
            act.actionPerformed(null);
    } catch (Exception e) {
      Assert.fail();
    }
        panel.get2DHub().updateView();
        applet.panel("renderpanel").robot.waitForIdle();
View Full Code Here

Examples of org.openscience.jchempaint.action.JCPAction

           
        if (astr == null)
        {
            astr = key;
        }
        JCPAction a = new JCPAction().getAction(chemPaintPanel, astr);
        if (a != null)
        {
            b.setActionCommand(astr);
            logger.debug("Coupling action to button...");
            b.addActionListener(a);
            b.setEnabled(a.isEnabled());
        } else
        {
            logger.error("Could not find JCPAction class for:", astr);
            b.setEnabled(false);
        }
View Full Code Here

Examples of org.openscience.jchempaint.action.JCPAction

        // For some reason this does not work
        // applet.button("select").click();
        // panel.get2DHub().updateView();
        // so we crank the lever manually
        JCPAction act = new JCPAction().getAction(panel, "org.openscience.jchempaint.action.ChangeModeAction@select");
        act.actionPerformed(null);
        applet.panel("renderpanel").robot.waitForIdle();
    IAtomContainer ethane = panel.getChemModel().getMoleculeSet().getAtomContainer(0);
    Renderer r = panel.getRenderPanel().getRenderer();
    Point2d atompos0=ethane.getAtom(0).getPoint2d();
    Point2d atompos1=ethane.getAtom(1).getPoint2d();
View Full Code Here

Examples of org.openscience.jchempaint.action.JCPAction

     *
     *  @return    The jCPAction value
     */
    private JCPAction getJCPAction() {
        if (jcpaction == null) {
            jcpaction = new JCPAction();
        }
        return jcpaction;
    }
View Full Code Here

Examples of org.openscience.jchempaint.action.JCPAction

                                JMenuItem mi = new JMenuItem(cmd);
                                mi.setName(cmd);
                                usedKeys.add(cmd);
                                String astr="org.openscience.jchempaint.action.ChangeIsotopeAction@specific"+isotopes[i].getMassNumber();
                                mi.setActionCommand(astr);
                                JCPAction action = getJCPAction().getAction(jcpPanel, astr, false);
                                if (action != null) {
                                    // sync some action properties with menu
                                    mi.setEnabled(action.isEnabled());
                                    mi.addActionListener(action);
                                    logger.debug("Coupled action to new menu item...");
                                }
                                menu.add(mi);
                            }
View Full Code Here

Examples of org.openscience.jchempaint.action.JCPAction

        String astr = JCPPropertyHandler.getInstance(true).getResourceString(cmd + JCPAction.actionSuffix);
        if (astr == null) {
            astr = cmd;
        }
        mi.setActionCommand(astr);
        JCPAction action = getJCPAction().getAction(jcpPanel, astr, isPopupMenu);
        if (action != null) {
            // sync some action properties with menu
            mi.setEnabled(action.isEnabled());
            mi.addActionListener(action);
            logger.debug("Coupled action to new menu item...");
        }
        else {
            logger.error("Could not find JCPAction class for:" + astr);
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.