Exemple #1
0
 @Override
 public void onLoad() {
   if (_isInitialLoad) {
     _isInitialLoad = false;
   }
   DragController.get().addDragEventsHandler(this);
   DragController.get().addSwipeEventHandler(this);
 }
Exemple #2
0
 @Override
 public void onDragStart(DragEvent e) {
   int matrix = getMatrixY(getWidget().getElement());
   int current = getTranslateY(getWidget().getElement());
   if (current != matrix) { // scroll on going
     setTransitionDuration(getWidget().getElement(), 0);
     int diff = current - matrix;
     int offset = diff > 2 ? 2 : diff > -2 ? diff : -2;
     setTranslateY(getWidget().getElement(), matrix + offset);
     DragController.get().suppressClickEvent();
   } else {
     setTransitionDuration(getWidget().getElement(), 0);
   }
 }
Exemple #3
0
 @Override
 public void onDragEnd(DragEvent e) {
   DragController.get().releaseDragCapture(this);
 }
Exemple #4
0
 @Override
 public void onDragStart(DragEvent e) {
   DragController.get().captureDragEvents(this);
   int value = computeNewValue(e);
   setValue(value);
 }
Exemple #5
0
 @Override
 public void onUnload() {
   DragController.get().removeDragEventsHandler(this);
 }
Exemple #6
0
 @Override
 public void onLoad() {
   super.onLoad();
   DragController.get().addDragEventsHandler(this);
 }
Exemple #7
0
 @Override
 protected void onUnload() {
   DragController.get().removeSwipeEventHandler(this);
   super.onUnload();
 }