java类java.awt.event.AdjustmentEvent的实例源码

EULADialog.java 文件源码 项目:rapidminer 阅读 44 收藏 0 点赞 0 评论 0
/**
 * Listens to changes of the scroll bar of the text are showing the EULA text, enables the check
 * box once the user scrolled to the end of the document.
 */
@Override
public void adjustmentValueChanged(AdjustmentEvent e) {
    JScrollBar scrollBar = this.scrollPane.getVerticalScrollBar();
    if (e.getSource() == scrollBar) {
        // the maximum value of the scroll bar assumes that the content is
        // not visible anymore, since this is not the case when scrolling
        // to the end of the document (the last part is still visible),
        // we have to include the visible amount in the comparison
        int currentValue = scrollBar.getValue() + scrollBar.getVisibleAmount();
        if (currentValue >= scrollBar.getMaximum()) {
            // the user scrolled to the end of the document
            this.acceptCheckBox.setEnabled(true);
            this.acceptCheckBox.requestFocusInWindow();
        }
    }
}
JEditTextArea.java 文件源码 项目:rapidminer 阅读 36 收藏 0 点赞 0 评论 0
@Override
public void adjustmentValueChanged(final AdjustmentEvent evt) {
    if (!scrollBarsInitialized) {
        return;
    }

    // If this is not done, mousePressed events accumilate
    // and the result is that scrolling doesn't stop after
    // the mouse is released
    SwingUtilities.invokeLater(new Runnable() {

        @Override
        public void run() {
            if (evt.getAdjustable() == vertical) {
                setFirstLine(vertical.getValue());
            } else {
                setHorizontalOffset(-horizontal.getValue());
            }
        }
    });
}
ScrollPaneAdjustable.java 文件源码 项目:OpenJSharp 阅读 37 收藏 0 点赞 0 评论 0
/**
 * Sets the value of this scrollbar to the specified value.
 * <p>
 * If the value supplied is less than the current minimum or
 * greater than the current maximum, then one of those values is
 * substituted, as appropriate. Also, creates and dispatches
 * the AdjustementEvent with specified type and value.
 *
 * @param v the new value of the scrollbar
 * @param type the type of the scrolling operation occurred
 */
private void setTypedValue(int v, int type) {
    v = Math.max(v, minimum);
    v = Math.min(v, maximum - visibleAmount);

    if (v != value) {
        value = v;
        // Synchronously notify the listeners so that they are
        // guaranteed to be up-to-date with the Adjustable before
        // it is mutated again.
        AdjustmentEvent e =
            new AdjustmentEvent(this,
                    AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                    type, value, isAdjusting);
        adjustmentListener.adjustmentValueChanged(e);
    }
}
WScrollbarPeer.java 文件源码 项目:OpenJSharp 阅读 35 收藏 0 点赞 0 评论 0
void dragEnd(final int value) {
    final Scrollbar sb = (Scrollbar)target;

    if (!dragInProgress) {
        return;
    }

    dragInProgress = false;
    WToolkit.executeOnEventHandlerThread(sb, new Runnable() {
        public void run() {
            // NB: notification only, no sb.setValue()
            // last TRACK event will have done it already
            sb.setValueIsAdjusting(false);
            postEvent(new AdjustmentEvent(sb,
                            AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                            AdjustmentEvent.TRACK, value, false));
        }
    });
}
ListHelper.java 文件源码 项目:OpenJSharp 阅读 36 收藏 0 点赞 0 评论 0
void trackMouseDraggedScroll(int mouseX, int mouseY, int listWidth, int listHeight){

        if (!mouseDraggedOutVertically){
            if (vsb.beforeThumb(mouseX, mouseY)) {
                vsb.setMode(AdjustmentEvent.UNIT_DECREMENT);
            } else {
                vsb.setMode(AdjustmentEvent.UNIT_INCREMENT);
            }
        }

        if(!mouseDraggedOutVertically && (mouseY < 0 || mouseY >= listHeight)){
            mouseDraggedOutVertically = true;
            vsb.startScrollingInstance();
        }

        if (mouseDraggedOutVertically && mouseY >= 0 && mouseY < listHeight && mouseX >= 0 && mouseX < listWidth){
            mouseDraggedOutVertically = false;
            vsb.stopScrollingInstance();
        }
    }
