本文整理匯總了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());
}
示例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());
}
});
}
示例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);
}
示例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);
}
}
}
示例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());
}
示例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);
}
}
}
示例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);
}
};
}
示例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;
}
示例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);
}
示例10: addMouseUpHandler
import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
return addDomHandler(handler, MouseUpEvent.getType());
}
示例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() );
}
示例12: addEntryExamplePanelHandler
import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public void addEntryExamplePanelHandler(MouseUpHandler handler) {
entryExamplePanel.asWidget().addHandler(handler, MouseUpEvent.getType());
}
示例13: addMouseUpHandler
import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
return addDomHandler(handler, MouseUpEvent.getType());
}
示例14: addMouseUpHandler
import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
@Override
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
return addHandler(handler, MouseUpEvent.getType());
}
示例15: addMouseUpHandler
import com.google.gwt.event.dom.client.MouseUpHandler; //導入依賴的package包/類
public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
return addDomHandler(handler, MouseUpEvent.getType());
}