微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

java.awt.Adjustable的实例源码

项目:rapidminer    文件ScrollBarUI.java   
@Override
protected void paintTrack(Graphics g,JComponent c,Rectangle trackBounds) {
    int x = (int) trackBounds.getX();
    int y = (int) trackBounds.getY();
    int w = (int) trackBounds.getWidth();
    int h = (int) trackBounds.getHeight();

    g.setColor(Colors.SCROLLBAR_TRACK_BACKGROUND);
    g.fillRect(x - 1,y - 1,w + 2,h + 2);

    g.setColor(Colors.SCROLLBAR_TRACK_BORDER);
    if (this.scrollbar.getorientation() == adjustable.HORIZONTAL) {
        g.drawLine(x,y,x + w,y);
    } else {
        g.drawLine(x,x,y + h);
    }
}
项目:rapidminer    文件ScrollBarUI.java   
@Override
protected void paintThumb(Graphics g,Rectangle thumbBounds) {
    int x = (int) thumbBounds.getX();
    int y = (int) thumbBounds.getY();
    int w = (int) thumbBounds.getWidth();
    int h = (int) thumbBounds.getHeight();

    if (c.isEnabled() && w > 0 && h > 0) {
        if (this.scrollbar.getorientation() == adjustable.HORIZONTAL) {
            h -= 1;
            y++;
            drawHorizThumb(g,w,h);
        } else {
            w -= 1;
            x++;
            drawVertThumb(g,h);
        }
    }
}
项目:Openjsharp    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINER)) {
        log.finer("x = " + e.getX() + ",y = " + e.getY() + ",src is " + e.getSource());
    }
    int increment = 0;

    if (sp != null && e.getScrollAmount() != 0) {
        adjustable adj = getadjustableToScroll(sp);
        if (adj != null) {
            increment = getIncrementFromadjustable(adj,e);
            if (log.isLoggable(Platformlogger.Level.FINER)) {
                log.finer("increment from adjustable(" + adj.getClass() + ") : " + increment);
            }
            scrolladjustable(adj,increment);
        }
    }
}
项目:Openjsharp    文件ScrollPaneWheelScroller.java   
public static int getIncrementFromadjustable(adjustable adj,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINE)) {
        if (adj == null) {
            log.fine("Assertion (adj != null) Failed");
        }
    }

    int increment = 0;

    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        increment = e.getUnitsToScroll() * adj.getUnitIncrement();
    }
    else if (e.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) {
        increment = adj.getBlockIncrement() * e.getWheelRotation();
    }
    return increment;
}
项目:Openjsharp    文件LWScrollBarPeer.java   
@Override
void initializeImpl() {
    super.initializeImpl();
    final Scrollbar target = getTarget();
    setLineIncrement(target.getUnitIncrement());
    setPageIncrement(target.getBlockIncrement());
    setValues(target.getValue(),target.getVisibleAmount(),target.getMinimum(),target.getMaximum());

    final int orientation = target.getorientation();
    final JScrollBar delegate = getDelegate();
    synchronized (getDelegateLock()) {
        delegate.setorientation(orientation == Scrollbar.HORIZONTAL
                                ? adjustable.HORIZONTAL
                                : adjustable.VERTICAL);
        delegate.addAdjustmentListener(this);
    }
}
项目:JuggleMasterPro    文件PreferenceByteGlobalJScrollBar.java   
/**
 * Constructs
 * 
 * @param objPpreferencesjdialog
 * @param bytPpreferenceType
 */