Cart.java 文件源码 项目:PointOfSale 阅读 39 收藏 0 点赞 0 评论 0
public JScrollPane generateScrollPane()
{   
    JScrollPane newScroll = new JScrollPane();
    JList list = new JList(listModel);
    list.setFont( new Font("monospaced", Font.PLAIN, 12) );
    newScroll.setViewportView(list);

    Dimension listSize = new Dimension(400, 150);
    newScroll.setSize(listSize);
    newScroll.setMaximumSize(listSize);
    newScroll.setPreferredSize(listSize);

    newScroll.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener() {  
        public void adjustmentValueChanged(AdjustmentEvent e) {  
            e.getAdjustable().setValue(e.getAdjustable().getMaximum());  
        }
    }); 
    return newScroll;
}
SpeedJScrollBar.java 文件源码 项目:JuggleMasterPro 阅读 37 收藏 0 点赞 0 评论 0
/**
 * Method description
 * 
 * @see
 * @param objPadjustmentEvent
 */
@Override final public void adjustmentValueChanged(AdjustmentEvent objPadjustmentEvent) {

    final byte bytLpreviousValue = this.objGcontrolJFrame.getControlValue(Constants.bytS_BYTE_LOCAL_SPEED);
    final byte bytLcurrentValue = (byte) objPadjustmentEvent.getValue();
    if (bytLcurrentValue != bytLpreviousValue) {
        this.objGcontrolJFrame.saveControlValue(Constants.bytS_BYTE_LOCAL_SPEED, bytLcurrentValue);

        // TODO : si pas de doRestartJuggling
        // this.objGcontrolJFrame.setSpeedControls();
        // this.objGcontrolJFrame.doAddAction(Constants.intS_ACTION_INIT_TITLES | Constants.intS_ACTION_INIT_ANIMATION_PROPERTIES);

        Tools.debug("SpeedJScrollBar.adjustmentValueChanged(): ControlJFrame.doRestartJuggling()");
        this.objGcontrolJFrame.doRestartJuggling();
    }
}
StrobeJScrollBar.java 文件源码 项目:JuggleMasterPro 阅读 38 收藏 0 点赞 0 评论 0
/**
 * Method description
 * 
 * @see
 * @param objPadjustmentEvent
 */
@Override final public void adjustmentValueChanged(AdjustmentEvent objPadjustmentEvent) {

    Tools.debug("StrobeJScrollBar.adjustmentValueChanged()");
    final byte bytLcurrentValue = (byte) objPadjustmentEvent.getValue();
    final byte bytLpreviousValue = this.objGcontrolJFrame.getControlValue(Constants.bytS_BYTE_LOCAL_STROBE);
    if (bytLcurrentValue != bytLpreviousValue) {
        this.objGcontrolJFrame.saveControlValue(Constants.bytS_BYTE_LOCAL_STROBE, bytLcurrentValue);
        if ((this.objGcontrolJFrame.isControlSelected(Constants.bytS_BOOLEAN_LOCAL_FLASH) || this.objGcontrolJFrame.isControlSelected(Constants.bytS_BOOLEAN_LOCAL_ROBOT))
            && this.objGcontrolJFrame.isControlSelected(Constants.bytS_BOOLEAN_LOCAL_BALLS)
            && this.objGcontrolJFrame.getControlValue(Constants.bytS_BYTE_LOCAL_BALLS_TRAIL) == Constants.bytS_BYTE_LOCAL_BALLS_TRAIL_FULL) {
            this.objGcontrolJFrame.doAddAction(Constants.intS_ACTION_INIT_TITLES | Constants.intS_ACTION_CLEAR_ANIMATION_IMAGE
                                                | Constants.intS_ACTION_RECREATE_JUGGLER_TRAILS_IMAGES
                                                | Constants.intS_ACTION_RECREATE_BALLS_TRAILS_IMAGES);
        }
        this.objGcontrolJFrame.setStrobeControls();
    }
}
ScrollPaneAdjustable.java 文件源码 项目:jdk8u-jdk 阅读 44 收藏 0 点赞 0 评论 0
/**
 * Sets the value of this scrollbar to the specified value.
 * <p>
 * If the value supplied is less than the current minimum or
 * greater than the current maximum, then one of those values is
 * substituted, as appropriate. Also, creates and dispatches
 * the AdjustementEvent with specified type and value.
 *
 * @param v the new value of the scrollbar
 * @param type the type of the scrolling operation occurred
 */
