Java 类com.google.gwt.event.dom.client.MouseUpHandler 实例源码

项目:appformer    文件:BaseDOMElement.java   
protected void setupDelegatingMouseUpHandler() {
    widgetContainer.addDomHandler(new MouseUpHandler() {
                                      @Override
                                      public void onMouseUp(final MouseUpEvent event) {
                                          gridLayer.onNodeMouseUp(new NodeMouseUpEvent(event) {

                                              @Override
                                              public int getX() {
                                                  //Adjust the x-coordinate (relative to the DOM Element) to be relative to the GridCanvas.
                                                  return super.getX() + widgetContainer.getElement().getOffsetLeft();
                                              }

                                              @Override
                                              public int getY() {
                                                  //Adjust the y-coordinate (relative to the DOM Element) to be relative to the GridCanvas.
                                                  return super.getY() + widgetContainer.getElement().getOffsetTop();
                                              }
                                          });
                                      }
                                  },
                                  MouseUpEvent.getType());
}
项目:empiria.player    文件:ExplanationController.java   
private void addEntryExamplePanelHandler() {
    this.explanationView.addEntryExamplePanelHandler(new MouseUpHandler() {

        @Override
        public void onMouseUp(MouseUpEvent event) {
            entryDescriptionSoundController.playOrStopEntrySound(entry.getEntrySound());
        }
    });
}
项目:Wiab.pro    文件:PopupMenu.java   
/**
 * Constructs a {@PopupMenuItem}
 *
 * @param text The text label for the item.
 * @param cmd The command to run when the item is clicked.
 * @param isEnabled True if this menu item is enabled.
 * @param hide True if clicking this menu item should hide the popup.
 */
public PopupMenuItem(String text, Command command, boolean isEnabled, boolean hide) {
  super(text, false);

  this.command = command;      
  this.defaultEnabled = isEnabled;
  this.hide = hide;      

  setStyleName(CSS.item());

  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();
      }
    });
  } else {
    addClickHandler(new ClickHandler() {

      @Override
      public void onClick(ClickEvent e) {
        onClicked();
      }
    });
  }
  // Ensure that clicking this menu item doesn't affect the current selection.
  addMouseDownHandler(PREVENT_DEFAULT_HANDLER);
}
项目:dataworks-zeus    文件:CodeMirror.java   
@Override
public void onBrowserEvent(Event event) {
    switch(DOM.eventGetType(event)){
    case Event.ONMOUSEUP:
    case Event.ONMOUSEOVER:
    case Event.ONCLICK:
        for(MouseUpHandler h:mouseListeners){
            h.onMouseUp(null);
        }
    }
}
项目:appformer    文件:StencilPaletteBuilder.java   
private void attachDragProxyHandlers(final LienzoPanel floatingPanel,
                                     final ShapeDragProxy proxy) {
    final Style style = floatingPanel.getElement().getStyle();
    final HandlerRegistration[] handlerRegs = new HandlerRegistration[2];

    //MouseMoveEvents
    handlerRegs[0] = RootPanel.get().addDomHandler(new MouseMoveHandler() {

                                                       @Override
                                                       public void onMouseMove(final MouseMoveEvent mouseMoveEvent) {
                                                           style.setLeft(mouseMoveEvent.getX() - (floatingPanel.getWidth() / 2),
                                                                         Style.Unit.PX);
                                                           style.setTop(mouseMoveEvent.getY() - (floatingPanel.getHeight() / 2),
                                                                        Style.Unit.PX);
                                                           proxy.onDragPreview(mouseMoveEvent.getX(),
                                                                               mouseMoveEvent.getY());
                                                       }
                                                   },
                                                   MouseMoveEvent.getType());

    //MouseUpEvent
    handlerRegs[1] = RootPanel.get().addDomHandler(new MouseUpHandler() {

                                                       @Override
                                                       public void onMouseUp(final MouseUpEvent mouseUpEvent) {
                                                           handlerRegs[0].removeHandler();
                                                           handlerRegs[1].removeHandler();
                                                           RootPanel.get().remove(floatingPanel);
                                                           proxy.onDragComplete(mouseUpEvent.getX(),
                                                                                mouseUpEvent.getY());
                                                       }
                                                   },
                                                   MouseUpEvent.getType());
}
项目:platypus-js    文件:EventsExecutor.java   
public void setMouseReleased(JavaScriptObject aValue) {
    if (mouseReleased != aValue) {
        if (mouseUpReg != null) {
            mouseUpReg.removeHandler();
            mouseUpReg = null;
        }
        mouseReleased = aValue;
        if (mouseReleased != null) {
            MouseUpHandler handler = new MouseUpHandler() {
                @Override
                public void onMouseUp(MouseUpEvent event) {
                    // if (mouseState == MOUSE.PRESSED)
                    // Event.releaseCapture(event.getRelativeElement());
                    if (mouseReleased != null) {
                        event.stopPropagation();
                        mouseState = MOUSE.NULL;
                        executeEvent(mouseReleased, EventsPublisher.publish(event));
                    }
                }
            };
            if (component instanceof Widget)
                mouseUpReg = ((Widget) component).addDomHandler(handler, MouseUpEvent.getType());
            else if (component instanceof HasMouseUpHandlers)
                mouseUpReg = ((HasMouseUpHandlers) component).addMouseUpHandler(handler);
        }
    }
}
项目:qafe-platform    文件:EventFactory.java   
public static MouseUpHandler createOnMouseUpListener(final EventListenerGVO ev, final List<InputVariableGVO> input) {
    return new MouseUpHandler() {
        public void onMouseUp(MouseUpEvent event) {
            Map<String,String> mouseInfo = getMouseInfo(event);
            CallbackHandler.createCallBack(event.getSource(), QAMLConstants.EVENT_ONMOUSE_UP, ev, input, mouseInfo);
        }
    };
}
项目:zeus3    文件:CodeMirror.java   
@Override
public void onBrowserEvent(Event event) {
    switch(DOM.eventGetType(event)){
    case Event.ONMOUSEUP:
    case Event.ONMOUSEOVER:
    case Event.ONCLICK:
        for(MouseUpHandler h:mouseListeners){
            h.onMouseUp(null);
        }
    }
}
项目:QMAClone    文件:PopupCanvas.java   
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    eventHandlers.put(handler, (DomEvent.Type) MouseUpEvent.getType());
    if (canvas != null) {
        canvas.addDomHandler(handler, MouseUpEvent.getType());
    }
    return null;
}
项目:incubator-wave    文件:PopupMenu.java   
/**
 * Constructs a {@PopupMenuItem}
 *
 * @param text The text label for the item.
 * @param cmd The command to run when the item is clicked.
 * @param isEnabled True if this menu item is enabled.
 * @param hide True if clicking this menu item should hide the popup.
 */