public PreferenceByteGlobalJScrollBar(Preferencesjdialog objPpreferencesjdialog,byte bytPpreferenceType) {
    super(adjustable.HORIZONTAL);

    this.objGpreferencesjdialog = objPpreferencesjdialog;
    this.bytGpreferenceType = bytPpreferenceType;
    this.setopaque(true);
    switch (this.bytGpreferenceType) {
        case Constants.bytS_BYTE_GLOBAL_GAMMA_CORRECTION:
            this.setValues( this.objGpreferencesjdialog.bytGbyteGlobalAA[this.bytGpreferenceType][Constants.bytS_UNCLASS_INITIAL],1,Constants.bytS_BYTE_GLOBAL_GAMMA_CORRECTION_MINIMUM_VALUE,Constants.bytS_BYTE_GLOBAL_GAMMA_CORRECTION_MAXIMUM_VALUE + 1);
            this.setBlockIncrement(3);
            break;
    }

    this.addAdjustmentListener(this);
}
项目:jdk8u-jdk    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,increment);
        }
    }
}
项目:jdk8u-jdk    文件ScrollPaneWheelScroller.java   
public static int getIncrementFromadjustable(adjustable adj,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINE)) {
        if (adj == null) {
            log.fine("Assertion (adj != null) Failed");
        }
    }

    int increment = 0;

    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        increment = e.getUnitsToScroll() * adj.getUnitIncrement();
    }
    else if (e.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) {
        increment = adj.getBlockIncrement() * e.getWheelRotation();
    }
    return increment;
}
项目:jdk8u-jdk    文件LWScrollBarPeer.java   
@Override
void initializeImpl() {
    super.initializeImpl();
    final Scrollbar target = getTarget();
    setLineIncrement(target.getUnitIncrement());
    setPageIncrement(target.getBlockIncrement());
    setValues(target.getValue(),target.getMaximum());

    final int orientation = target.getorientation();
    final JScrollBar delegate = getDelegate();
    synchronized (getDelegateLock()) {
        delegate.setorientation(orientation == Scrollbar.HORIZONTAL
                                ? adjustable.HORIZONTAL
                                : adjustable.VERTICAL);
        delegate.addAdjustmentListener(this);
    }
}
项目:openjdk-jdk10    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,increment);
        }
    }
}
项目:openjdk-jdk10    文件ScrollPaneWheelScroller.java   
public static int getIncrementFromadjustable(adjustable adj,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINE)) {
        if (adj == null) {
            log.fine("Assertion (adj != null) Failed");
        }
    }

    int increment = 0;

    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        increment = e.getUnitsToScroll() * adj.getUnitIncrement();
    }
    else if (e.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) {
        increment = adj.getBlockIncrement() * e.getWheelRotation();
    }
    return increment;
}
项目:openjdk-jdk10    文件LWScrollBarPeer.java   
@Override
void initializeImpl() {
    super.initializeImpl();
    final Scrollbar target = getTarget();
    setLineIncrement(target.getUnitIncrement());
    setPageIncrement(target.getBlockIncrement());
    setValues(target.getValue(),target.getMaximum());

    final int orientation = target.getorientation();
    final JScrollBar delegate = getDelegate();
    synchronized (getDelegateLock()) {
        delegate.setorientation(orientation == Scrollbar.HORIZONTAL
                                ? adjustable.HORIZONTAL
                                : adjustable.VERTICAL);
        delegate.addAdjustmentListener(this);
    }
}
项目:openjdk-jdk10    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to top.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToTop() {
    output.printTrace("Scroll ScrollPane to top\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to top");
    produceTimeRestricted(new Action<Void,Void>() {
        @Override
        public Void launch(Void obj) {
            driver.scrollToMinimum(ScrollPaneOperator.this,adjustable.VERTICAL);
            return null;
        }

        @Override
        public String getDescription() {
            return "Scrolling";
        }

        @Override
        public String toString() {
            return "ScrollPaneOperator.scrollToTop.Action{description = " + getDescription() + '}';
        }
    },"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk-jdk10    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to bottom.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToBottom() {
    output.printTrace("Scroll ScrollPane to bottom\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to bottom");
    produceTimeRestricted(new Action<Void,Void>() {
        @Override
        public Void launch(Void obj) {
            driver.scrollToMaximum(ScrollPaneOperator.this,adjustable.VERTICAL);
            return null;
        }

        @Override
        public String getDescription() {
            return "Scrolling";
        }

        @Override
        public String toString() {
            return "ScrollPaneOperator.scrollToBottom.Action{description = " + getDescription() + '}';
        }
    },"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk-jdk10    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to left.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToLeft() {
    output.printTrace("Scroll ScrollPane to left\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to left");
    produceTimeRestricted(new Action<Void,adjustable.HORIZONTAL);
            return null;
        }

        @Override
        public String getDescription() {
            return "Scrolling";
        }

        @Override
        public String toString() {
            return "ScrollPaneOperator.scrollToLeft.Action{description = " + getDescription() + '}';
        }
    },"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk-jdk10    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to right.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToRight() {
    output.printTrace("Scroll ScrollPane to right\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to right");
    produceTimeRestricted(new Action<Void,adjustable.HORIZONTAL);
            return null;
        }

        @Override
        public String getDescription() {
            return "Scrolling";
        }

        @Override
        public String toString() {
            return "ScrollPaneOperator.scrollToRight.Action{description = " + getDescription() + '}';
        }
    },"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk-jdk10    文件ScrollPaneOperator.java   