private void setTypedValue(int v, int type) {
    v = Math.max(v, minimum);
    v = Math.min(v, maximum - visibleAmount);

    if (v != value) {
        value = v;
        // Synchronously notify the listeners so that they are
        // guaranteed to be up-to-date with the Adjustable before
        // it is mutated again.
        AdjustmentEvent e =
            new AdjustmentEvent(this,
                    AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                    type, value, isAdjusting);
        adjustmentListener.adjustmentValueChanged(e);
    }
}
WScrollbarPeer.java 文件源码 项目:jdk8u-jdk 阅读 35 收藏 0 点赞 0 评论 0
void dragEnd(final int value) {
    final Scrollbar sb = (Scrollbar)target;

    if (!dragInProgress) {
        return;
    }

    dragInProgress = false;
    WToolkit.executeOnEventHandlerThread(sb, new Runnable() {
        public void run() {
            // NB: notification only, no sb.setValue()
            // last TRACK event will have done it already
            sb.setValueIsAdjusting(false);
            postEvent(new AdjustmentEvent(sb,
                            AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                            AdjustmentEvent.TRACK, value, false));
        }
    });
}
ListHelper.java 文件源码 项目:jdk8u-jdk 阅读 34 收藏 0 点赞 0 评论 0
void trackMouseDraggedScroll(int mouseX, int mouseY, int listWidth, int listHeight){

        if (!mouseDraggedOutVertically){
            if (vsb.beforeThumb(mouseX, mouseY)) {
                vsb.setMode(AdjustmentEvent.UNIT_DECREMENT);
            } else {
                vsb.setMode(AdjustmentEvent.UNIT_INCREMENT);
            }
        }

        if(!mouseDraggedOutVertically && (mouseY < 0 || mouseY >= listHeight)){
            mouseDraggedOutVertically = true;
            vsb.startScrollingInstance();
        }

        if (mouseDraggedOutVertically && mouseY >= 0 && mouseY < listHeight && mouseX >= 0 && mouseX < listWidth){
            mouseDraggedOutVertically = false;
            vsb.stopScrollingInstance();
        }
    }
ScrollPaneAdjustable.java 文件源码 项目:openjdk-jdk10 阅读 33 收藏 0 点赞 0 评论 0
/**
 * Sets the value of this scrollbar to the specified value.
 * <p>
 * If the value supplied is less than the current minimum or
 * greater than the current maximum, then one of those values is
 * substituted, as appropriate. Also, creates and dispatches
 * the AdjustmentEvent with specified type and value.
 *
 * @param v the new value of the scrollbar
 * @param type the type of the scrolling operation occurred
 */
private void setTypedValue(int v, int type) {
    v = Math.max(v, minimum);
    v = Math.min(v, maximum - visibleAmount);

    if (v != value) {
        value = v;
        // Synchronously notify the listeners so that they are
        // guaranteed to be up-to-date with the Adjustable before
        // it is mutated again.
        AdjustmentEvent e =
            new AdjustmentEvent(this,
                    AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                    type, value, isAdjusting);
        adjustmentListener.adjustmentValueChanged(e);
    }
}
ListHelper.java 文件源码 项目:openjdk-jdk10 阅读 38 收藏 0 点赞 0 评论 0
void trackMouseDraggedScroll(int mouseX, int mouseY, int listWidth, int listHeight){

        if (!mouseDraggedOutVertically){
            if (vsb.beforeThumb(mouseX, mouseY)) {
                vsb.setMode(AdjustmentEvent.UNIT_DECREMENT);
            } else {
                vsb.setMode(AdjustmentEvent.UNIT_INCREMENT);
            }
        }

        if(!mouseDraggedOutVertically && (mouseY < 0 || mouseY >= listHeight)){
            mouseDraggedOutVertically = true;
            vsb.startScrollingInstance();
        }

        if (mouseDraggedOutVertically && mouseY >= 0 && mouseY < listHeight && mouseX >= 0 && mouseX < listWidth){
            mouseDraggedOutVertically = false;
            vsb.stopScrollingInstance();
        }
    }
