Package org.netbeans.jemmy.drivers

Examples of org.netbeans.jemmy.drivers.MouseDriver


    protected void startPushAndWait(final ComponentOperator oper, final int direction, final int orientation) {
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Choise expanding") {
                public Object launch() {
                    Point clickPoint = getClickPoint(oper, direction, orientation);
                    if(clickPoint != null) {
                        MouseDriver mdriver = DriverManager.getMouseDriver(oper);
                        mdriver.moveMouse(oper, clickPoint.x, clickPoint.y);
                        mdriver.pressMouse(oper, clickPoint.x, clickPoint.y,
                                           Operator.getDefaultMouseButton(),
                                           0);
                    }
                    return(null);
                }
View Full Code Here


    protected void stopPushAndWait(final ComponentOperator oper, final int direction, final int orientation) {
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Choise expanding") {
                public Object launch() {
                    Point clickPoint = getClickPoint(oper, direction, orientation);
                    if(clickPoint != null) {
                        MouseDriver mdriver = DriverManager.getMouseDriver(oper);
                        mdriver.releaseMouse(oper, clickPoint.x, clickPoint.y,
                                             Operator.getDefaultMouseButton(),
                                             0);
                    }
                    return(null);
                }
View Full Code Here

public class ButtonMouseDriver extends LightSupportiveDriver implements ButtonDriver {
    public ButtonMouseDriver() {
  super(new String[] {"org.netbeans.jemmy.operators.ComponentOperator"});
    }
    public void press(ComponentOperator oper) {
  MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  mdriver.moveMouse(oper,
        oper.getCenterXForClick(),
        oper.getCenterYForClick());
  mdriver.pressMouse(oper,
         oper.getCenterXForClick(),
         oper.getCenterYForClick(),
         oper.getDefaultMouseButton(),
         0);
    }
View Full Code Here

    protected void startPushAndWait(final ComponentOperator oper, final int direction, final int orientation) {
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Start scrolling") {
                public Object launch() {
                    Point clickPoint = getClickPoint(oper, direction, orientation);
                    if(clickPoint != null) {
                        MouseDriver mdriver = DriverManager.getMouseDriver(oper);
                        mdriver.moveMouse(oper, clickPoint.x, clickPoint.y);
                        mdriver.pressMouse(oper, clickPoint.x, clickPoint.y,
                                           Operator.getDefaultMouseButton(),
                                           0);
                    }
                    return(null);
                }
View Full Code Here

    protected void stopPushAndWait(final ComponentOperator oper, final int direction, final int orientation) {
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Stop scrolling") {
                public Object launch() {
                    Point clickPoint = getClickPoint(oper, direction, orientation);
                    if(clickPoint != null) {
                        MouseDriver mdriver = DriverManager.getMouseDriver(oper);
                        mdriver.releaseMouse(oper, clickPoint.x, clickPoint.y,
                                             Operator.getDefaultMouseButton(),
                                             0);
                    }
                    return(null);
                }
View Full Code Here

            oper.waitComponentVisible(true);
            oper.waitComponentEnabled();
        } catch(InterruptedException e) {
            throw(new JemmyException("Interrupted!", e));
        }
  MouseDriver mDriver = DriverManager.getMouseDriver(oper);
        //mDriver.enterMouse(oper);
        //use enhanced algorithm instead
        smartMove(lastItem, oper);
  if(depth > chooser.getDepth() - 1) {
            if(oper instanceof JMenuOperator &&
               menuBar != null && getSelectedElement(menuBar) != null) {
                //mDriver.enterMouse(oper);
            } else {
                DriverManager.getButtonDriver(oper).push(oper);
            }
      return(oper.getSource());
  }
  if(pressMouse && !((JMenuOperator)oper).isPopupMenuVisible() &&
           !(menuBar != null && getSelectedElement(menuBar) != null)) {
      DriverManager.getButtonDriver(oper).push(oper);
  }
  oper.getTimeouts().sleep("JMenuOperator.WaitBeforePopupTimeout");
  JMenuItem item = waitItem(oper, waitPopupMenu(oper), chooser, depth);
        mDriver.exitMouse(oper);
  if(item instanceof JMenu) {
      JMenuOperator mo = new JMenuOperator((JMenu)item);
      mo.copyEnvironment(oper);
      return(push(mo, oper, null, chooser, depth + 1, false));
  } else {
View Full Code Here

    protected Point startDragging(ComponentOperator oper) {
  JButtonOperator lessButton = findAButton(oper, ScrollAdjuster.DECREASE_SCROLL_DIRECTION);
  JButtonOperator moreButton = findAButton(oper, ScrollAdjuster.INCREASE_SCROLL_DIRECTION);
  Point pnt = getClickPoint((JScrollBarOperator)oper, lessButton, moreButton, ((JScrollBarOperator)oper).getValue());
  MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  mdriver.moveMouse(oper, pnt.x, pnt.y);
  mdriver.pressMouse(oper, pnt.x, pnt.y, oper.getDefaultMouseButton(), 0);
  return(pnt);
    }
View Full Code Here

    }

    public void selectItems(final ComponentOperator oper, int[] indices) {
        ((JTreeOperator)oper).clearSelection();
        checkSupported(oper);
        final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
        final JTreeOperator toper = (JTreeOperator)oper;
        final Timeout clickTime = oper.getTimeouts().create("ComponentOperator.MouseClickTimeout");
        QueueTool qt = new QueueTool();
        for(int i = 0; i < indices.length; i++) {
            final int index = i;
            if(!queueTool.isDispatchThread()) {
                toper.scrollToRow(indices[i]);
            }
            final Point p = toper.getPointToClick(indices[index]);
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        mdriver.clickMouse(oper, p.x, p.y, 1, Operator.getDefaultMouseButton(),
                                           (index == 0) ? 0 : InputEvent.CTRL_MASK, clickTime);
                        return(null);
                    }
                });
        }
View Full Code Here

    protected boolean canDragAndDrop(ComponentOperator oper) {
  if(!isSmallIncrement((JScrollBarOperator)oper)) {
      return(false);
  }
  boolean result = false;
  MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  JButtonOperator less = findAButton(oper, ScrollAdjuster.DECREASE_SCROLL_DIRECTION);
  JButtonOperator more = findAButton(oper, ScrollAdjuster.INCREASE_SCROLL_DIRECTION);
  Point pnt = getClickPoint((JScrollBarOperator)oper, less, more, ((JScrollBarOperator)oper).getValue());
  mdriver.moveMouse(oper, pnt.x, pnt.y);
  mdriver.pressMouse(oper, pnt.x, pnt.y, oper.getDefaultMouseButton(), 0);
  result = ((JScrollBarOperator)oper).getValueIsAdjusting();
  mdriver.releaseMouse(oper, pnt.x, pnt.y, oper.getDefaultMouseButton(), 0);
  return(result && isSmallIncrement((JScrollBarOperator)oper));
    }
View Full Code Here

    }

    public void expandItem(ComponentOperator oper, final int index) {
  checkSupported(oper);
  final JTreeOperator toper = (JTreeOperator)oper;
  final MouseDriver mdriver = DriverManager.getMouseDriver(oper);
  if(!toper.isExpanded(index)) {
            queueTool.invokeSmoothly(new QueueTool.QueueAction("Path selecting") {
                    public Object launch() {
                        Point p = toper.getPointToClick(index);
                        mdriver.clickMouse(toper, p.x, p.y, 2, Operator.getDefaultMouseButton(),
                                           0, toper.getTimeouts().
                                           create("ComponentOperator.MouseClickTimeout"));
                        return(null);
                    }
                });
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.drivers.MouseDriver

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.