當前位置: 首頁>>代碼示例>>Java>>正文


Java MouseUpHandler類代碼示例

本文整理匯總了Java中com.google.gwt.event.dom.client.MouseUpHandler的典型用法代碼示例。如果您正苦於以下問題:Java MouseUpHandler類的具體用法?Java MouseUpHandler怎麽用?Java MouseUpHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MouseUpHandler類屬於com.google.gwt.event.dom.client包,在下文中一共展示了MouseUpHandler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupDelegatingMouseUpHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
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());
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:23,代碼來源:BaseDOMElement.java

示例2: addEntryExamplePanelHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
private void addEntryExamplePanelHandler() {
    this.explanationView.addEntryExamplePanelHandler(new MouseUpHandler() {

        @Override
        public void onMouseUp(MouseUpEvent event) {
            entryDescriptionSoundController.playOrStopEntrySound(entry.getEntrySound());
        }
    });
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:10,代碼來源:ExplanationController.java

示例3: PopupMenuItem

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:41,代碼來源:PopupMenu.java

示例4: onBrowserEvent

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@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);
		}
	}
}
 
開發者ID:ctripcorp,項目名稱:dataworks-zeus,代碼行數:12,代碼來源:CodeMirror.java

示例5: attachDragProxyHandlers

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
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());
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:35,代碼來源:StencilPaletteBuilder.java

示例6: setMouseReleased

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
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);
		}
	}
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:28,代碼來源:EventsExecutor.java

示例7: createOnMouseUpListener

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
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);
		}
	};
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:9,代碼來源:EventFactory.java

示例8: addMouseUpHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@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;
}
 
開發者ID:nodchip,項目名稱:QMAClone,代碼行數:10,代碼來源:PopupCanvas.java

示例9: PopupMenuItem

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:apache,項目名稱:incubator-wave,代碼行數:37,代碼來源:PopupMenu.java

示例10: addMouseUpHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, MouseUpEvent.getType());
}
 
開發者ID:apache,項目名稱:incubator-wave,代碼行數:5,代碼來源:ClickableDivPanel.java

示例11: attachDragProxyHandlers

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
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() );
}
 
開發者ID:Salaboy,項目名稱:wires,代碼行數:33,代碼來源:StencilPaletteBuilder.java

示例12: addEntryExamplePanelHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public void addEntryExamplePanelHandler(MouseUpHandler handler) {
    entryExamplePanel.asWidget().addHandler(handler, MouseUpEvent.getType());
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:5,代碼來源:ExplanationViewImpl.java

示例13: addMouseUpHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
    return addDomHandler(handler, MouseUpEvent.getType());
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:5,代碼來源:MouseEventPanel.java

示例14: addMouseUpHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
	return addHandler(handler, MouseUpEvent.getType());
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:5,代碼來源:P.java

示例15: addMouseUpHandler

import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
  return addDomHandler(handler, MouseUpEvent.getType());
}
 
開發者ID:mit-cml,項目名稱:appinventor-extensions,代碼行數:4,代碼來源:HandlerPanel.java


注:本文中的com.google.gwt.event.dom.client.MouseUpHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。