Menu

JRangeSlider feature request

Help
2007-05-10
2013-05-29
  • Matt Crider

    Matt Crider - 2007-05-10

    Hi,
    I'm not sure if this is a bug, but if it isn't, its a feature request-- I want to be able to move the JRangeSlider when the range is at the minimum (i.e., 1).  You can drag the slider when there is blue to click on, and even when the control is completely closed there is about a 1 pixel sweet spot that lets you drag it around, but that is too difficult.  I should be able to drag the whole thing down when i drag the top arrow down, and drag it up when i drag the bottom arrow up (and increase the range if i drag the other arrow).

    Anyone know if this is possible?  Otherwise i know its going to annoy our users when it comes time to do this study..

     
    • colin combe

      colin combe - 2007-05-16

      Hi,
      I came across the same problem when I started using JRangeSlider.
      Replace lines 681 to 709 with:
                  case PICK_LEFT_OR_TOP:
                      int low = toLocal(value-pickOffsetLow);
                 
                      if (low < minimum) {
                          low = minimum;
                      }
                      if (low > maximum - minExtent) {//original didn't consider min extent
                          low = maximum - minExtent; //when deciding maximum low value
                      }
                      if (low > highValue - minExtent) {
                          //low = highValue-minExtent;
                          setRange(low, low + minExtent); //move low and high value
                      }
                      else
                          setLowValue(low);
                      break;

                  case PICK_RIGHT_OR_BOTTOM:
                      int high = toLocal(value-pickOffsetHigh);
                     
                      if (high < minimum + minExtent) {//original didn't consider min extent
                          high = minimum + minExtent; //when deciding minimum low value
                      }
                      if (high > maximum) {
                          high = maximum;
                      }
                      if (high < lowValue+minExtent) {
                          //high = lowValue+minExtent;
                          setRange(high - minExtent, high); //move low and high value
                      }
                      else
                          setHighValue(high);
                      break;

      HTH,
      colin

       
    • Matt Crider

      Matt Crider - 2007-06-05

      Thanks colin, that really helped!

       

Log in to post a comment.