class RangeTrackListener extends TrackListener {

            @Override
            public void mousePressed(MouseEvent e) {<FILL_FUNCTION_BODY>}

            @Override
            public void mouseReleased(MouseEvent e) {
                lowerDragging = false;
                upperDragging = false;
                slider.setValueIsAdjusting(false);
                super.mouseReleased(e);
            }

            @Override
            public void mouseDragged(MouseEvent e) {
                if (!slider.isEnabled()) {
                    return;
                }

                currentMouseX = e.getX();
                currentMouseY = e.getY();

                if (lowerDragging) {
                    slider.setValueIsAdjusting(true);
                    moveLowerThumb();

                } else if (upperDragging) {
                    slider.setValueIsAdjusting(true);
                    moveUpperThumb();
                }
            }

            @Override
            public boolean shouldScroll(int direction) {
                return false;
            }

            /**
             * Moves the location of the lower thumb, and sets its corresponding
             * value in the slider.
             */
            private void moveLowerThumb() {
                int thumbMiddle = 0;

                switch (slider.getOrientation()) {
                    case JSlider.VERTICAL:
                        int halfThumbHeight = thumbRect.height / 2;
                        int thumbTop = currentMouseY - offset;
                        int trackTop = trackRect.y;
                        int trackBottom = trackRect.y + (trackRect.height - 1);
                        int vMax = yPositionForValue(slider.getValue() + slider.getExtent());

                        // Apply bounds to thumb position.
                        if (drawInverted()) {
                            trackBottom = vMax;
                        } else {
                            trackTop = vMax;
                        }
                        thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight);
                        thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight);

                        setThumbLocation(thumbRect.x, thumbTop);

                        // Update slider value.
                        thumbMiddle = thumbTop + halfThumbHeight;
                        slider.setValue(valueForYPosition(thumbMiddle));
                        break;

                    case JSlider.HORIZONTAL:
                        int halfThumbWidth = thumbRect.width / 2;
                        int thumbLeft = currentMouseX - offset;
                        int trackLeft = trackRect.x;
                        int trackRight = trackRect.x + (trackRect.width - 1);
                        int hMax = xPositionForValue(slider.getValue() + slider.getExtent());

                        // Apply bounds to thumb position.
                        if (drawInverted()) {
                            trackLeft = hMax;
                        } else {
                            trackRight = hMax;
                        }
                        thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth);
                        thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth);

                        setThumbLocation(thumbLeft, thumbRect.y);

                        // Update slider value.
                        thumbMiddle = thumbLeft + halfThumbWidth;
                        slider.setValue(valueForXPosition(thumbMiddle));
                        break;

                    default:
                        return;
                }
            }

            /**
             * Moves the location of the upper thumb, and sets its corresponding
             * value in the slider.
             */
            private void moveUpperThumb() {
                int thumbMiddle = 0;

                switch (slider.getOrientation()) {
                    case JSlider.VERTICAL:
                        int halfThumbHeight = thumbRect.height / 2;
                        int thumbTop = currentMouseY - offset;
                        int trackTop = trackRect.y;
                        int trackBottom = trackRect.y + (trackRect.height - 1);
                        int vMin = yPositionForValue(slider.getValue());

                        // Apply bounds to thumb position.
                        if (drawInverted()) {
                            trackTop = vMin;
                        } else {
                            trackBottom = vMin;
                        }
                        thumbTop = Math.max(thumbTop, trackTop - halfThumbHeight);
                        thumbTop = Math.min(thumbTop, trackBottom - halfThumbHeight);

                        setUpperThumbLocation(thumbRect.x, thumbTop);

                        // Update slider extent.
                        thumbMiddle = thumbTop + halfThumbHeight;
                        slider.setExtent(valueForYPosition(thumbMiddle) - slider.getValue());
                        break;

                    case JSlider.HORIZONTAL:
                        int halfThumbWidth = thumbRect.width / 2;
                        int thumbLeft = currentMouseX - offset;
                        int trackLeft = trackRect.x;
                        int trackRight = trackRect.x + (trackRect.width - 1);
                        int hMin = xPositionForValue(slider.getValue());

                        // Apply bounds to thumb position.
                        if (drawInverted()) {
                            trackRight = hMin;
                        } else {
                            trackLeft = hMin;
                        }
                        thumbLeft = Math.max(thumbLeft, trackLeft - halfThumbWidth);
                        thumbLeft = Math.min(thumbLeft, trackRight - halfThumbWidth);

                        setUpperThumbLocation(thumbLeft, thumbRect.y);

                        // Update slider extent.
                        thumbMiddle = thumbLeft + halfThumbWidth;
                        slider.setExtent(valueForXPosition(thumbMiddle) - slider.getValue());
                        break;

                    default:
                        return;
                }
            }
        }

                if (!slider.isEnabled()) {
                    return;
                }

                currentMouseX = e.getX();
                currentMouseY = e.getY();

                if (slider.isRequestFocusEnabled()) {
                    slider.requestFocus();
                }

                // Determine which thumb is pressed.  If the upper thumb is
                // selected (last one dragged), then check its position first;
                // otherwise check the position of the lower thumb first.
                boolean lowerPressed = false;
                boolean upperPressed = false;
                if (upperThumbSelected) {
                    if (upperThumbRect.contains(currentMouseX, currentMouseY)) {
                        upperPressed = true;
                    } else if (thumbRect.contains(currentMouseX, currentMouseY)) {
                        lowerPressed = true;
                    }
                } else {
                    if (thumbRect.contains(currentMouseX, currentMouseY)) {
                        lowerPressed = true;
                    } else if (upperThumbRect.contains(currentMouseX, currentMouseY)) {
                        upperPressed = true;
                    }
                }

                // Handle lower thumb pressed.
                if (lowerPressed) {
                    switch (slider.getOrientation()) {
                        case JSlider.VERTICAL:
                            offset = currentMouseY - thumbRect.y;
                            break;
                        case JSlider.HORIZONTAL:
                            offset = currentMouseX - thumbRect.x;
                            break;
                    }
                    upperThumbSelected = false;
                    lowerDragging = true;
                    return;
                }
                lowerDragging = false;

                // Handle upper thumb pressed.
                if (upperPressed) {
                    switch (slider.getOrientation()) {
                        case JSlider.VERTICAL:
                            offset = currentMouseY - upperThumbRect.y;
                            break;
                        case JSlider.HORIZONTAL:
                            offset = currentMouseX - upperThumbRect.x;
                            break;
                    }
                    upperThumbSelected = true;
                    upperDragging = true;
                    return;
                }
                upperDragging = false;
            