public PopupMenuItem(String text, Command cmd, boolean isEnabled, boolean hide) {
  super(text);
  setStyleName(RESOURCES.css().item());
  setEnabled(isEnabled);
  defaultEnabled = isEnabled;
  command = cmd;
  this.hide = hide;
  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();
      }
    });
  } else {
    addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent e) {
        onClicked();
      }
    });
  }
  // Ensure that clicking this menu item doesn't affect the current selection.
  addMouseDownHandler(PREVENT_DEFAULT_HANDLER);
}
项目:incubator-wave    文件:ClickableDivPanel.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, MouseUpEvent.getType());
}
项目:wires    文件:StencilPaletteBuilder.java   
private void attachDragProxyHandlers( final LienzoPanel floatingPanel,
                                      final ShapeDragProxy proxy ) {
    final Style style = floatingPanel.getElement().getStyle();
    final HandlerRegistration[] handlerRegs = new HandlerRegistration[ 2 ];

    //MouseMoveEvents
    handlerRegs[ 0 ] = RootPanel.get().addDomHandler( new MouseMoveHandler() {

        @Override
        public void onMouseMove( final MouseMoveEvent mouseMoveEvent ) {
            style.setLeft( mouseMoveEvent.getX() - ( floatingPanel.getWidth() / 2 ),
                           Style.Unit.PX );
            style.setTop( mouseMoveEvent.getY() - ( floatingPanel.getHeight() / 2 ),
                          Style.Unit.PX );
            proxy.onDragPreview( mouseMoveEvent.getX(),
                                 mouseMoveEvent.getY() );
        }
    }, MouseMoveEvent.getType() );

    //MouseUpEvent
    handlerRegs[ 1 ] = RootPanel.get().addDomHandler( new MouseUpHandler() {

        @Override
        public void onMouseUp( final MouseUpEvent mouseUpEvent ) {
            handlerRegs[ 0 ].removeHandler();
            handlerRegs[ 1 ].removeHandler();
            RootPanel.get().remove( floatingPanel );
            proxy.onDragComplete( mouseUpEvent.getX(),
                                  mouseUpEvent.getY() );
        }
    }, MouseUpEvent.getType() );
}
项目:empiria.player    文件:ExplanationViewImpl.java   
@Override
public void addEntryExamplePanelHandler(MouseUpHandler handler) {
    entryExamplePanel.asWidget().addHandler(handler, MouseUpEvent.getType());
}
项目:empiria.player    文件:MouseEventPanel.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addDomHandler(handler, MouseUpEvent.getType());
}
项目:unitimes    文件:P.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addHandler(handler, MouseUpEvent.getType());
}
项目:appinventor-extensions    文件:HandlerPanel.java   
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, MouseUpEvent.getType());
}
项目:dataworks-zeus    文件:CodeMirror.java   
public void addMouseUpHandler(MouseUpHandler handler){
    mouseListeners.add(handler);
}
项目:dataworks-zeus    文件:CodeMirror.java   
public void removeMouseUpHandler(MouseUpHandler handler){
    mouseListeners.remove(handler);
}
项目:mgwt-traffic-flow    文件:Canvas.java   
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return html.addMouseUpHandler(handler);
}
项目:r01fb    文件:TreeView.java   
@Override
public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
    return this.addDomHandler(handler,
                              MouseUpEvent.getType());
}
项目:unitime    文件:P.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addHandler(handler, MouseUpEvent.getType());
}
项目:appformer    文件:Canvas.java   
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return html.addMouseUpHandler(handler);
}
项目:appformer    文件:GridLienzoPanelTest.java   
@Test
public void testAddMouseUpHandler() {

    final ArgumentCaptor<MouseUpHandler> handler = ArgumentCaptor.forClass(MouseUpHandler.class);
    final MouseUpEvent mouseUpEvent = mock(MouseUpEvent.class);
    final HandlerRegistration registration = mock(HandlerRegistration.class);

    doReturn(registration).when(gridLienzoPanel).addMouseUpHandler(handler.capture());
    doNothing().when(gridLienzoPanel).refreshScrollPosition();

    gridLienzoPanel.addMouseUpHandler();

    handler.getValue().onMouseUp(mouseUpEvent);

    verify(gridLienzoPanel).refreshScrollPosition();
}
项目:zeus3    文件:CodeMirror.java   
public void addMouseUpHandler(MouseUpHandler handler){
    mouseListeners.add(handler);
}
项目:zeus3    文件:CodeMirror.java   
public void removeMouseUpHandler(MouseUpHandler handler){
    mouseListeners.remove(handler);
}
项目:hexa.tools    文件:DataTable.java   
public HandlerRegistration addCellMouseUpHandler( final MouseUpHandler handler )
{
    return addDomHandler( handler, MouseUpEvent.getType() );
}
项目:putnami-web-toolkit    文件:AbstractInput.java   
@Override
public com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return this.addDomHandler(handler, MouseUpEvent.getType());
}
项目:putnami-web-toolkit    文件:ListItem.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return this.addDomHandler(handler, MouseUpEvent.getType());
}
项目:putnami-web-toolkit    文件:Anchor.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return this.addDomHandler(handler, MouseUpEvent.getType());
}
项目:putnami-web-toolkit    文件:ContentAssistAspect.java   
@Override
public void showSuggestions(Oracle.Request request, final IsWidget textInput,
    Collection<? extends Suggestion<T>> suggestions, final SuggestionCallback<T> callback) {

    boolean anySuggestions = suggestions != null && !suggestions.isEmpty();
    if (!anySuggestions && this.hideWhenEmpty) {
        this.hideSuggestions();
        return;
    }

    if (this.suggestionPopup.isAttached()) {
        this.suggestionPopup.hide();
    }

    this.suggestionsContainer.clear();

    SuggestionItem<T> selected = null;
    for (final Oracle.Suggestion<T> currentSuggestion : suggestions) {
        String display = highlighter.highlight(currentSuggestion.getValue(), request.getQuery());
        final SuggestionItem<T> suggestionItem = new SuggestionItem<T>(currentSuggestion, display);
        if (selected == null) {
            selected = suggestionItem;
        }
        if (this.selectedItem != null && currentSuggestion.equals(this.selectedItem.suggestion)) {
            selected = suggestionItem;
        }

        suggestionItem.addDomHandler(new MouseUpHandler() {
            @Override
            public void onMouseUp(MouseUpEvent event) {
                if (textInput instanceof Focusable) {
                    ((Focusable) textInput).setFocus(true);
                }
                SuggestionDisplayImpl.this.setSuggestionItemSelected(suggestionItem);
                callback.onSuggestionSelected(suggestionItem.suggestion);
            }
        }, MouseUpEvent.getType());

        this.suggestionsContainer.append(suggestionItem);
    }

    this.setSuggestionItemSelected(selected);

    if (this.lastTextInput != textInput) {
        if (this.lastTextInput != null) {
            this.suggestionPopup.removeAutoHidePartner(this.lastTextInput.asWidget().getElement());
        }
        this.lastTextInput = textInput;
        this.suggestionPopup.addAutoHidePartner(this.lastTextInput.asWidget().getElement());
    }

    this.suggestionPopup.showRelativeTo(this.lastTextInput.asWidget());
    this.scrollToSelected();
}
项目:gwtoauthlogindemo    文件:ButtonCaption.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
{
    return addMouseUpHandler(handler);
}
项目:QMAClone    文件:MouseEventsCanvas.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addDomHandler(handler, MouseUpEvent.getType());
}
项目:geomajas-project-client-gwt    文件:GraphicsWidget.java   
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return widget.addMouseUpHandler(handler);
}
项目:geomajas-project-client-gwt2    文件:MapWidgetImpl.java   
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addDomHandler(handler, MouseUpEvent.getType());
}
项目:gwtbootstrap3    文件:AbstractButton.java   
@Override
public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
    return addDomHandler(handler, MouseUpEvent.getType());
}
项目:gwtbootstrap3    文件:Label.java   
@Override
public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
    return addDomHandler(handler, MouseUpEvent.getType());
}
项目:swarm    文件:BaseButton.java   
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, MouseUpEvent.getType());
}
项目:GwtGameUi    文件:RenderEngine.java   
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, com.google.gwt.event.dom.client.MouseUpEvent.getType());
}
项目:empiria.player    文件:ExplanationView.java   
void addEntryExamplePanelHandler(MouseUpHandler mouseUpHandler);