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

TableOrder.java 文件源码 项目:putnami-web-toolkit 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void onMouseDown(MouseDownEvent event) {
    this.onMouseUp(null);

    Icon dragIcon = (Icon) event.getSource();
    this.selectedRow = (TableRow<T>) dragIcon.getParent().getParent();
    this.body = (TableEditorBody<T>) this.selectedRow.getParent();

    this.overRegistration = new HandlerRegistrationCollection();
    this.upRegistration = RootPanel.get().addDomHandler(this, MouseUpEvent.getType());
    this.rows = Lists.newArrayList(this.body.getRows());
    for (TableRow<T> row : this.rows) {
        this.overRegistration.add(row.addDomHandler(this, MouseOverEvent.getType()));
    }
    TableOrder.this.disableTextSelection(true);
    RootPanel.get().getElement().getStyle().setCursor(Style.Cursor.MOVE);
    StyleUtils.addStyle(this.selectedRow, TableOrder.STYLE_ROW_DRAGING);
}
ResultMouseOverHandler.java 文件源码 项目:regex-tester 阅读 22 收藏 0 点赞 0 评论 0
public void onMouseOver(final MouseOverEvent event)
{
   HighlightedResult widget = (HighlightedResult) event.getSource();
   HighlightedGroup group = widget.getHighlightedGroup();

   if (group.getGroup() != null)
   {
      widget.setMouseOverEvent(event);
      if (!hasHighlightedChildren(widget))
      {
         area.setSelectionRange(0, 0);
         int start = group.getGroup().getRegexFragment().getStart();
         int length = group.getGroup().getRegexFragment().getCaptured().length + 2;

         if (start + length > area.getText().length())
            length = area.getText().length() - start;

         area.setSelectionRange(start, length);
      }
   }
}
UserAvatarImageWidget.java 文件源码 项目:x-cure-chat 阅读 26 收藏 0 点赞 0 评论 0
@Override
public void onMouseOver(MouseOverEvent event) {
    if( SiteManager.isUserLoggedIn() ) {
        //If the user is logged in, then
        if( SiteManager.getUserID() == userID ) {
            //If this is the avatar of the user who is logged in
            if( AvatarSpoilersHelper.isAvatarSpoilerActive( spoilerID, spoilerExpDate ) ) {
                //If this user is pranked  he can clean his prank
                activateControls( false , true );
            } else {
                //If this user is NOT pranked then there is nothing to be done
                activateControls( false , false );
            }
        } else {
            //If this is an avatar of some other user
            if( AvatarSpoilersHelper.isAvatarSpoilerActive( spoilerID, spoilerExpDate ) ) {
                //If the other user is pranked then one can clean his prank or set a new one
                activateControls( true , true );
            } else {
                //If the other user is NOT pranked then one can prank him
                activateControls( true , false );
            }
        }
    }
}
ConsoleButtonImpl.java 文件源码 项目:che 阅读 26 收藏 0 点赞 0 评论 0
@Inject
public ConsoleButtonImpl(
    ButtonResources resources,
    TooltipWidget tooltip,
    @NotNull @Assisted String prompt,
    @NotNull @Assisted SVGResource image) {
  this.resources = resources;
  this.tooltip = tooltip;
  this.tooltip.setDescription(prompt);

  resources.buttonCss().ensureInjected();

  initWidget(UI_BINDER.createAndBindUi(this));

  icon = new SVGImage(image);
  icon.getElement().setAttribute("class", resources.buttonCss().mainButtonIcon());

  setCheckedStatus(false);

  addDomHandler(this, ClickEvent.getType());
  addDomHandler(this, MouseOutEvent.getType());
  addDomHandler(this, MouseOverEvent.getType());
}
ItineraryDetailsWidget.java 文件源码 项目:OpenTripPlanner-client-gwt 阅读 29 收藏 0 点赞 0 评论 0
private Widget getEndPointDetails(final String css, Date time,
        String address, final Wgs84LatLonBean position) {
    HTML line = new HTML();
    line.addStyleName("itinerary-details-line");
    line.addStyleName("itinerary-details-" + css);
    line.addStyleName(css + "-icon");
    String html = "<span class='time'>" + FormatUtils.formatTime(time)
            + "</span> - " + FormatUtils.formatAddress(address);
    line.setHTML(html);
    final String infoHtml = "<div class='info-panel-" + css + " " + css
            + "-icon'>" + html + "</div>";
    line.addMouseOverHandler(new MouseOverHandler() {

        @Override
        public void onMouseOver(MouseOverEvent event) {
            if (selected)
                listener.onItineraryStepClicked(infoHtml, position);
        }
    });
    return line;
}
BasicImageGrid.java 文件源码 项目:firefly 阅读 25 收藏 0 点赞 0 评论 0
public void onMouseOver(MouseOverEvent event) {
    Widget widget = (Widget) event.getSource();
    if (doHilite) {
        GwtUtil.setStyle(widget, "backgroundColor", hiliteBackground);
        GwtUtil.setStyle(widget, "border", "1px solid " + hiliteBorder);
    }
    BasicImageGrid.this.setMouseOverAt(widget);
    mouseOverTimer.schedule(1500);
}
ImageGridPanel.java 文件源码 项目:firefly 阅读 33 收藏 0 点赞 0 评论 0
public void onMouseOver(MouseOverEvent event) {
    Widget widget = (Widget)event.getSource();
    DOM.setStyleAttribute(widget.getElement(), "backgroundColor", "#bde");
    DOM.setStyleAttribute(widget.getElement(), "border", "1px solid #abc");
    ImageGridPanel.this.setMouseOverAt(widget);
    mouseOverTimer.schedule(1500);
}
SideDockItem.java 文件源码 项目:appformer 阅读 23 收藏 0 点赞 0 评论 0
void createButton() {
    itemButton.setSize(ButtonSize.SMALL);
    itemButton.setType(ButtonType.LINK);
    configureIcon(itemButton,
                  getDock().getImageIcon());
    mouseEventHandler = new MouseEventHandler();
    itemButton.addDomHandler(mouseEventHandler,
                             MouseOverEvent.getType());
    itemButton.addStyleName(CSS.CSS().sideDockItem());
    itemButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (!isOpened()) {
                openAndExecuteExpandCommand();
            } else {
                closeAndExecuteCommand();
            }
        }
    });
}
EventsExecutor.java 文件源码 项目:platypus-js 阅读 25 收藏 0 点赞 0 评论 0
public void setMouseEntered(JavaScriptObject aValue) {
    if (mouseEntered != aValue) {
        if (mouseOverReg != null) {
            mouseOverReg.removeHandler();
            mouseOverReg = null;
        }
        mouseEntered = aValue;
        if (mouseEntered != null) {
            MouseOverHandler handler = new MouseOverHandler() {
                @Override
                public void onMouseOver(MouseOverEvent event) {
                    if (mouseEntered != null) {
                        event.stopPropagation();
                        executeEvent(mouseEntered, EventsPublisher.publish(event));
                    }
                }
            };
            if (component instanceof Widget) {
                mouseOverReg = ((Widget) component).addDomHandler(handler, MouseOverEvent.getType());
            } else if (component instanceof HasMouseOverHandlers) {
                mouseOverReg = ((HasMouseOverHandlers) component).addMouseOverHandler(handler);
            }
        }
    }
}
ContextFieldSet.java 文件源码 项目:bitcoin-transaction-explorer 阅读 37 收藏 0 点赞 0 评论 0
@SuppressWarnings("unchecked")
@Override
public void onMouseOver(final MouseOverEvent event) {
  popupHideTimer.cancel();

  if (popupShowTimer != null) {
    popupShowTimer.cancel();
  }

  popupShowTimer = new TypedTimer((ContextField<T>) event.getSource());
  popupShowTimer.schedule(popupPanel.isShowing() ? 0 : POPUP_SHOW_DELAY);
}
ContextFieldSet.java 文件源码 项目:bitcoin-transaction-explorer 阅读 24 收藏 0 点赞 0 评论 0
@SuppressWarnings("unchecked")
@Override
public void onClick(final ClickEvent event) {
  if (selectedField != null) {
    selectedField.setSelected(false);
  }

  if (selectedField == event.getSource()) {
    selectedField = null;
    return;
  }

  selectedField = (ContextField<T>) event.getSource();
  selectedField.setSelected(true);

  selectedField.fireEvent(new MouseOverEvent() {});
}
AbstractHover.java 文件源码 项目:putnami-web-toolkit 阅读 24 收藏 0 点赞 0 评论 0
private void bindHandlers() {
    if (this.widget == null) {
        return;
    }

    this.registrations.removeHandler();
    switch (this.getTrigger()) {
        case FOCUS:
            this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, FocusEvent.getType()));
            this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, BlurEvent.getType()));
            break;
        case HOVER:
            this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, MouseOverEvent.getType()));
            this.registrations.add(this.widget.addDomHandler(this.triggerEventHandler, MouseOutEvent.getType()));
            break;
        case MANUAL:
            break;
        default:
            break;
    }
}
TableOrder.java 文件源码 项目:putnami-web-toolkit 阅读 24 收藏 0 点赞 0 评论 0
@Override
public void onMouseOver(MouseOverEvent event) {
    if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) {
        this.hoverRow = (TableRow<T>) event.getSource();
        this.body.switchRows(this.hoverRow, this.selectedRow);
    }
    event.preventDefault();
}
Carousel.java 文件源码 项目:putnami-web-toolkit 阅读 23 收藏 0 点赞 0 评论 0
public void setAutoPlay(boolean autoPlay) {
    this.autoPlay = autoPlay;
    this.handlerRegistrations.removeHandler();
    if (autoPlay) {
        this.autoPlayTimer.scheduleRepeating(this.timerDelay);
        this.handlerRegistrations.add(this.addDomHandler(this, MouseOverEvent.getType()));
        this.handlerRegistrations.add(this.addDomHandler(this, MouseOutEvent.getType()));
    } else {
        this.autoPlayTimer.cancel();
    }
}
PopupObjectButton.java 文件源码 项目:atom 阅读 21 收藏 0 点赞 0 评论 0
@UiHandler("popupObjectButton")
void doMouseOver(MouseOverEvent event) {
    if(active) {
        borderImage.setResource(AtomClientBundle.INSTANCE.menuPopupOver());
        popupObjectButton.setStyleName(popupObjectButtonStyle.over());
        panel.setStyleName(popupObjectButtonStyle.activeSpace());
    }
}
GadgetWidgetUi.java 文件源码 项目:incubator-wave 阅读 28 收藏 0 点赞 0 评论 0
@Override
public void addHandlers(MouseOverHandler mouseOverHandler, MouseOutHandler mouseOutHandler) {
  // TODO(user): Investigate why the event propagation does not work and
  // remove unnecessary handler setup.
  addDomHandler(mouseOverHandler, MouseOverEvent.getType());
  addDomHandler(mouseOutHandler, MouseOutEvent.getType());
  enclosingBox.addMouseOverHandler(mouseOverHandler);
  gadgetFrame.addMouseOverHandler(mouseOverHandler);
  iframeDiv.addMouseOverHandler(mouseOverHandler);
  gadgetIframe.addHandler(mouseOverHandler, MouseOverEvent.getType());
  metaButtons.addMouseOverHandler(mouseOverHandler);
  metaLeft.addMouseOverHandler(mouseOverHandler);
  metaButtonsPanel.addMouseOverHandler(mouseOverHandler);
  metaRight.addMouseOverHandler(mouseOverHandler);
  menu.getButton().addMouseOverHandler(mouseOverHandler);
}
MouseHandlerManager.java 文件源码 项目:gwt-mousemanager 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Update event caches to keep track of the latest event of each instance.
 * @param the event to cache
 */
