Package org.fest.swing.fixture

Examples of org.fest.swing.fixture.JPanelFixture


public class JCPEditorAppletDrawingTest extends AbstractAppletTest{

  @Test public void testAddBond() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    //using bond button
    applet.button("bondTool").click();
    //can we add a new bond?
View Full Code Here


 
  @Test public void testElement() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      //we go into bond_down mode to see that hitting O button actually changes activeDrawModule
      restoreModelWithBasicmol();
      applet.button("down_bond").click();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    applet.button("O").click();
    Assert.assertEquals("O",panel.get2DHub().getActiveDrawModule().getID());
View Full Code Here

    Assert.assertEquals("O",panel.get2DHub().getController2DModel().getDrawElement());
  }
 
  @Test public void testPeriodictable() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    applet.button("periodictable").click();
    DialogFixture dialog = applet.dialog();
    dialog.button("Li").click();
View Full Code Here

    Assert.assertEquals(oldAtomCount+1, panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount());
    Assert.assertEquals("Li",panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount()-1).getSymbol());
  }
  @Test public void testEnterelement() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    applet.button("enterelement").click();
   
    Point2d moveto=panel.getRenderPanel().getRenderer().toScreenCoordinates(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(0).getPoint2d().x,panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(0).getPoint2d().y)
View Full Code Here

    Assert.assertEquals("U",panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount()-1).getSymbol());
  }

  @Test public void testTriangle() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    //we add a triangle to an atom
    applet.button("triangle").click();
    Point2d moveto=panel.getRenderPanel().getRenderer().toScreenCoordinates(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().x,panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().y);
View Full Code Here

    restoreModelWithBasicmol();
  }

  @Test public void testPentagon() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    //we add a pentagon to an atom
    applet.button("pentagon").click();
    Point2d moveto=panel.getRenderPanel().getRenderer().toScreenCoordinates(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().x,panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().y)
View Full Code Here

    restoreModelWithBasicmol();
  }

  @Test public void testHexagon() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    //we add a hexagon to an atom
    applet.button("hexagon").click();
    Point2d moveto=panel.getRenderPanel().getRenderer().toScreenCoordinates(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().x,panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().y)
View Full Code Here

    restoreModelWithBasicmol();
  }

  @Test public void testOctagon() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    //we add a octagon to an atom
    applet.button("octagon").click();
    Point2d moveto=panel.getRenderPanel().getRenderer().toScreenCoordinates(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().x,panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().y)
View Full Code Here

    restoreModelWithBasicmol();
  }

  @Test public void testBenzene() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    //we add a benzene to an atom
    applet.button("benzene").click();
    Point2d moveto=panel.getRenderPanel().getRenderer().toScreenCoordinates(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().x,panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().y)
View Full Code Here

    restoreModelWithBasicmol();
  }

  @Test public void testSquare() throws CDKException, ClassNotFoundException, IOException, CloneNotSupportedException {
      restoreModelWithBasicmol();
    JPanelFixture jcppanel=applet.panel("appletframe");
    JChemPaintPanel panel = (JChemPaintPanel)jcppanel.target;
    int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
    //we add a square to an atom
    applet.button("square").click();
    Point2d moveto=panel.getRenderPanel().getRenderer().toScreenCoordinates(panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().x,panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(3).getPoint2d().y)
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.