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

BaseDOMElement.java 文件源码 项目:appformer 阅读 20 收藏 0 点赞 0 评论 0
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());
}
ExplanationController.java 文件源码 项目:empiria.player 阅读 20 收藏 0 点赞 0 评论 0
private void addEntryExamplePanelHandler() {
    this.explanationView.addEntryExamplePanelHandler(new MouseUpHandler() {

        @Override
        public void onMouseUp(MouseUpEvent event) {
            entryDescriptionSoundController.playOrStopEntrySound(entry.getEntrySound());
        }
    });
}
PopupMenu.java 文件源码 项目:Wiab.pro 阅读 19 收藏 0 点赞 0 评论 0
/**
 * 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);
}
CodeMirror.java 文件源码 项目:dataworks-zeus 阅读 23 收藏 0 点赞 0 评论 0
@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);
        }
    }
}
StencilPaletteBuilder.java 文件源码 项目:appformer 阅读 24 收藏 0 点赞 0 评论 0
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());
}
EventsExecutor.java 文件源码 项目:platypus-js 阅读 24 收藏 0 点赞 0 评论 0
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);
        }
    }
}
EventFactory.java 文件源码 项目:qafe-platform 阅读 23 收藏 0 点赞 0 评论 0
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);
        }
    };
}
CodeMirror.java 文件源码 项目:zeus3 阅读 19 收藏 0 点赞 0 评论 0
@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);
        }
    }
}
PopupCanvas.java 文件源码 项目:QMAClone 阅读 21 收藏 0 点赞 0 评论 0
@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;
}
PopupMenu.java 文件源码 项目:incubator-wave 阅读 24 收藏 0 点赞 0 评论 0
/**
 * 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);
}
ClickableDivPanel.java 文件源码 项目:incubator-wave 阅读 19 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, MouseUpEvent.getType());
}
StencilPaletteBuilder.java 文件源码 项目:wires 阅读 23 收藏 0 点赞 0 评论 0
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() );
}
ExplanationViewImpl.java 文件源码 项目:empiria.player 阅读 17 收藏 0 点赞 0 评论 0
@Override
public void addEntryExamplePanelHandler(MouseUpHandler handler) {
    entryExamplePanel.asWidget().addHandler(handler, MouseUpEvent.getType());
}
MouseEventPanel.java 文件源码 项目:empiria.player 阅读 16 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addDomHandler(handler, MouseUpEvent.getType());
}
P.java 文件源码 项目:unitimes 阅读 25 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addHandler(handler, MouseUpEvent.getType());
}
HandlerPanel.java 文件源码 项目:appinventor-extensions 阅读 23 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, MouseUpEvent.getType());
}
CodeMirror.java 文件源码 项目:dataworks-zeus 阅读 18 收藏 0 点赞 0 评论 0
public void addMouseUpHandler(MouseUpHandler handler){
    mouseListeners.add(handler);
}
CodeMirror.java 文件源码 项目:dataworks-zeus 阅读 19 收藏 0 点赞 0 评论 0
public void removeMouseUpHandler(MouseUpHandler handler){
    mouseListeners.remove(handler);
}
Canvas.java 文件源码 项目:mgwt-traffic-flow 阅读 24 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return html.addMouseUpHandler(handler);
}
TreeView.java 文件源码 项目:r01fb 阅读 24 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
    return this.addDomHandler(handler,
                              MouseUpEvent.getType());
}
P.java 文件源码 项目:unitime 阅读 23 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addHandler(handler, MouseUpEvent.getType());
}
Canvas.java 文件源码 项目:appformer 阅读 26 收藏 0 点赞 0 评论 0
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return html.addMouseUpHandler(handler);
}
GridLienzoPanelTest.java 文件源码 项目:appformer 阅读 20 收藏 0 点赞 0 评论 0
@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();
}
CodeMirror.java 文件源码 项目:zeus3 阅读 18 收藏 0 点赞 0 评论 0
public void addMouseUpHandler(MouseUpHandler handler){
    mouseListeners.add(handler);
}
CodeMirror.java 文件源码 项目:zeus3 阅读 16 收藏 0 点赞 0 评论 0
public void removeMouseUpHandler(MouseUpHandler handler){
    mouseListeners.remove(handler);
}
DataTable.java 文件源码 项目:hexa.tools 阅读 22 收藏 0 点赞 0 评论 0
public HandlerRegistration addCellMouseUpHandler( final MouseUpHandler handler )
{
    return addDomHandler( handler, MouseUpEvent.getType() );
}
AbstractInput.java 文件源码 项目:putnami-web-toolkit 阅读 21 收藏 0 点赞 0 评论 0
@Override
public com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return this.addDomHandler(handler, MouseUpEvent.getType());
}
ListItem.java 文件源码 项目:putnami-web-toolkit 阅读 23 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return this.addDomHandler(handler, MouseUpEvent.getType());
}
Anchor.java 文件源码 项目:putnami-web-toolkit 阅读 20 收藏 0 点赞 0 评论 0
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return this.addDomHandler(handler, MouseUpEvent.getType());
}
ContentAssistAspect.java 文件源码 项目:putnami-web-toolkit 阅读 19 收藏 0 点赞 0 评论 0
@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();
}


问题


面经


文章

微信
公众号

扫码关注公众号