private void updateEventCaches(Event<?> event){
    if(event == null){
        return;
    }
    if(event instanceof DoubleClickEvent){
        doubleClickEvent = new org.gz.gwt.mousemanager.client.event.DoubleClickEvent((DoubleClickEvent)event, target);
    }
    if(event instanceof ClickEvent){
        clickEvent = new org.gz.gwt.mousemanager.client.event.ClickEvent((ClickEvent)event, target);
    }       
    if(event instanceof MouseUpEvent){
        mouseUpEvent = new org.gz.gwt.mousemanager.client.event.MouseUpEvent((MouseUpEvent)event, target);
    }
    if(event instanceof MouseDownEvent){
        mouseDownEvent = new org.gz.gwt.mousemanager.client.event.MouseDownEvent((MouseDownEvent)event, target);
    } 
    if(event instanceof MouseMoveEvent){
        mouseMoveEvent = new org.gz.gwt.mousemanager.client.event.MouseMoveEvent((MouseMoveEvent)event, target);
    }
    if(event instanceof MouseOverEvent){
        mouseOverEvent = new org.gz.gwt.mousemanager.client.event.MouseOverEvent((MouseOverEvent)event, target);
    }
    if(event instanceof MouseOutEvent){
        mouseOutEvent = new org.gz.gwt.mousemanager.client.event.MouseOutEvent((MouseOutEvent)event, target);
    }
    if(event instanceof MouseWheelEvent){
        mouseWheelEvent = new org.gz.gwt.mousemanager.client.event.MouseWheelEvent((MouseWheelEvent)event, target);
    }
    if(event instanceof ContextMenuEvent){
        contextMenuEvent = new org.gz.gwt.mousemanager.client.event.ContextMenuEvent();
    }
}
ResultMouseOverHandler.java 文件源码 项目:regex-tester 阅读 25 收藏 0 点赞 0 评论 0
public void onMouseOut(final MouseOutEvent event)
{
   HighlightedResult widget = (HighlightedResult) event.getSource();
   HighlightedGroup group = widget.getHighlightedGroup();

   widget.setMouseOverEvent(null);
   if (group.getGroup() != null)
   {
      area.setSelectionRange(0, 0);

      Widget parent = widget.getParent();
      while (parent instanceof HighlightedResult)
      {
         MouseOverEvent mouseOverEvent = ((HighlightedResult) parent).getMouseOverEvent();
         if (mouseOverEvent != null)
         {
            final Widget finalParent = parent;
            onMouseOver(new MouseOverEvent() {
               @Override
               public Object getSource()
               {
                  return finalParent;
               }
            });
            break;
         }
         else
            parent = parent.getParent();
      }
   }
}
AnchorBuilder.java 文件源码 项目:sig-seguimiento-vehiculos 阅读 29 收藏 0 点赞 0 评论 0
private MouseOverHandler getMouseOverhandler(final Anchor anchor) {
    return new MouseOverHandler() {
        @Override
        public void onMouseOver(MouseOverEvent event) {
            anchor.addStyleName(ThemeStyles.get().style().borderBottom());
        }
    };
}
LoginPanel.java 文件源码 项目:GwtErraiMaterialMvcExample 阅读 24 收藏 0 点赞 0 评论 0
private void onSocialButtonMouseOverHandler(MouseOverEvent event ) {
    MaterialImage source = (MaterialImage)event.getSource();
    source.setBackgroundColor(Color.ORANGE);
}
ChartMouseOverHandler.java 文件源码 项目:gwt-chronoscope 阅读 27 收藏 0 点赞 0 评论 0
public void onMouseOver(MouseOverEvent event) {
  ChartState chartInfo = getChartState(event);
  Chart chart = chartInfo.chart;
  int x = getLocalX(event);
  int y = getLocalY(event);
  chart.setPlotFocus(x, y);
  boolean isMouseInPlot = false;
  if ((null != chart) && (null != chart.getPlot()) && (null != chart.getPlot().getBounds())) {
    isMouseInPlot = chart.getPlot().getBounds().inside(x, y);
  }
  chart.setCursor(
      isMouseInPlot ? Cursor.DRAGGABLE : Cursor.DEFAULT);
  //((DOMView) chart.getView()).focus();
  chartInfo.setHandled(true);
}
AggregateBaseHandlers.java 文件源码 项目:aggregate 阅读 21 收藏 0 点赞 0 评论 0
public void onMouseOver(MouseOverEvent event) {
  if(!AggregateUI.getUI().displayingHelpBalloons()) {
    return;
  }

  if(helpBalloon != null) {
    // hide the tool tip
    widget.setTitle(BasicConsts.EMPTY_STRING);

    // show the help balloon;
    helpBalloon.display();
  }
}
ItemsList.java 文件源码 项目:che 阅读 29 收藏 0 点赞 0 评论 0
private void attachEventHandlers() {
  addDomHandler(
      event -> {
        if (overItem != null) {
          overItem.removeStyleName(resources.css().popupItemOver());
        }
        overItem = ItemWidget.this;
        addStyleName(resources.css().popupItemOver());
        if (childList != null) {
          childList.hide();
        }

        if (dataProvider.isGroup(item)) {
          Pair<List<MenuItem>, String> children = dataProvider.getChildren(item);
          createChildPopup(children);
        }
      },
      MouseOverEvent.getType());

  addDomHandler(
      event -> {
        if (dataProvider.isGroup(item)) {
          return;
        }

        hide(true);

        getActionHandler().ifPresent(actionHandler -> actionHandler.onAction(item));
      },
      ClickEvent.getType());
}
ConsoleButtonImpl.java 文件源码 项目:che 阅读 25 收藏 0 点赞 0 评论 0
/** {@inheritDoc} */
@Override
public void onMouseOver(MouseOverEvent mouseOverEvent) {
  tooltip.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + TOP_TOOLTIP_SHIFT);

  tooltip.show();
}
ActionButton.java 文件源码 项目:che 阅读 32 收藏 0 点赞 0 评论 0
private void addDomHandlers() {
  panel.addDomHandler(this, MouseOverEvent.getType());
  panel.addDomHandler(this, MouseOutEvent.getType());
  panel.addDomHandler(this, MouseDownEvent.getType());
  panel.addDomHandler(this, MouseUpEvent.getType());
  panel.addDomHandler(this, ClickEvent.getType());
}
ConsoleButtonImplTest.java 文件源码 项目:che 阅读 23 收藏 0 点赞 0 评论 0
@Test
public void tooltipShouldBeShown() throws Exception {
  widget.onMouseOver(mock(MouseOverEvent.class));

  verify(tooltip).setPopupPosition(0, TOP_TOOLTIP_SHIFT);
  verify(tooltip).show();
}
AnchorBuilder.java 文件源码 项目:geowe-core 阅读 22 收藏 0 点赞 0 评论 0
private MouseOverHandler getMouseOverhandler(final Anchor anchor) {
    return new MouseOverHandler() {
        @Override
        public void onMouseOver(MouseOverEvent event) {
            anchor.addStyleName(ThemeStyles.get().style().borderBottom());
        }
    };
}
FloatingVisBar.java 文件源码 项目:firefly 阅读 22 收藏 0 点赞 0 评论 0
public void updateAlignWidget(Widget w) {
    if (hreg != null) {
        hreg.removeHandler();
        hreg = null;
    }
    _popup.alignTo(w, PopupPane.Align.TOP_RIGHT, -15, 0);
    hreg = w.addDomHandler(new MouseOverHandler() {
        public void onMouseOver(MouseOverEvent event) {
            if (_dropClosed) _popup.show();
        }
    }, MouseOverEvent.getType());
}
FloatingStatusBar.java 文件源码 项目:firefly 阅读 22 收藏 0 点赞 0 评论 0
public void updateAlignWidget(Widget w) {
    if (hreg!=null) {
        hreg.removeHandler();
        hreg= null;
    }
    popup.alignTo(w, PopupPane.Align.BOTTOM_LEFT, 0, 0);
    hreg= w.addDomHandler(new MouseOverHandler() {
        public void onMouseOver(MouseOverEvent event) {
            if (dropClosed) popup.show();
        }
    },MouseOverEvent.getType() );
}
MultiplePermissionNodeEditorView.java 文件源码 项目:appformer 阅读 21 收藏 0 点赞 0 评论 0
@EventHandler("headerPanel")
private void onHeaderMouseOver(MouseOverEvent event) {
    if (!expanded) {
        headerPanel.setClassName("acl-header-panel-over");
        mouseOver = true;
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号