@Override
public int getScrollDirection() {
    int sp = (orientation == adjustable.HORIZONTAL)
            ? (int) getScrollPosition().getX()
            : (int) getScrollPosition().getY();
    Point pnt = SwingUtilities.convertPoint(comp,((Container) getSource()).getComponents()[0]);
    int cp = (orientation == adjustable.HORIZONTAL)
            ? pnt.x
            : pnt.y;
    int sl = (orientation == adjustable.HORIZONTAL)
            ? (int) getViewportSize().getWidth()
            : (int) getViewportSize().getHeight();
    int cl = (orientation == adjustable.HORIZONTAL)
            ? width
            : height;
    if (cp <= sp) {
        return ScrollAdjuster.DECREASE_SCROLL_DIRECTION;
    } else if ((cp + cl) > (sp + sl)
            && cp > sp) {
        return ScrollAdjuster.INCREASE_SCROLL_DIRECTION;
    } else {
        return ScrollAdjuster.DO_NOT_TOUCH_SCROLL_DIRECTION;
    }
}
项目:openjdk9    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,increment);
        }
    }
}
项目:openjdk9    文件ScrollPaneWheelScroller.java   
public static int getIncrementFromadjustable(adjustable adj,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINE)) {
        if (adj == null) {
            log.fine("Assertion (adj != null) Failed");
        }
    }

    int increment = 0;

    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        increment = e.getUnitsToScroll() * adj.getUnitIncrement();
    }
    else if (e.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) {
        increment = adj.getBlockIncrement() * e.getWheelRotation();
    }
    return increment;
}
项目:openjdk9    文件LWScrollBarPeer.java   
@Override
void initializeImpl() {
    super.initializeImpl();
    final Scrollbar target = getTarget();
    setLineIncrement(target.getUnitIncrement());
    setPageIncrement(target.getBlockIncrement());
    setValues(target.getValue(),target.getMaximum());

    final int orientation = target.getorientation();
    final JScrollBar delegate = getDelegate();
    synchronized (getDelegateLock()) {
        delegate.setorientation(orientation == Scrollbar.HORIZONTAL
                                ? adjustable.HORIZONTAL
                                : adjustable.VERTICAL);
        delegate.addAdjustmentListener(this);
    }
}
项目:openjdk9    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to top.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToTop() {
    output.printTrace("Scroll ScrollPane to top\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to top");
    produceTimeRestricted(new Action<Void,"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk9    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to bottom.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToBottom() {
    output.printTrace("Scroll ScrollPane to bottom\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to bottom");
    produceTimeRestricted(new Action<Void,"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk9    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to left.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToLeft() {
    output.printTrace("Scroll ScrollPane to left\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to left");
    produceTimeRestricted(new Action<Void,"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk9    文件ScrollPaneOperator.java   
/**
 * Scrolls pane to right.
 *
 * @throws TimeoutExpiredException
 */
public void scrollToRight() {
    output.printTrace("Scroll ScrollPane to right\n"
            + toStringSource());
    output.printGolden("Scroll ScrollPane to right");
    produceTimeRestricted(new Action<Void,"ScrollbarOperator.WholeScrollTimeout");
}
项目:openjdk9    文件ScrollPaneOperator.java   
@Override
public int getScrollDirection() {
    int sp = (orientation == adjustable.HORIZONTAL)
            ? (int) getScrollPosition().getX()
            : (int) getScrollPosition().getY();
    Point pnt = SwingUtilities.convertPoint(comp,((Container) getSource()).getComponents()[0]);
    int cp = (orientation == adjustable.HORIZONTAL)
            ? pnt.x
            : pnt.y;
    int sl = (orientation == adjustable.HORIZONTAL)
            ? (int) getViewportSize().getWidth()
            : (int) getViewportSize().getHeight();
    int cl = (orientation == adjustable.HORIZONTAL)
            ? width
            : height;
    if (cp <= sp) {
        return ScrollAdjuster.DECREASE_SCROLL_DIRECTION;
    } else if ((cp + cl) > (sp + sl)
            && cp > sp) {
        return ScrollAdjuster.INCREASE_SCROLL_DIRECTION;
    } else {
        return ScrollAdjuster.DO_NOT_TOUCH_SCROLL_DIRECTION;
    }
}
项目:pumpernickel    文件ScrollableColorPaletteUI.java   
public final JScrollBar getHorizontalScrollBar(ColorPalette cp) {
    for(int index = 0; index<cp.getComponentCount(); index++) {
        Component comp = cp.getComponent(index);
        if(comp instanceof JScrollBar) {
            JScrollBar jsb = (JScrollBar)comp;
            if(jsb.getorientation()==adjustable.HORIZONTAL) {
                return jsb;
            }
        }
    }

    int max = getHorizontalScrollMax(cp);
    if(max>1) {
        JScrollBar hBar = new JScrollBar(adjustable.HORIZONTAL,max);
        hBar.addAdjustmentListener(scrollBarListener);
        cp.add(hBar);
        hBar.putClientProperty("JComponent.sizeVariant","mini");
        hBar.setCursor(Cursor.getDefaultCursor());
        updateScrollBarBounds(cp);
        return hBar;
    }


    return null;
}
项目:pumpernickel    文件ScrollableColorPaletteUI.java   
public final JScrollBar getVerticalScrollBar(ColorPalette cp) {
    for(int index = 0; index<cp.getComponentCount(); index++) {
        Component comp = cp.getComponent(index);
        if(comp instanceof JScrollBar) {
            JScrollBar jsb = (JScrollBar)comp;
            if(jsb.getorientation()==adjustable.VERTICAL) {
                return jsb;
            }
        }
    }

    int max = getVerticalScrollMax(cp);
    if(max>1) {
        JScrollBar vBar = new JScrollBar(adjustable.VERTICAL,max);
        vBar.addAdjustmentListener(scrollBarListener);
        cp.add(vBar);
        vBar.putClientProperty("JComponent.sizeVariant","mini");
        vBar.setCursor(Cursor.getDefaultCursor());
        updateScrollBarBounds(cp);
        return vBar;
    }


    return null;
}
项目:jdk8u_jdk    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,increment);
        }
    }
}
项目:jdk8u_jdk    文件ScrollPaneWheelScroller.java   
public static int getIncrementFromadjustable(adjustable adj,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINE)) {
        if (adj == null) {
            log.fine("Assertion (adj != null) Failed");
        }
    }

    int increment = 0;

    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        increment = e.getUnitsToScroll() * adj.getUnitIncrement();
    }
    else if (e.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) {
        increment = adj.getBlockIncrement() * e.getWheelRotation();
    }
    return increment;
}
项目:jdk8u_jdk    文件LWScrollBarPeer.java   
@Override
void initializeImpl() {
    super.initializeImpl();
    final Scrollbar target = getTarget();
    setLineIncrement(target.getUnitIncrement());
    setPageIncrement(target.getBlockIncrement());
    setValues(target.getValue(),target.getMaximum());

    final int orientation = target.getorientation();
    final JScrollBar delegate = getDelegate();
    synchronized (getDelegateLock()) {
        delegate.setorientation(orientation == Scrollbar.HORIZONTAL
                                ? adjustable.HORIZONTAL
                                : adjustable.VERTICAL);
        delegate.addAdjustmentListener(this);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,increment);
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件ScrollPaneWheelScroller.java   
public static int getIncrementFromadjustable(adjustable adj,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINE)) {
        if (adj == null) {
            log.fine("Assertion (adj != null) Failed");
        }
    }

    int increment = 0;

    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        increment = e.getUnitsToScroll() * adj.getUnitIncrement();
    }
    else if (e.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) {
        increment = adj.getBlockIncrement() * e.getWheelRotation();
    }
    return increment;
}
项目:lookaside_java-1.8.0-openjdk    文件LWScrollBarPeer.java   
@Override
void initializeImpl() {
    super.initializeImpl();
    final Scrollbar target = getTarget();
    setLineIncrement(target.getUnitIncrement());
    setPageIncrement(target.getBlockIncrement());
    setValues(target.getValue(),target.getMaximum());

    final int orientation = target.getorientation();
    final JScrollBar delegate = getDelegate();
    synchronized (getDelegateLock()) {
        delegate.setorientation(orientation == Scrollbar.HORIZONTAL
                                ? adjustable.HORIZONTAL
                                : adjustable.VERTICAL);
        delegate.addAdjustmentListener(this);
    }
}
项目:rapidminer-studio    文件ScrollBarUI.java   
@Override
protected void paintTrack(Graphics g,y + h);
    }
}
项目:rapidminer-studio    文件ScrollBarUI.java   
@Override
protected void paintThumb(Graphics g,h);
        }
    }
}
项目:windowlicker    文件JScrollbarDriver.java   
public void scroll(final int movement) {
    ScrollbarLocationManipulation locationManipulation = new ScrollbarLocationManipulation();
    perform("locating scroll bar",locationManipulation);

    moveMousetoOffset(locationManipulation.getX(),locationManipulation.getY());

    performGesture(new mousepressGesture(InputEvent.BUTTON1_MASK));

    if (locationManipulation.getorientation() == adjustable.HORIZONTAL) {
        performGesture(new MouseMoveAbsoluteGesture(adjustable.HORIZONTAL,movement));
    } else {
        performGesture(new MouseMoveAbsoluteGesture(adjustable.HORIZONTAL,movement));
    }

    performGesture(new MouseReleaseGesture(InputEvent.BUTTON1_MASK));
}
项目:infobip-open-jdk-8    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,increment);
        }
    }
}
项目:infobip-open-jdk-8    文件ScrollPaneWheelScroller.java   
public static int getIncrementFromadjustable(adjustable adj,MouseWheelEvent e) {
    if (log.isLoggable(Platformlogger.Level.FINE)) {
        if (adj == null) {
            log.fine("Assertion (adj != null) Failed");
        }
    }

    int increment = 0;

    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
        increment = e.getUnitsToScroll() * adj.getUnitIncrement();
    }
    else if (e.getScrollType() == MouseWheelEvent.WHEEL_BLOCK_SCROLL) {
        increment = adj.getBlockIncrement() * e.getWheelRotation();
    }
    return increment;
}
项目:infobip-open-jdk-8    文件LWScrollBarPeer.java   
@Override
void initializeImpl() {
    super.initializeImpl();
    final Scrollbar target = getTarget();
    setLineIncrement(target.getUnitIncrement());
    setPageIncrement(target.getBlockIncrement());
    setValues(target.getValue(),target.getMaximum());

    final int orientation = target.getorientation();
    final JScrollBar delegate = getDelegate();
    synchronized (getDelegateLock()) {
        delegate.setorientation(orientation == Scrollbar.HORIZONTAL
                                ? adjustable.HORIZONTAL
                                : adjustable.VERTICAL);
        delegate.addAdjustmentListener(this);
    }
}
项目:jdk8u-dev-jdk    文件ScrollPaneWheelScroller.java   
public static void handleWheelScrolling(ScrollPane sp,increment);
        }
    }
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。