Re: Jemmy, Drag&Drop

Alexandr Scherbatiy <[email protected]> Wed, 23 Jul 2008 17:07:08 +0400
Newsgroups gmane.comp.java.netbeans.general.russian
Message-ID <[email protected]>
п░п╫я┌п╬п╫ п я─я┐п©п╫п╬п╡ wrote:
> п п╟п╨ п╡п╬п╥п╪п╬п╤п╫п╬ п©я─п╬я┌п╣я│я┌п╦я─п╬п╡п╟я┌я▄ Drag&Drop я└я┐п╫п╨я├п╦п╬п╫п╟п╩я▄п╫п╬я│я┌я▄?
> п║ п╦я│п©п╬п╩я▄п╥п╬п╡п╟п╫п╦п╣п╪ Jemmy п╠п╦п╠п╩п╦п╬я┌п╣п╨п╦.
> Eя│п╩п╦ п╨я┌п╬ п╥п╫п╟п╣я┌ п©я─п╦п╡п╣п╢п╦я┌п╣ п©я─п╦п╪п╣я─ п©п╬п╤п╟п╩я┐п╧я│я┌п╟.


п▓ п©я─п╣п╢п╣п╩п╟я┘ п╬п╢п╫п╬пЁп╬ п╨п╬п╪п©п╬п╫п╣п╫я┌п╟ п╪п╬п╤п╫п╬ п╡п╬я│п©п╬п╩я▄п╥п╬п╡п╟я┌я▄я│я▐ п╪п╣я┌п╬п╢п╬п╪
dragNDrop п╨п╩п╟я│я│п╟ MouseRobotDriver.

п■п╩я▐ п©п╣я─п╣я┌п╟я│п╨п╦п╡п╟п╫п╦я▐ я│ п╬п╢п╫п╬пЁп╬ п╨п╬п╪п©п╬п╫п╣п╫я┌п╟ п╫п╟ п╢я─я┐пЁп╬п╧ я▐ п╥п╫п╟я▌
я┌п╬п╩я▄п╨п╬ п╩п╬п╠п╬п╡п╬п╧ п╪п╣я┌п╬п╢:

         MouseDriver driver = new MouseRobotDriver(new 
Timeout("autoDelay", 250));

         Timeout timeout = new Timeout("", 100);

         JListOperator list = ;
         Point point = list.getClickPoint(0);

         int x1 = point.x;
         int y1 = point.y;

         driver.moveMouse(list, x1, y1);
         driver.pressMouse(list, x1, y1, InputEvent.BUTTON1_MASK, 0);

         int x2 = textComponent.getCenterXForClick();
         int y2 = textComponent.getCenterYForClick();

         driver.moveMouse(textComponent, x2, y2);
         driver.releaseMouse(textComponent, x2, y2, 
InputEvent.BUTTON1_MASK, 0);


   п▓п╬я┌ п╥п╢п╣я│я▄ п╢п╬п╨я┐п╪п╣п╫я┌п╟я├п╦я▐:
 
http://www.netbeans.org/download/qa/jemmy-jelly2-nb-javadoc/org/netbeans/jemmy/drivers/input/MouseRobotDriver.html

п░п╩п╣п╨я│п╟п╫п╢я─.