public void onMouseDown(Widget sender, int x, int y) {
          float newPercent =
              (float) (x + lower.getOffsetWidth() + bar.getOffsetWidth())
                  / (float) base.getOffsetWidth();
          int newPosition =
              Math.round(
                      (target.getOffsetWidth() + target.getMaxHorizontalScrollPosition())
                          * newPercent)
                  - (target.getOffsetWidth() / 2);

          target.setHorizontalScrollPosition(newPosition);
        }
        public void onMouseMove(Widget sender, int x, int y) {
          if (inDrag) {
            float newPercent =
                (float) ((x - start) + lower.getOffsetWidth()) / (float) base.getOffsetWidth();
            Logger.getAnonymousLogger().log(Level.SPAM, x + " " + newPercent, null);

            int newPosition =
                Math.round(
                        (target.getOffsetWidth() + target.getMaxHorizontalScrollPosition())
                            * newPercent)
                    + x;
            target.setHorizontalScrollPosition(newPosition);
          }
        }
Example #3
0
 public void setWaitVisible(boolean visible) {
   if (visible) {
     wait.setPopupPosition(bodyContainer.getAbsoluteLeft(), bodyContainer.getAbsoluteTop());
     wait.setPixelSize(bodyContainer.getOffsetWidth(), bodyContainer.getOffsetHeight());
     wait.show();
   } else {
     wait.hide();
   }
 }
 public void onMouseDown(Widget sender, int x, int y) {
   float newPercent = (float) x / (float) base.getOffsetWidth();
   int newPosition =
       Math.round(
               (target.getOffsetWidth() + target.getMaxHorizontalScrollPosition())
                   * newPercent)
           - (target.getOffsetWidth() / 2);
   Logger.getAnonymousLogger().log(Level.SPAM, "New Position: " + newPosition, null);
   target.setHorizontalScrollPosition(newPosition);
 }