Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JPanelFixture


    panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0).setStereo(IBond.Stereo.NONE);
    Assert.assertEquals("down_bond", panel.get2DHub().getActiveDrawModule().getID());
  }

  @Test public void testMenuBondStereoUp() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0).setStereo(IBond.Stereo.NONE);
    panel.getRenderPanel().getRenderer().getRenderer2DModel().setSelection(new SingleSelection<IBond>(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0)));
    panel.selectionChanged();
    applet.menuItem("up_bond").click();
View Full Code Here


    panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0).setStereo(IBond.Stereo.NONE);
    Assert.assertEquals("up_bond", panel.get2DHub().getActiveDrawModule().getID());
  }

  @Test public void testMenuBondUndefinedStereo() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0).setStereo(IBond.Stereo.NONE);
    panel.getRenderPanel().getRenderer().getRenderer2DModel().setSelection(new SingleSelection<IBond>(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0)));
    panel.selectionChanged();
    applet.menuItem("undefined_bond").click();
View Full Code Here

    panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0).setStereo(IBond.Stereo.NONE);
    Assert.assertEquals("undefined_bond", panel.get2DHub().getActiveDrawModule().getID());
  }

  @Test public void testMenuBondUndefinedEZ() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0).setStereo(IBond.Stereo.NONE);
    panel.getRenderPanel().getRenderer().getRenderer2DModel().setSelection(new SingleSelection<IBond>(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBond(0)));
    panel.selectionChanged();
    applet.menuItem("undefined_stereo_bond").click();
View Full Code Here

      applet.dialog("smilestextdialog").close();
  }

  @Test public void testMenuNew() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      applet.menuItem("new").click();
      JPanelFixture jcppanel=applet.panel("appletframe");
      JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
      Assert.assertEquals("",panel.getSmiles());
      restoreModelWithBasicmol();
    }
View Full Code Here

          // TODO Auto-generated catch block
          Assert.fail("File not found.");
          return;
        }
        IAtomContainer mol = (IAtomContainer)reader.read(DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class));
        JPanelFixture jcppanel=applet.panel("appletframe");
        JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
        Assert.assertEquals(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount(), mol.getAtomCount());
        Assert.assertEquals(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBondCount(), mol.getBondCount());
    }
View Full Code Here

              ins = this.getClass().getClassLoader().getResourceAsStream(filename);
              MDLV2000Reader reader = new MDLV2000Reader(ins, Mode.STRICT);
              ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile());
              Assert.assertNotNull(chemFile);
              List<IAtomContainer> containersList = ChemFileManipulator.getAllAtomContainers(chemFile);
              JPanelFixture jcppanel=applet.panel("appletframe");
              JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
              Assert.assertEquals(1, containersList.size());
              Assert.assertEquals((containersList.get(0)).getAtomCount(),panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount());
              Assert.assertEquals((containersList.get(0)).getBondCount(),panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBondCount());
              restoreModelWithBasicmol();
View Full Code Here

                  ins = this.getClass().getClassLoader().getResourceAsStream(filename);
                  SMILESReader reader = new SMILESReader(ins);
                  ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile());
                  Assert.assertNotNull(chemFile);
                  List<IAtomContainer> containersList = ChemFileManipulator.getAllAtomContainers(chemFile);
                  JPanelFixture jcppanel=applet.panel("appletframe");
                  JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
                  Assert.assertEquals(containersList.size(), containersList.size());
                  Assert.assertEquals((containersList.get(0)).getAtomCount(),panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount());
                  Assert.assertEquals((containersList.get(0)).getBondCount(),panel.getChemModel().getMoleculeSet().getAtomContainer(0).getBondCount());
                  restoreModelWithBasicmol();
View Full Code Here

public class SwingMultiAdapter extends AbstractSwingWidgetAdapter {

    public SwingMultiAdapter(MultiWidget widget, Robot robot) {
        super(widget);
        JPanelFixture fixture = new JPanelFixture(robot, widget);
        setType(Type.MULTI);
        LOG.warn("Unhandled MultiWidget");

    }
View Full Code Here

                    fixture.click();
                }
            };
        } else if (container instanceof JPanel) {
            JPanel pane = (JPanel) container;
            final JPanelFixture fixture =
                    new JPanelFixture(testFrame.robot, pane);
            return new IClickable() {
                @Override
                public void click() {
                    fixture.focus();
                }
            };
        } else {
            return getClickableParentRecursive(container.getParent());
        }
View Full Code Here

                        ff.click();
                    }
                };
            } else if (container instanceof JPanel) {
                JPanel pane = (JPanel) container;
                final JPanelFixture ff = new JPanelFixture(fixture.robot, pane);
                return new IClickable() {
                    @Override
                    public void click() {
                        ff.focus();
                    }
                };
            } else {
                return getClickableParentRecursive(container.getParent());
            }
View Full Code Here

TOP

Related Classes of org.fest.swing.fixture.JPanelFixture

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.