Package com.google.gwt.event.dom.client

Examples of com.google.gwt.event.dom.client.MouseUpHandler


    DOM.setStyleAttribute(right.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(up.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(down.getElement(), "cursor", "pointer");

    StopPropagationHandler handler = new StopPropagationHandler();
    left.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaX = -bounds.getWidth() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(deltaX, 0, 300);
        event.stopPropagation();
      }
    });
    left.addMouseDownHandler(handler);
    left.addClickHandler(handler);
    left.addDoubleClickHandler(handler);

    right.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaX = bounds.getWidth() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(deltaX, 0, 300);
        event.stopPropagation();
      }
    });
    right.addMouseDownHandler(handler);
    right.addClickHandler(handler);
    right.addDoubleClickHandler(handler);

    up.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaY = bounds.getHeight() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(0, deltaY, 300);
        event.stopPropagation();
      }
    });
    up.addMouseDownHandler(handler);
    up.addClickHandler(handler);
    up.addDoubleClickHandler(handler);

    down.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaY = -bounds.getHeight() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(0, deltaY, 300);
        event.stopPropagation();
      }
    });
    down.addMouseDownHandler(handler);
    down.addClickHandler(handler);
    down.addDoubleClickHandler(handler);

    container.add(panBg);
    container.add(left);
    container.add(right);
    container.add(up);
    container.add(down);

    // Zooming buttons:

    Image zoomBg = new Image(20, 60, 20, 60, zoomBackgroundImage);
    Image zoomIn = new Image(20, 60, 20, 20, zoomInImage);
    Image zoomExtent = new Image(20, 80, 20, 20, zoomExtentImage);
    Image zoomOut = new Image(20, 100, 20, 20, zoomOutImage);

    DOM.setStyleAttribute(zoomIn.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(zoomOut.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(zoomExtent.getElement(), "cursor", "pointer");

    zoomIn.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
        viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index - 1));
        event.stopPropagation();
      }
    });
    zoomIn.addMouseDownHandler(handler);
    zoomIn.addClickHandler(handler);
    zoomIn.addDoubleClickHandler(handler);

    zoomExtent.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        viewPort.applyBounds(viewPort.getMaximumBounds());
        event.stopPropagation();
      }
    });
    zoomExtent.addMouseDownHandler(handler);
    zoomExtent.addClickHandler(handler);
    zoomExtent.addDoubleClickHandler(handler);

    zoomOut.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
        viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index + 1));
        event.stopPropagation();
      }
    });
    zoomOut.addMouseDownHandler(handler);
    zoomOut.addClickHandler(handler);
    zoomOut.addDoubleClickHandler(handler);

    container.add(zoomBg);
    container.add(zoomIn);
    container.add(zoomExtent);
    container.add(zoomOut);

    // Zoom to rectangle buttons:

    Image zoomToRectangle = new Image(20, 130, 20, 20, zoomToRectangleImage);
    zoomToRectangle.setTitle("Zoom to rectangle by dragging the mouse on the map.");
    DOM.setStyleAttribute(zoomToRectangle.getElement(), "cursor", "pointer");
    zoomToRectangle.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        zoomToRectangleGroup = new ZoomToRectGroup(viewPort);
        container.add(zoomToRectangleGroup);
        event.stopPropagation();
View Full Code Here


          }
          event.stopPropagation();
          event.preventDefault();
        }
      });
      eventCatcher.addMouseUpHandler(new MouseUpHandler() {

        public void onMouseUp(MouseUpEvent event) {
          if (event.getNativeButton() != NativeEvent.BUTTON_RIGHT && dragging) {
            dragging = false;
            if (screenBounds != null) {
View Full Code Here

                    setPopupPosition( event.getClientX() - dragStartX,
                                      event.getClientY() - dragStartY );
                }
            }
        } );
        titleBar.addMouseUpHandler( new MouseUpHandler() {

            public void onMouseUp(MouseUpEvent event) {
                dragged = false;
                DOM.releaseCapture( titleBar.getElement() );
            }
View Full Code Here

          //  garden.draw(mouseX, mouseY);
       
      }
        });

        canvas.addMouseUpHandler(new MouseUpHandler(){
      @Override
      public void onMouseUp(MouseUpEvent event) {
            mouseEndX = event.getRelativeX(canvas.getElement());
            mouseEndY = event.getRelativeY(canvas.getElement());
            play.click(mouseStartX, mouseStartY, mouseEndX, mouseEndY);
View Full Code Here

                    setPopupPosition( event.getClientX() - dragStartX,
                            event.getClientY() - dragStartY );
                }
            }
        } );
        header.addMouseUpHandler( new MouseUpHandler() {

            public void onMouseUp(MouseUpEvent event) {
                dragged = false;
                DOM.releaseCapture( header.getElement() );
            }
View Full Code Here

      if (isPreClicked) {
        // If this menu is pre-clicked it doesn't require a full click to select
        // an item, just a mouseup over the item.  If the user then does click the
        // item then that will also give a mouseup so this handler will deal with
        // that case as well.
        addMouseUpHandler(new MouseUpHandler() {
          @Override
          public void onMouseUp(MouseUpEvent event) {
            onClicked();
          }
        });
View Full Code Here

                    setPopupPosition( event.getClientX() - dragStartX,
                                      event.getClientY() - dragStartY );
                }
            }
        } );
        titleBar.addMouseUpHandler( new MouseUpHandler() {

            public void onMouseUp(MouseUpEvent event) {
                dragged = false;
                DOM.releaseCapture( titleBar.getElement() );
            }
View Full Code Here

                    startY = event.getClientY();
                }
            }
        }, MouseDownEvent.getType());

        addDomHandler(new MouseUpHandler() {

            @Override
            public void onMouseUp(final MouseUpEvent event) {
                final int deltaX = Math.abs(event.getClientX() - startX);
                final int deltaY = Math.abs(event.getClientY() - startY);
View Full Code Here

                Button.this.addStyleDependentName(FACE_DOWN_CSS_CLASS);
            }
        }));

        // Remove the "down" face when the button is released
        internalHandlerRegistration.addRegistration(addMouseUpHandler(new MouseUpHandler() {
            public void onMouseUp(MouseUpEvent event) {
                Button.this.removeStyleDependentName(FACE_DOWN_CSS_CLASS);
            }
        }));
        impl.disableTextSelection(getElement());
View Full Code Here

    disableTextSelection(boundaryPanel.getElement(), true);

    setSelectionMode(false);

    this.boundaryPanel.addDomHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Point endSelectionPoint = new Point(event.getX(), event.getY());
        if (startSelectionPoint != null) {
View Full Code Here

TOP

Related Classes of com.google.gwt.event.dom.client.MouseUpHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.