Package org.fest.swing.core

Examples of org.fest.swing.core.ComponentDragAndDrop.drag()


   
    Robot robot = BasicRobot.robotWithCurrentAwtHierarchy();
   
    ComponentDragAndDrop d = new ComponentDragAndDrop(robot);
       
    d.drag(view, new Point(5,5));
    d.drop(view, new Point(5,5));
   
    Assert.assertNull(dt.v); // Nothing should have happened
   
    d.drag(view, new Point(5,5));
View Full Code Here


    d.drag(view, new Point(5,5));
    d.drop(view, new Point(5,5));
   
    Assert.assertNull(dt.v); // Nothing should have happened
   
    d.drag(view, new Point(5,5));
    d.drop(dest, new Point(5,5));   
   
    Assert.assertEquals(dt.v, view); // Make sure the right view got dropped
  }
 
View Full Code Here

    // select this
    applet.button("select").click();
    Point movetopint = new Point(50, 50);
    ComponentDragAndDrop dandd = new ComponentDragAndDrop(applet
        .panel("renderpanel").robot);
    dandd.drag(applet.panel("renderpanel").component(), movetopint);
    movetopint = new Point(300, 300);
    dandd.drop(applet.panel("renderpanel").component(), movetopint);
    Point2d oldcoord = new Point2d(panel.getChemModel().getMoleculeSet()
        .getAtomContainer(0).getAtom(0).getPoint2d().x, panel
        .getChemModel().getMoleculeSet().getAtomContainer(0).getAtom(0)
View Full Code Here

        int oldAtomCount=panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount();
        applet.button("select").click();
        Point2d startpoint=getAtomPoint(panel,0);
        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(), new Point((int)startpoint.x, (int)startpoint.y), MouseButton.LEFT_BUTTON,1);
        ComponentDragAndDrop dandd = new ComponentDragAndDrop(applet.panel("renderpanel").robot);
        dandd.drag(applet.panel("renderpanel").component(), new Point((int)startpoint.x, (int)startpoint.y));
        Point2d movetopoint=getAtomPoint(panel,1);
        dandd.drop(applet.panel("renderpanel").component(), new Point((int)movetopoint.x, (int)movetopoint.y));
        Assert.assertEquals(oldAtomCount-1, panel.getChemModel().getMoleculeSet().getAtomContainer(0).getAtomCount());
        movetopoint=getAtomPoint(panel,2);
        applet.panel("renderpanel").robot.moveMouse(applet.panel("renderpanel").component(),new Point((int)movetopoint.x, (int)movetopoint.y));
View Full Code Here

        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(), new Point(100,50), MouseButton.LEFT_BUTTON,1);
        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(), new Point(400,50), MouseButton.LEFT_BUTTON,1);
        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(), new Point(0,0), MouseButton.RIGHT_BUTTON,1);
        applet.button("reactionArrow").click();
        ComponentDragAndDrop dandd = new ComponentDragAndDrop(applet.panel("renderpanel").robot);
        dandd.drag(applet.panel("renderpanel").component(), new Point(150,50));
        dandd.drop(applet.panel("renderpanel").component(), new Point(350,50));
        Assert.assertEquals(1, panel.getChemModel().getReactionSet().getReactionCount());
        Assert.assertEquals(1, panel.getChemModel().getReactionSet().getReaction(0).getReactantCount());
        Assert.assertEquals(1, panel.getChemModel().getReactionSet().getReaction(0).getProductCount());
        applet.button("hexagon").click();
View Full Code Here

        Assert.assertEquals(1, panel.getChemModel().getReactionSet().getReaction(0).getReactantCount());
        Assert.assertEquals(2, panel.getChemModel().getReactionSet().getReaction(0).getProductCount());
        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(), new Point(100,300), MouseButton.LEFT_BUTTON,1);
        applet.panel("renderpanel").robot.click(applet.panel("renderpanel").component(), new Point(400,300), MouseButton.LEFT_BUTTON,1);
        applet.button("reactionArrow").click();
        dandd.drag(applet.panel("renderpanel").component(), new Point(150,300));
        dandd.drop(applet.panel("renderpanel").component(), new Point(350,300));
        Assert.assertEquals(2, panel.getChemModel().getReactionSet().getReactionCount());
        Assert.assertEquals(1, panel.getChemModel().getReactionSet().getReaction(1).getReactantCount());
        Assert.assertEquals(1, panel.getChemModel().getReactionSet().getReaction(1).getProductCount());
    }
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.