本文整理汇总了Java中com.google.gwt.user.client.Event.ONMOUSEDOWN属性的典型用法代码示例。如果您正苦于以下问题:Java Event.ONMOUSEDOWN属性的具体用法?Java Event.ONMOUSEDOWN怎么用?Java Event.ONMOUSEDOWN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.gwt.user.client.Event
的用法示例。
在下文中一共展示了Event.ONMOUSEDOWN属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
SelectionMode mode = null;
for (SelectionMode m: SelectionMode.values())
if (hasUnselectedDays(m)) {
mode = m; break;
}
if (mode != null)
setAllSelected(true, mode);
else
setAllSelected(false, SelectionMode.All);
if (iCursor != null) iPanel.getWidget().setCursor(iCursor);
event.preventDefault();
break;
}
super.onBrowserEvent(event);
}
示例3: 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;
}
}
示例4: handleMouseDownEvent
/**
* Handles special behavior of the mouse down event.
*
* @param event
*/
private void handleMouseDownEvent(Event event) {
/*
* Prevent the keyboard focus from leaving the textfield by preventing
* the default behaviour of the browser. Fixes #4285.
*/
if (event.getTypeInt() == Event.ONMOUSEDOWN) {
debug("VComboBoxMultiselect: blocking mouseDown event to avoid blur");
event.preventDefault();
event.stopPropagation();
/*
* In IE the above wont work, the blur event will still trigger. So,
* we set a flag here to prevent the next blur event from happening.
* This is not needed if do not already have focus, in that case
* there will not be any blur event and we should not cancel the
* next blur.
*/
if (BrowserInfo.get()
.isIE() && this.focused) {
this.preventNextBlurEventInIE = true;
debug("VComboBoxMultiselect: Going to prevent next blur event on IE");
}
}
}
示例5: onPreviewNativeEvent
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
if (this.resizable) {
// We need to preventDefault() on mouseDown events (outside of the
// DialogBox content) to keep text from being selected when it
// is dragged.
NativeEvent nativeEvent = event.getNativeEvent();
if (!event.isCanceled()
&& (event.getTypeInt() == Event.ONMOUSEDOWN)
&& calcDragMode(nativeEvent.getClientX(),nativeEvent.getClientY()) >= 0) {
nativeEvent.preventDefault();
}
}
super.onPreviewNativeEvent(event);
}
示例6: 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);
}
示例7: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
if (contextMenuHandler != null && event.getTypeInt() == Event.ONCONTEXTMENU) {
contextMenuHandler.onContextMenu(event);
return;
}
if ((event.getTypeInt() == Event.ONCLICK
|| event.getTypeInt() == Event.ONMOUSEDOWN)
&& event.getButton() != NativeEvent.BUTTON_LEFT) {
event.preventDefault();
event.stopPropagation();
return;
}
super.onBrowserEvent(event);
}
示例8: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
MouseDownEvent.fireNativeEvent(event, this);
event.stopPropagation();
event.preventDefault();
break;
}
}
示例9: onBrowserEvent
@Override
public void onBrowserEvent(Event event) {
Element target = DOM.eventGetTarget(event);
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
boolean open = iFilterOpen.getElement().equals(target);
boolean close = iFilterClose.getElement().equals(target);
boolean clear = iFilterClear.getElement().equals(target);
boolean filter = iFilter.getElement().equals(target);
if (isFilterPopupShowing() || close) {
hideFilterPopup();
} else if (open) {
hideSuggestions();
showFilterPopup();
}
if (clear) {
iFilter.setText("");
removeAllChips();
setAriaLabel(toAriaString());
ValueChangeEvent.fire(FilterBox.this, getValue());
}
if (!filter) {
event.stopPropagation();
event.preventDefault();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
iFilter.setFocus(true);
}
});
}
break;
}
}
示例10: 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);
}
示例11: onBrowserEvent
public void onBrowserEvent(Event event) {
int selectedRow = 0;
if (DOM.eventGetType(event) == Event.ONDBLCLICK || DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
Element td = getMouseEventTargetCell(event);
if (td == null) return;
Element tr = DOM.getParent(td);
Element body = DOM.getParent(tr);
selectedRow = DOM.getChildIndex(body, tr);
}
// Only if selectedRow >= 0, indicates a document row value and must apear menu or double click action
if (selectedRow >= 0) {
// When de button mouse is released
mouseX = DOM.eventGetClientX(event);
mouseY = DOM.eventGetClientY(event);
// On double click not sends event to onCellClicked across super.onBrowserEvent();
if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
// Disables the event propagation the sequence is:
// Two time entry onCellClicked before entry on onBrowserEvent and disbles the
// Tree onCellClicked that produces inconsistence error refreshing
DOM.eventCancelBubble(event, true);
Main.get().mainPanel.search.historySearch.searchSaved.getSearch();
} else if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
switch (DOM.eventGetButton(event)) {
case Event.BUTTON_RIGHT:
markSelectedRow(selectedRow);
Main.get().mainPanel.search.historySearch.searchSaved.showMenu();
DOM.eventPreventDefault(event); // Prevent to fire event to browser
break;
default:
break;
}
}
}
super.onBrowserEvent(event);
}
示例12: 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);
}
示例13: 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;
}
}
示例14: 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;
}
示例15: 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();
}