本文整理汇总了Java中com.google.gwt.user.client.Event.ONMOUSEUP属性的典型用法代码示例。如果您正苦于以下问题:Java Event.ONMOUSEUP属性的具体用法?Java Event.ONMOUSEUP怎么用?Java Event.ONMOUSEUP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.ONMOUSEUP属性的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBrowserEvent
@Override
public void onBrowserEvent(com.google.gwt.user.client.Event event) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONTOUCHSTART:
// rezerwujemy touch dla siebie nic innego nie powinno obslugiwac tego zdarzenia np TouchPageSwitch
eventsBus.fireEvent(new PlayerEvent(PlayerEventTypes.TOUCH_EVENT_RESERVATION));
pressed = true;
setPosition(event);
break;
case Event.ONTOUCHEND:
case Event.ONMOUSEUP:
pressed = false;
setPosition(event);
break;
case Event.ONTOUCHMOVE:
case Event.ONMOUSEMOVE:
setPosition(event);
default:
break;
}
super.onBrowserEvent(event);
}
示例2: onBrowserEvent
/**
* Invoked by GWT whenever a browser event is dispatched to this component.
*/
@Override
public final void onBrowserEvent(Event event) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
case Event.ONMOUSEMOVE:
case Event.ONMOUSEOVER:
case Event.ONMOUSEOUT:
cancelBrowserEvent(event);
mouseListeners.fireMouseEvent(this, event);
break;
case Event.ONCLICK:
cancelBrowserEvent(event);
select();
break;
default:
// Ignore unexpected events
break;
}
}
示例3: onBrowserEvent
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
case Event.ONMOUSEMOVE:
case Event.ONMOUSEOVER:
if (!super.getUrl().equals(urlHover)) {
super.setUrl(urlHover);
}
break;
case Event.ONMOUSEOUT: {
if (!super.getUrl().equals(url)) {
super.setUrl(url);
}
break;
}
}
super.onBrowserEvent(event);
}
示例4: onBrowserEvent
/**
* Overridden to send ValueChangeEvents only when appropriate.
*/
@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEUP:
case Event.ONBLUR:
case Event.ONKEYDOWN:
// Note the old value for onValueChange purposes (in ONCLICK case)
oldValue = getValue();
break;
case Event.ONCLICK:
EventTarget target = event.getEventTarget();
if (Element.is(target) && labelElem.isOrHasChild(Element.as(target))) {
// They clicked the label. Note our pre-click value, and
// short circuit event routing so that other click handlers
// don't hear about it
oldValue = getValue();
return;
}
// It's not the label. Let our handlers hear about the
// click...
super.onBrowserEvent(event);
// ...and now maybe tell them about the change
ValueChangeEvent.fireIfNotEqual(AccessibleRadioButton.this, oldValue, getValue());
return;
}
super.onBrowserEvent(event);
}
示例5: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
// If we're not yet dragging, only trigger mouse events if the event occurs
// in the caption wrapper
if (this.resizable) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
case Event.ONMOUSEMOVE:
case Event.ONMOUSEOVER:
case Event.ONMOUSEOUT:
if (this.dragMode >= 0 || calcDragMode(event.getClientX(),event.getClientY()) >= 0) {
// paste'n'copy from Widget.onBrowserEvent
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEOVER:
// Only fire the mouse over event if it's coming from outside this
// widget.
case Event.ONMOUSEOUT:
// Only fire the mouse out event if it's leaving this
// widget.
Element related = event.getRelatedEventTarget().cast();
if (related != null && getElement().isOrHasChild(related)) {
return;
}
break;
}
DomEvent.fireNativeEvent(event, this, this.getElement());
return;
}
if (this.dragMode<0)
this.updateCursor(this.dragMode);
}
}
super.onBrowserEvent(event);
}
示例6: onDragEvent
private void onDragEvent(Event event) {
if (!WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
return;
}
switch (DOM.eventGetType(event)) {
case Event.ONTOUCHSTART:
if (event.getTouches().length() > 1) {
return;
}
case Event.ONMOUSEDOWN:
beginMovingWindow(event);
break;
case Event.ONMOUSEUP:
case Event.ONTOUCHEND:
case Event.ONTOUCHCANCEL:
case Event.ONLOSECAPTURE:
stopMovingWindow();
break;
case Event.ONMOUSEMOVE:
case Event.ONTOUCHMOVE:
moveWindow(event);
break;
default:
break;
}
}
示例7: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
captureEvents(event);
break;
case Event.ONMOUSEUP:
releaseCapture(event);
break;
case Event.ONMOUSEMOVE:
handleResize(event);
break;
}
}
示例8: asString
public static String asString(Event event) {
// Start with the event type string
String string = DOM.eventGetTypeString(event);
// Next type-specific fields
switch (event.getTypeInt()) {
case Event.ONKEYPRESS:
case Event.ONKEYUP:
case Event.ONKEYDOWN:
string += key(event) + modifiers(event);
break;
case Event.ONCLICK:
case Event.ONDBLCLICK:
case Event.ONMOUSEMOVE:
string += mousePoint(event) + modifiers(event);
break;
case Event.ONMOUSEDOWN:
case Event.ONMOUSEUP:
string += mousePoint(event) + mouseButtons(event) + modifiers(event);
break;
case Event.ONMOUSEOUT:
string += mousePoint(event) + modifiers(event) + " to: " + getToElement(event);
break;
case Event.ONMOUSEOVER:
string += mousePoint(event) + modifiers(event) + " from: " + getFromElement(event);
break;
case Event.ONMOUSEWHEEL:
string += " " + getMouseWheelVelocityY(event) + mousePoint(event) + modifiers(event);
break;
case Event.ONFOCUS:
case Event.ONBLUR:
case Event.ONCHANGE:
case Event.ONERROR:
case Event.ONLOAD:
case Event.ONLOSECAPTURE:
case Event.ONSCROLL:
break;
}
return string;
}
示例9: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (mouseListener == null) {
super.onBrowserEvent(event);
return;
}
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
mouseListener.onMouseDown();
break;
case Event.ONMOUSEOUT:
mouseListener.onMouseLeave();
break;
case Event.ONMOUSEOVER:
mouseListener.onMouseEnter();
break;
case Event.ONMOUSEUP:
mouseListener.onMouseUp();
break;
case Event.ONCLICK:
mouseListener.onClick();
if (stopPropagation) {
event.stopPropagation();
}
break;
}
super.onBrowserEvent(event);
}
示例10: onBrowserEvent
/**
* Overrides the same method as per Label. Updates the CSS style on the parent
* DIV, and then passes on control to the superclass implementation.
*
* @see com.google.gwt.user.client.ui.Label#onBrowserEvent(com.google.gwt.user.client.Event)
*/
@Override
public void onBrowserEvent(Event event) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
me.replaceClassName(ButtonStyle.mouseUp, ButtonStyle.mouseDown);
if (cancelMouseDownBubble) {
event.stopPropagation();
}
if (preventMouseDownDefault) {
event.preventDefault();
}
break;
case Event.ONMOUSEUP:
me.replaceClassName(ButtonStyle.mouseDown, ButtonStyle.mouseUp);
break;
case Event.ONMOUSEOVER:
me.replaceClassName(ButtonStyle.mouseOut, ButtonStyle.mouseOver);
break;
case Event.ONMOUSEOUT:
me.replaceClassName(ButtonStyle.mouseOver, ButtonStyle.mouseOut);
break;
}
// Call to super to handle all event generation.
super.onBrowserEvent(event);
}
示例11: processMouseEvent
private void processMouseEvent(int eventType, int day, int period) {
switch (eventType) {
case Event.ONMOUSEDOWN:
iDownDay = day; iDownPeriod = period; iOverDay = day; iOverPeriod = period;
break;
case Event.ONMOUSEUP:
if (iDownDay>=0 && iOverDay>=0) {
int d0 = (iDownDay < iOverDay ? iDownDay : iOverDay);
int d1 = (iDownDay < iOverDay ? iOverDay : iDownDay);
int p0 = (iDownPeriod < iOverPeriod ? iDownPeriod : iOverPeriod);
int p1 = (iDownPeriod < iOverPeriod ? iOverPeriod : iDownPeriod);
boolean allSelected = true;
boolean mwfDown = (iDownDay % 2 == 0);
all: for (int d=d0; d<=d1; d++) {
if (d1 - d0 <= 0 || (d % 2 == 0) == mwfDown) {
for (int p=p0; p<=p1; p++)
if (!iSelected[d][p]) {
allSelected = false; break all;
}
}
}
long ts = iTime++;
for (int d=d0; d<=d1; d++) {
if (d1 - d0 <= 1 || (d % 2 == 0) == mwfDown) {
for (int p=p0; p<=p1; p++) {
iSelected[d][p] = !allSelected;
iLastSelectedTime[d][p] = ts;
}
}
}
}
iDownDay = -1; iDownPeriod = -1; iOverDay = -1; iOverPeriod = -1;
generatePriorities();
ValueChangeEvent.fire(this, getValue());
break;
case Event.ONMOUSEOVER:
iOverDay = day; iOverPeriod = period;
break;
case Event.ONMOUSEOUT:
iOverDay = -1; iOverPeriod = -1;
break;
}
update();
}
示例12: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (Event.ONMOUSEMOVE == DOM.eventGetType(event) && !iSelection.isActive() && iMoving != null) {
iMoving.onBrowserEvent(event);
if (iMoving.iCursor != null)
getElement().getStyle().setCursor(iMoving.iCursor);
return;
}
double x = event.getClientX() - getAbsoluteLeft() + Window.getScrollLeft();
double y = event.getClientY() - getAbsoluteTop() + Window.getScrollTop();
int slot = 3 * Math.min(Math.max(0, (int)Math.round(4 * (y - 1 + iStart * iCellHeight) / iCellHeight)), 96);
int day = Math.min(Math.max(0, (int)Math.floor((x - 2) / iCellWidth)), iDays.length - 1);
int dayOfWeek = iDays[day];
int weeks = (isSingleRoom() ? iSelectedWeeks.size() : iRoomResources.size());
int week = Math.min(Math.max(0, (int)Math.floor(weeks * (x - 2 - iCellWidth * day) / (iCellWidth - 6))), weeks - 1);
int h = slot / 12;
int m = 5 * (slot % 12);
String time = (CONSTANTS.useAmPm() ? (h == 0 ? "12": h <= 12 ? h : h-12) : h) + ":" + (m < 10 ? "0" : "") + m + (CONSTANTS.useAmPm() ? (h <= 11 ? "a" : "p") : "");
String text = (iDayOfWeeks == null ? CONSTANTS.longDays()[dayOfWeek] : iDayOfWeeks.get(dayOfWeek)) + " " + (isSingleRoom() ? iSelectedWeeks.get(week) : iSelectedWeeks.get(0)).getDayNames().get(dayOfWeek) +
" " + time + (isSingleRoom() ? "" : " " + iRoomResources.get(week).getName());
ResourceInterface room = (isSingleRoom() ? iRoomResources.get(0) : iRoomResources.get(week));
iPopup.setPopupPosition(event.getClientX() + Window.getScrollLeft(), event.getClientY() + Window.getScrollTop());
getElement().getStyle().setCursor(Cursor.CROSSHAIR);
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
iSelection.setStart(dayOfWeek, slot, week);
iSelection.setEnd(dayOfWeek, slot, week);
iSelection.setVisible(true);
iSelection.setActive(true);
break;
case Event.ONMOUSEMOVE:
iSelection.setEnd(dayOfWeek, slot, week);
if (!iPopup.isShowing()) iPopup.show();
if (!room.getId().equals(iLastRoomId)) {
RoomHint.showHint(iPopup.getElement(), room.getId(), "", (room.hasDistance() ? String.valueOf(Math.round(room.getDistance())) : ""), false);
iLastRoomId = room.getId();
}
break;
case Event.ONMOUSEUP:
onMouseUp();
break;
case Event.ONMOUSEOVER:
if (!iPopup.isShowing() && (iSelection.isActive() || iMoving == null)) iPopup.show();
if (iSelection.isActive() && !iSelection.isVisible()) {
iSelection.setVisible(true);
}
if (!room.getId().equals(iLastRoomId)) {
RoomHint.showHint(iPopup.getElement(), room.getId(), "", (room.hasDistance() ? String.valueOf(Math.round(room.getDistance())) : ""), false);
iLastRoomId = room.getId();
}
break;
case Event.ONMOUSEOUT:
Element child = DOM.eventGetToElement(event);
if (child != null && !getElement().isOrHasChild(child)) {
if (iPopup.isShowing()) {
iPopup.hide();
RoomHint.hideHint(); iLastRoomId = null;
}
iSelection.setVisible(false);
}
/*
if (iSelection.isActive() && !DOM.isOrHasChild(TimeGrid.this.getElement(), DOM.eventGetToElement(event))) {
iSelection.setActive(false);
}
*/
break;
}
iHint.setText((iSelection.isVisible() && iSelection.isActive() ? iSelection.toString() : text));
event.preventDefault();
event.stopPropagation();
}
示例13: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
// When de button mouse is released
if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// remove dragable item
Main.get().draggable.clear();
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
DOM.eventPreventDefault(event); // Prevent to fire event to browser
flagPopup = true;
mouseDownX = 0;
mouseDownY = 0;
dragged = false;
Main.get().activeFolderTree.menuPopup.disableAllOptions();
fireSelection(elementClicked(DOM.eventGetTarget(event)));
break;
default:
flagPopup = false;
// dragging is enable only if cursor is inside actual item
dragged = isCursorInsideActualItem(elementClicked(DOM.eventGetTarget(event)));
mouseDownX = event.getScreenX();
mouseDownY = event.getClientY();
}
} else if (DOM.eventGetType(event) == Event.ONMOUSEMOVE) {
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
if (Main.get().activeFolderTree.canDrag() && dragged && mouseDownX > 0 && mouseDownY > 0
&& evalDragPixelSensibility()) {
TreeItem actualItem = Main.get().activeFolderTree.getActualItem();
Main.get().draggable.show(actualItem.getHTML(), OriginPanel.TREE_ROOT);
Main.get().activeFolderTree.fileBrowserRefreshDone();
mouseDownX = 0;
mouseDownY = 0;
dragged = false;
}
} else if (DOM.eventGetType(event) == Event.ONMOUSEUP || DOM.eventGetType(event) == Event.ONCLICK
|| DOM.eventGetType(event) == Event.ONDBLCLICK) {
mouseDownX = 0;
mouseDownY = 0;
dragged = false; // Always disabling the popup flag
}
// Prevent folder creation or renaming propagate actions to other tree nodes
int action = Main.get().activeFolderTree.getFolderAction();
if (action != FolderTree.ACTION_CREATE && action != FolderTree.ACTION_RENAME) {
super.onBrowserEvent(event);
}
}
示例14: onResizeEvent
private void onResizeEvent(Event event) {
if (resizable && WidgetUtil.isTouchEventOrLeftMouseButton(event)) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
case Event.ONTOUCHSTART:
showResizingCurtain();
if (BrowserInfo.get().isIE()) {
resizeBox.getStyle().setVisibility(Style.Visibility.HIDDEN);
}
resizing = true;
startX = WidgetUtil.getTouchOrMouseClientX(event);
startY = WidgetUtil.getTouchOrMouseClientY(event);
origW = getElement().getOffsetWidth();
origH = getElement().getOffsetHeight();
DOM.setCapture(getElement());
event.preventDefault();
break;
case Event.ONMOUSEUP:
case Event.ONTOUCHEND:
setSize(event);
case Event.ONTOUCHCANCEL:
DOM.releaseCapture(getElement());
case Event.ONLOSECAPTURE:
hideResizingCurtain();
if (BrowserInfo.get().isIE()) {
resizeBox.getStyle().clearVisibility();
}
resizing = false;
break;
case Event.ONMOUSEMOVE:
case Event.ONTOUCHMOVE:
if (resizing) {
setSize(event);
event.preventDefault();
}
break;
default:
event.preventDefault();
break;
}
}
}