WScrollbarPeer.java 文件源码 项目:openjdk-jdk10 阅读 40 收藏 0 点赞 0 评论 0
void dragEnd(final int value) {
    final Scrollbar sb = (Scrollbar)target;

    if (!dragInProgress) {
        return;
    }

    dragInProgress = false;
    WToolkit.executeOnEventHandlerThread(sb, new Runnable() {
        public void run() {
            // NB: notification only, no sb.setValue()
            // last TRACK event will have done it already
            sb.setValueIsAdjusting(false);
            postEvent(new AdjustmentEvent(sb,
                            AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                            AdjustmentEvent.TRACK, value, false));
        }
    });
}
DSDPDemo.java 文件源码 项目:geomapapp 阅读 59 收藏 0 点赞 0 评论 0
public void adjustmentValueChanged(AdjustmentEvent ae) {
    if ( sp != null && 
            ae.getSource() == sp.getVerticalScrollBar()  &&
            ! adjustment && 
            coreDisp != null)   {
        adjustGraphs( coreDisp.getZScale(), 
                coreDisp.getVisibleRect().getCenterY(), 
                "FOSSIL DISPLAY" );
    }
    else if ( sedimentSP != null && 
            ae.getSource() == sedimentSP.getVerticalScrollBar() &&
            !adjustment && 
            sedimentGraph != null) {
        adjustGraphs( sedimentGraph.getZoom(), 
                sedimentGraph.getVisibleRect().getCenterY(), 
                "SEDIMENT GRAPH" );
    }
}
JTimePanel.java 文件源码 项目:hy.common.ui 阅读 34 收藏 0 点赞 0 评论 0
public void adjustmentValueChanged(AdjustmentEvent e)
{
    if ( isAllowEvent )
    {
        if ( e.getValue() == -1 )
        {
            jsHour.setValue(23);
            return;
        }
        else if ( e.getValue() == 24 )
        {
            jsHour.setValue(0);
            return;
        }

        setHour(e.getValue());
    }
}
JTimePanel.java 文件源码 项目:hy.common.ui 阅读 39 收藏 0 点赞 0 评论 0
public void adjustmentValueChanged(AdjustmentEvent e)
{
    if ( isAllowEvent )
    {
        if ( e.getValue() == -1 )
        {
            jsMinute.setValue(59);
            return;
        }
        else if ( e.getValue() == 60 )
        {
            jsMinute.setValue(0);
            return;
        }

        setMinute(e.getValue());
    }
}
JTimePanel.java 文件源码 项目:hy.common.ui 阅读 39 收藏 0 点赞 0 评论 0
public void adjustmentValueChanged(AdjustmentEvent e)
{
    if ( isAllowEvent )
    {
        if ( e.getValue() == -1 )
        {
            jsSecond.setValue(59);
            return;
        }
        else if ( e.getValue() == 60 )
        {
            jsSecond.setValue(0);
            return;
        }

        setSecond(e.getValue());
    }
}
ScrollPaneAdjustable.java 文件源码 项目:openjdk9 阅读 34 收藏 0 点赞 0 评论 0
/**
 * Sets the value of this scrollbar to the specified value.
 * <p>
 * If the value supplied is less than the current minimum or
 * greater than the current maximum, then one of those values is
 * substituted, as appropriate. Also, creates and dispatches
 * the AdjustmentEvent with specified type and value.
 *
 * @param v the new value of the scrollbar
 * @param type the type of the scrolling operation occurred
 */
private void setTypedValue(int v, int type) {
    v = Math.max(v, minimum);
    v = Math.min(v, maximum - visibleAmount);

    if (v != value) {
        value = v;
        // Synchronously notify the listeners so that they are
        // guaranteed to be up-to-date with the Adjustable before
        // it is mutated again.
        AdjustmentEvent e =
            new AdjustmentEvent(this,
                    AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                    type, value, isAdjusting);
        adjustmentListener.adjustmentValueChanged(e);
    }
}
ListHelper.java 文件源码 项目:openjdk9 阅读 31 收藏 0 点赞 0 评论 0
void trackMouseDraggedScroll(int mouseX, int mouseY, int listWidth, int listHeight){

        if (!mouseDraggedOutVertically){
            if (vsb.beforeThumb(mouseX, mouseY)) {
                vsb.setMode(AdjustmentEvent.UNIT_DECREMENT);
            } else {
                vsb.setMode(AdjustmentEvent.UNIT_INCREMENT);
            }
        }

        if(!mouseDraggedOutVertically && (mouseY < 0 || mouseY >= listHeight)){
            mouseDraggedOutVertically = true;
            vsb.startScrollingInstance();
        }

        if (mouseDraggedOutVertically && mouseY >= 0 && mouseY < listHeight && mouseX >= 0 && mouseX < listWidth){
            mouseDraggedOutVertically = false;
            vsb.stopScrollingInstance();
        }
    }
