Package org.netbeans.jemmy.operators

Examples of org.netbeans.jemmy.operators.JButtonOperator


  }
    }

    private void expandTo(JSplitPaneOperator oper, int index) {
  ContainerOperator divOper = oper.getDivider();
  JButtonOperator bo =
      new JButtonOperator((JButton)divOper.
        waitSubComponent(new JButtonOperator.
             JButtonFinder(ComponentSearcher.
                     getTrueChooser("JButton")),
             index));
  bo.copyEnvironment(divOper);
  ButtonDriver bdriver = DriverManager.getButtonDriver(bo);
  bdriver.push(bo);
  bdriver.push(bo);
    }
View Full Code Here


         * Creates a Mover object.
         * @param button a Button
         */
  public Mover(JButton button) {
      super();
      bo = new JButtonOperator(button);
      Timeouts times = JemmyProperties.getCurrentTimeouts();
      times.setTimeout("AbstractButton.PushButtonTimeout",
           readCommentTimeout);
      bo.setTimeouts(times);
  }
View Full Code Here

                }
            });
    }

    public void scroll(ComponentOperator oper, ScrollAdjuster adj) {
        JButtonOperator increaseButton = ((JSpinnerOperator)oper).getIncreaseOperator();
        JButtonOperator decreaseButton = ((JSpinnerOperator)oper).getDecreaseOperator();
        if(adj.getScrollDirection() == ScrollAdjuster.DO_NOT_TOUCH_SCROLL_DIRECTION) {
            return;
        }
        int originalDirection = adj.getScrollDirection();
        while(adj.getScrollDirection() == originalDirection) {
            if(originalDirection == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
                increaseButton.push();
            } else {
                decreaseButton.push();
            }
        }
    }
View Full Code Here

  }
  drop(oper, pnt);
    }

    protected void step(ComponentOperator oper, ScrollAdjuster adj) {
  JButtonOperator boper = findAButton(oper, adj.getScrollDirection());
  DriverManager.getButtonDriver(boper).push(boper);
    }
View Full Code Here

  JButtonOperator boper = findAButton(oper, adj.getScrollDirection());
  DriverManager.getButtonDriver(boper).push(boper);
    }

    protected void jump(final ComponentOperator oper, final ScrollAdjuster adj) {
        final JButtonOperator lessButton = findAButton(oper, adj.DECREASE_SCROLL_DIRECTION);
        final JButtonOperator moreButton = findAButton(oper, adj.INCREASE_SCROLL_DIRECTION);
        queueTool.invokeSmoothly(new QueueTool.QueueAction("Choise expanding") {
                public Object launch() {
                    if(adj.getScrollDirection() != ScrollAdjuster.DO_NOT_TOUCH_SCROLL_DIRECTION) {
                        int x, y;
                        if       (((JScrollBarOperator)oper).getOrientation() == JScrollBar.HORIZONTAL) {
                            if       (adj.getScrollDirection() == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
                                x = moreButton.getX() - 1;
                            } else if(adj.getScrollDirection() == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
                                x = lessButton  .getX() + lessButton.getWidth();
                            } else {
                                return(null);
                            }
                            y = lessButton.getHeight() / 2;
                        } else if(((JScrollBarOperator)oper).getOrientation() == JScrollBar.VERTICAL) {
                            if       (adj.getScrollDirection() == ScrollAdjuster.INCREASE_SCROLL_DIRECTION) {
                                y = moreButton.getY() - 1;
                            } else if(adj.getScrollDirection() == ScrollAdjuster.DECREASE_SCROLL_DIRECTION) {
                                y = lessButton  .getY() + lessButton.getHeight();
                            } else {
                                return(null);
                            }
View Full Code Here

                }
            });
    }

    protected void startPushAndWait(ComponentOperator oper, int direction, int orientation) {
  JButtonOperator boper = findAButton(oper, direction);
  DriverManager.getButtonDriver(boper).press(boper);
    }
View Full Code Here

  JButtonOperator boper = findAButton(oper, direction);
  DriverManager.getButtonDriver(boper).press(boper);
    }

    protected void stopPushAndWait(ComponentOperator oper, int direction, int orientation) {
  JButtonOperator boper = findAButton(oper, direction);
  DriverManager.getButtonDriver(boper).release(boper);
    }
View Full Code Here

  JButtonOperator boper = findAButton(oper, direction);
  DriverManager.getButtonDriver(boper).release(boper);
    }

    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

  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);
View Full Code Here

    protected boolean canPushAndWait(ComponentOperator oper) {
  return(isSmallIncrement((JScrollBarOperator)oper));
    }

    protected int getDragAndDropStepLength(ComponentOperator oper) {
  JButtonOperator less = findAButton(oper, ScrollAdjuster.DECREASE_SCROLL_DIRECTION);
  JButtonOperator more = findAButton(oper, ScrollAdjuster.INCREASE_SCROLL_DIRECTION);
  int width = oper.getWidth() - less.getWidth() - more.getWidth();
  int height = oper.getHeight() - less.getHeight() - more.getHeight();
  int max = (width > height) ? width : height;
  if(max >= RELATIVE_DRAG_STEP_LENGTH * 2) {
      return((int)(max / RELATIVE_DRAG_STEP_LENGTH));
  } else {
      return(1);
View Full Code Here

TOP

Related Classes of org.netbeans.jemmy.operators.JButtonOperator

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.