<methods>public void <init>() ,public void <init>(int) ,public void <init>(javax.swing.BoundedRangeModel) ,public void <init>(int, int) ,public void <init>(int, int, int) ,public void <init>(int, int, int, int) ,public void addChangeListener(javax.swing.event.ChangeListener) ,public Hashtable<java.lang.Integer,javax.swing.JComponent> createStandardLabels(int) ,public Hashtable<java.lang.Integer,javax.swing.JComponent> createStandardLabels(int, int) ,public javax.accessibility.AccessibleContext getAccessibleContext() ,public javax.swing.event.ChangeListener[] getChangeListeners() ,public int getExtent() ,public boolean getInverted() ,public Dictionary#RAW getLabelTable() ,public int getMajorTickSpacing() ,public int getMaximum() ,public int getMinimum() ,public int getMinorTickSpacing() ,public javax.swing.BoundedRangeModel getModel() ,public int getOrientation() ,public boolean getPaintLabels() ,public boolean getPaintTicks() ,public boolean getPaintTrack() ,public boolean getSnapToTicks() ,public javax.swing.plaf.SliderUI getUI() ,public java.lang.String getUIClassID() ,public int getValue() ,public boolean getValueIsAdjusting() ,public boolean imageUpdate(java.awt.Image, int, int, int, int, int) ,public void removeChangeListener(javax.swing.event.ChangeListener) ,public void setExtent(int) ,public void setFont(java.awt.Font) ,public void setInverted(boolean) ,public void setLabelTable(Dictionary#RAW) ,public void setMajorTickSpacing(int) ,public void setMaximum(int) ,public void setMinimum(int) ,public void setMinorTickSpacing(int) ,public void setModel(javax.swing.BoundedRangeModel) ,public void setOrientation(int) ,public void setPaintLabels(boolean) ,public void setPaintTicks(boolean) ,public void setPaintTrack(boolean) ,public void setSnapToTicks(boolean) ,public void setUI(javax.swing.plaf.SliderUI) ,public void setValue(int) ,public void setValueIsAdjusting(boolean) ,public void updateUI() <variables>protected transient javax.swing.event.ChangeEvent changeEvent,protected javax.swing.event.ChangeListener changeListener,private boolean isInverted,private Dictionary#RAW labelTable,protected int majorTickSpacing,protected int minorTickSpacing,protected int orientation,private boolean paintLabels,private boolean paintTicks,private boolean paintTrack,protected javax.swing.BoundedRangeModel sliderModel,protected boolean snapToTicks,boolean snapToValue,private static final java.lang.String uiClassID