WScrollbarPeer.java 文件源码 项目:openjdk9 阅读 36 收藏 0 点赞 0 评论 0
void dragEnd(final int value) {
    final Scrollbar sb = (Scrollbar)target;

    if (!dragInProgress) {
        return;
    }

    dragInProgress = false;
    WToolkit.executeOnEventHandlerThread(sb, new Runnable() {
        public void run() {
            // NB: notification only, no sb.setValue()
            // last TRACK event will have done it already
            sb.setValueIsAdjusting(false);
            postEvent(new AdjustmentEvent(sb,
                            AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                            AdjustmentEvent.TRACK, value, false));
        }
    });
}
DefaultCodeAreaPainter.java 文件源码 项目:deltahex-java 阅读 28 收藏 0 点赞 0 评论 0
@Override
        public void adjustmentValueChanged(AdjustmentEvent e) {
            if (horizontalScrollUnit == HorizontalScrollUnit.CHARACTER) {
                scrollPosition.setScrollCharPosition(scrollPanel.getHorizontalScrollBar().getValue());
            } else {
                if (characterWidth > 0) {
                    int horizontalScroll = scrollPanel.getHorizontalScrollBar().getValue();
                    scrollPosition.setScrollCharPosition(horizontalScroll / characterWidth);
                    scrollPosition.setScrollCharOffset(horizontalScroll % characterWidth);
                }
            }

            worker.getCodeArea().repaint();
//            dataViewScrolled(codeArea.getGraphics());
            notifyScrolled();
        }
ScrollPaneAdjustable.java 文件源码 项目:Java8CN 阅读 37 收藏 0 点赞 0 评论 0
/**
 * Sets the value of this scrollbar to the specified value.
 * <p>
 * If the value supplied is less than the current minimum or
 * greater than the current maximum, then one of those values is
 * substituted, as appropriate. Also, creates and dispatches
 * the AdjustementEvent with specified type and value.
 *
 * @param v the new value of the scrollbar
 * @param type the type of the scrolling operation occurred
 */
private void setTypedValue(int v, int type) {
    v = Math.max(v, minimum);
    v = Math.min(v, maximum - visibleAmount);

    if (v != value) {
        value = v;
        // Synchronously notify the listeners so that they are
        // guaranteed to be up-to-date with the Adjustable before
        // it is mutated again.
        AdjustmentEvent e =
            new AdjustmentEvent(this,
                    AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                    type, value, isAdjusting);
        adjustmentListener.adjustmentValueChanged(e);
    }
}
ScrollPaneAdjustable.java 文件源码 项目:jdk8u_jdk 阅读 31 收藏 0 点赞 0 评论 0
/**
 * Sets the value of this scrollbar to the specified value.
 * <p>
 * If the value supplied is less than the current minimum or
 * greater than the current maximum, then one of those values is
 * substituted, as appropriate. Also, creates and dispatches
 * the AdjustementEvent with specified type and value.
 *
 * @param v the new value of the scrollbar
 * @param type the type of the scrolling operation occurred
 */
