Package java.awt

Examples of java.awt.Adjustable


     * horizontal scrollbar) on mouse wheel move
     */
    public void mouseWheelMoved(MouseWheelEvent e) {
        int type = e.getScrollType();
        int unitType = MouseWheelEvent.WHEEL_UNIT_SCROLL;
        Adjustable adj = vAdj;
        if (!isAdjNeeded(vAdj) && isAdjNeeded(hAdj)) {
            // scroll horizontally if only horiz scrollbar
            // is present
            adj = hAdj;
        }
        int incrSize = (type == unitType ? adj.getUnitIncrement() : adj
                .getBlockIncrement());
        int scrollAmount = e.getUnitsToScroll() * incrSize;

        adj.setValue(adj.getValue() + scrollAmount);
    }
View Full Code Here


     * Scrolls component on adjustment events from
     * scrollbars, repaints scrollable viewport
     */
    public void adjustmentValueChanged(AdjustmentEvent e) {
        // set scrolled component's position here:
        Adjustable srcAdj = e.getAdjustable();
        int val = e.getValue();

        Insets ins = scrollable.getInsets();
        Point loc = scrollable.getLocation();
        if (srcAdj == hAdj) {
View Full Code Here

            } else {
                repaint = true;
            }
        }

        Adjustable adj = state.getAdjustable();
        int oldVal = adj.getValue();
        state.setValue(AdjustmentEvent.TRACK, val);
        if (oldVal != adj.getValue()) {
            fireEvent();
            if (repaint) {
                repaint();
            }
        }
View Full Code Here

     * Changes scrollbar value on increment.
     * Fires adjustment event on value change.
     * @param increment change amount
     */
    private void updateAdjValue(final int increment) {
        Adjustable adj = state.getAdjustable();
        int oldVal = adj.getValue();
        state.setValue(type, oldVal + increment);
        if (oldVal != adj.getValue()){
            fireEvent();
        }
    }
View Full Code Here

     * Scrolls to scrollbar maximum or minimum value
     * @param max scroll to maximum if true, scroll to minimum
     * otherwise
     */
    void setAdjMinMaxValue(boolean max) {
        Adjustable adj = state.getAdjustable();
        int newVal = max ? adj.getMaximum() : adj.getMinimum();
        int oldVal = adj.getValue();
        adj.setValue(newVal);
        if (oldVal != newVal) {
            type = AdjustmentEvent.TRACK;
            fireEvent();
        }
    }
View Full Code Here

     * horizontal scrollbar) on mouse wheel move
     */
    public void mouseWheelMoved(MouseWheelEvent e) {
        int type = e.getScrollType();
        int unitType = MouseWheelEvent.WHEEL_UNIT_SCROLL;
        Adjustable adj = vAdj;
        if (!isAdjNeeded(vAdj) && isAdjNeeded(hAdj)) {
            // scroll horizontally if only horiz scrollbar
            // is present
            adj = hAdj;
        }
        int incrSize = (type == unitType ? adj.getUnitIncrement() : adj
                .getBlockIncrement());
        int scrollAmount = e.getUnitsToScroll() * incrSize;

        adj.setValue(adj.getValue() + scrollAmount);
    }
View Full Code Here

     * Scrolls component on adjustment events from
     * scrollbars, repaints scrollable viewport
     */
    public void adjustmentValueChanged(AdjustmentEvent e) {
        // set scrolled component's position here:
        Adjustable srcAdj = e.getAdjustable();
        int val = e.getValue();

        Insets ins = scrollable.getInsets();
        Point loc = scrollable.getLocation();
        if (srcAdj == hAdj) {
View Full Code Here

    public ScrollPaneDriver() {
  super(new String[] {"org.netbeans.jemmy.operators.ScrollPaneOperator"});
    }

    public void scrollToMinimum(ComponentOperator oper, final int orientation) {
  final Adjustable adj =
      (orientation == Scrollbar.HORIZONTAL) ?
      ((ScrollPaneOperator)oper).getHAdjustable() :
      ((ScrollPaneOperator)oper).getVAdjustable();
  scroll(oper,
         new ScrollAdjuster() {
    public int getScrollDirection() {
        return((adj.getMinimum() < adj.getValue()) ?
         DECREASE_SCROLL_DIRECTION :
         DO_NOT_TOUCH_SCROLL_DIRECTION);
    }
    public int getScrollOrientation() {
        return(orientation);
View Full Code Here

    }
      });
    }

    public void scrollToMaximum(ComponentOperator oper, final int orientation) {
  final Adjustable adj =
      (orientation == Scrollbar.HORIZONTAL) ?
      ((ScrollPaneOperator)oper).getHAdjustable() :
      ((ScrollPaneOperator)oper).getVAdjustable();
  scroll(oper,
         new ScrollAdjuster() {
    public int getScrollDirection() {
        return(((adj.getMaximum() - adj.getVisibleAmount()) > adj.getValue()) ?
         INCREASE_SCROLL_DIRECTION :
         DO_NOT_TOUCH_SCROLL_DIRECTION);
    }
    public int getScrollOrientation() {
        return(orientation);
View Full Code Here

        toStringSource());

  output.printGolden("Scroll ScrollPane to " + Double.toString(proportionalValue) + " proportional horizontal value");

  Adjustable adj = getHAdjustable();

  scrollTo(new ValueScrollAdjuster((int)(adj.getMinimum() +

                 (adj.getMaximum() -

            adj.getVisibleAmount() -

            adj.getMinimum()) * proportionalValue),

           Adjustable.VERTICAL,

           getVAdjustable()));

View Full Code Here

TOP

Related Classes of java.awt.Adjustable

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.