private void setTypedValue(int v, int type) {
    v = Math.max(v, minimum);
    v = Math.min(v, maximum - visibleAmount);

    if (v != value) {
        value = v;
        // Synchronously notify the listeners so that they are
        // guaranteed to be up-to-date with the Adjustable before
        // it is mutated again.
        AdjustmentEvent e =
            new AdjustmentEvent(this,
                    AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                    type, value, isAdjusting);
        adjustmentListener.adjustmentValueChanged(e);
    }
}
WScrollbarPeer.java 文件源码 项目:jdk8u_jdk 阅读 40 收藏 0 点赞 0 评论 0
void dragEnd(final int value) {
    final Scrollbar sb = (Scrollbar)target;

    if (!dragInProgress) {
        return;
    }

    dragInProgress = false;
    WToolkit.executeOnEventHandlerThread(sb, new Runnable() {
        public void run() {
            // NB: notification only, no sb.setValue()
            // last TRACK event will have done it already
            sb.setValueIsAdjusting(false);
            postEvent(new AdjustmentEvent(sb,
                            AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                            AdjustmentEvent.TRACK, value, false));
        }
    });
}
ListHelper.java 文件源码 项目:jdk8u_jdk 阅读 28 收藏 0 点赞 0 评论 0
void trackMouseDraggedScroll(int mouseX, int mouseY, int listWidth, int listHeight){

        if (!mouseDraggedOutVertically){
            if (vsb.beforeThumb(mouseX, mouseY)) {
                vsb.setMode(AdjustmentEvent.UNIT_DECREMENT);
            } else {
                vsb.setMode(AdjustmentEvent.UNIT_INCREMENT);
            }
        }

        if(!mouseDraggedOutVertically && (mouseY < 0 || mouseY >= listHeight)){
            mouseDraggedOutVertically = true;
            vsb.startScrollingInstance();
        }

        if (mouseDraggedOutVertically && mouseY >= 0 && mouseY < listHeight && mouseX >= 0 && mouseX < listWidth){
            mouseDraggedOutVertically = false;
            vsb.stopScrollingInstance();
        }
    }
ScrollPaneAdjustable.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 32 收藏 0 点赞 0 评论 0
/**
 * Sets the value of this scrollbar to the specified value.
 * <p>
 * If the value supplied is less than the current minimum or
 * greater than the current maximum, then one of those values is
 * substituted, as appropriate. Also, creates and dispatches
 * the AdjustementEvent with specified type and value.
 *
 * @param v the new value of the scrollbar
 * @param type the type of the scrolling operation occurred
 */
private void setTypedValue(int v, int type) {
    v = Math.max(v, minimum);
    v = Math.min(v, maximum - visibleAmount);

    if (v != value) {
        value = v;
        // Synchronously notify the listeners so that they are
        // guaranteed to be up-to-date with the Adjustable before
        // it is mutated again.
        AdjustmentEvent e =
            new AdjustmentEvent(this,
                    AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                    type, value, isAdjusting);
        adjustmentListener.adjustmentValueChanged(e);
    }
}
WScrollbarPeer.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 42 收藏 0 点赞 0 评论 0
void dragEnd(final int value) {
    final Scrollbar sb = (Scrollbar)target;

    if (!dragInProgress) {
        return;
    }

    dragInProgress = false;
    WToolkit.executeOnEventHandlerThread(sb, new Runnable() {
        public void run() {
            // NB: notification only, no sb.setValue()
            // last TRACK event will have done it already
            sb.setValueIsAdjusting(false);
            postEvent(new AdjustmentEvent(sb,
                            AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
                            AdjustmentEvent.TRACK, value, false));
        }
    });
}
ListHelper.java 文件源码 项目:lookaside_java-1.8.0-openjdk 阅读 33 收藏 0 点赞 0 评论 0
void trackMouseDraggedScroll(int mouseX, int mouseY, int listWidth, int listHeight){

        if (!mouseDraggedOutVertically){
            if (vsb.beforeThumb(mouseX, mouseY)) {
                vsb.setMode(AdjustmentEvent.UNIT_DECREMENT);
            } else {
                vsb.setMode(AdjustmentEvent.UNIT_INCREMENT);
            }
        }

        if(!mouseDraggedOutVertically && (mouseY < 0 || mouseY >= listHeight)){
            mouseDraggedOutVertically = true;
            vsb.startScrollingInstance();
        }

        if (mouseDraggedOutVertically && mouseY >= 0 && mouseY < listHeight && mouseX >= 0 && mouseX < listWidth){
            mouseDraggedOutVertically = false;
            vsb.stopScrollingInstance();
        }
    }
JScrollPopupMenu.java 文件源码 项目:Net2Plan 阅读 36 收藏 0 点赞 0 评论 0
private JScrollBar getScrollBar()
{
    if (popupScrollBar == null)
    {
        popupScrollBar = new JScrollBar(JScrollBar.VERTICAL);
        popupScrollBar.addAdjustmentListener(new AdjustmentListener()
        {
            @Override
            public void adjustmentValueChanged(AdjustmentEvent e)
            {
                doLayout();
                repaint();
            }
        });

        popupScrollBar.setVisible(false);
    }

    return popupScrollBar;
}


问题


面经


文章

微信
公众号

扫码关注公众号