本文整理汇总了Java中com.google.gwt.event.dom.client.HumanInputEvent.preventDefault方法的典型用法代码示例。如果您正苦于以下问题:Java HumanInputEvent.preventDefault方法的具体用法?Java HumanInputEvent.preventDefault怎么用?Java HumanInputEvent.preventDefault使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.dom.client.HumanInputEvent
的用法示例。
在下文中一共展示了HumanInputEvent.preventDefault方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: humanStart
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void humanStart(HumanInputEvent ev) {
int x= getAbsoluteX(ev);
int y= getAbsoluteY(ev);
PopupRegion r= findRegion(x,y);
addPreventEvent();
if (r== PopupRegion.TITLE_BAR) {
if (_hideOnResizeWidget!=null) {
GwtUtil.setStyle(_hideOnResizeWidget, "visibility", "hidden");
}
ev.preventDefault();
beginMove(x,y);
} else if (_expandW!=null) {
if (r== PopupRegion.SE_CORNER || r== PopupRegion.SW_CORNER) {
if (_hideOnResizeWidget!=null) {
GwtUtil.setStyle(_hideOnResizeWidget, "visibility", "hidden");
}
ev.preventDefault();
beginResize(r);
}
}
}
示例2: humanStop
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void humanStop(HumanInputEvent ev) {
removePreventEvent();
if (_moving) {
if (_hideOnResizeWidget!=null) {
GwtUtil.setStyle(_hideOnResizeWidget, "visibility", "visible");
}
ev.preventDefault();
// DOM.eventPreventDefault(ev);
endMove();
}
else if (_resizing) {
if (_hideOnResizeWidget!=null) {
GwtUtil.setStyle(_hideOnResizeWidget, "visibility", "visible");
}
ev.preventDefault();
// DOM.eventPreventDefault(ev);
endResize();
}
}
示例3: onDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onDown(HumanInputEvent<?> event) {
SliderArea sliderArea = zoomSlider.getSliderArea();
event.stopPropagation();
double y = getLocation(event, RenderSpace.SCREEN).getY();
double x = getLocation(event, RenderSpace.SCREEN).getX();
Bbox sliderAreaBounds = sliderArea.getAddonBounds();
Coordinate origin = sliderAreaBounds.getOrigin();
Coordinate endPoint = sliderAreaBounds.getEndPoint();
if (origin.getX() < x && endPoint.getX() > x &&
origin.getY() < y && endPoint.getY() > y) {
dragging = true;
sliderArea.drawMapRectangle();
}
event.preventDefault();
}
示例4: onDraggerMouseDown
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void onDraggerMouseDown(HumanInputEvent event, double relativeY)
{
Event.setCapture(Magnifier.this.m_dragger.getElement());
event.preventDefault();
m_isMouseDown = true;
//--- DRK > No idea why draggerTop has to be offset by half the dragger height...NO IDEA.
double draggerTop = m_dragger.getAbsoluteTop() - DRAGGER_HEIGHT_DIV_2;
double draggerY = (draggerTop - DRAGGER_START_Y) + DRAGGER_HEIGHT_DIV_2;
double mouseY = relativeY;
setDraggerPositionFromMouse(draggerY);
m_mouseDownOffset = draggerY - mouseY;
}
示例5: onDraggerMouseUp
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void onDraggerMouseUp(HumanInputEvent event, double relativeY)
{
if( m_isMouseDown )
{
Event.releaseCapture(Magnifier.this.m_dragger.getElement());
event.preventDefault();
//--- DRK > Pretty hacky, but I can't figure out how to "forward" the event up the DOM so tooltip can get it.
if( event instanceof MouseUpEvent )
{
m_viewContext.toolTipMngr.onMouseUp((MouseUpEvent)event);
}
double mouseY = relativeY;
Magnifier.this.setDraggerPositionFromMouse(mouseY + m_mouseDownOffset);
m_isMouseDown = false;
}
}
示例6: humanMove
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void humanMove(HumanInputEvent ev) {
int x= getAbsoluteX(ev);
int y= getAbsoluteY(ev);
if (_moving) {
// DOM.eventPreventDefault(ev.getNativeEvent());
ev.preventDefault();
doMove(x,y);
}
else if (_resizing) {
// DOM.eventPreventDefault(ev);
ev.preventDefault();
moveResize(x,y);
}
}
示例7: handleStart
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private static void handleStart(EventHandlingTarget[] panels, final DragCache storage, FocusPanel handlerTarget, HumanInputEvent<?> event, Point p) {
// Notification.showInfo("DOWN " + p.x);
handlerTarget.setFocus(true);
event.preventDefault(); // necessary to avoid showing textcursor and selecting proppanel in chrome AND to avoid scrolling with touch move (problem is it also avoids scrolling with 2 fingers)
storage.moveStart = new Point(p.x, p.y);
storage.dragging = DragStatus.FIRST;
storage.elementToDrag = storage.activePanel.getGridElementOnPosition(storage.moveStart);
storage.activePanel.onMouseDownScheduleDeferred(storage.elementToDrag, event.isControlKeyDown());
}
示例8: onUp
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onUp(HumanInputEvent<?> event) {
event.stopPropagation();
dragging = false;
double lastY = getLocation(event, RenderSpace.SCREEN).getY();
lastY = validateY(lastY);
zoom(lastY);
drawSliderIcon(lastY);
zoomSlider.getSliderArea().drawStartRectangle(zoomSlider.getSliderUnit().getBounds().getWidth());
event.preventDefault();
}
示例9: onDrag
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
@Override
public void onDrag(HumanInputEvent<?> event) {
event.stopPropagation();
double y = getLocation(event, RenderSpace.SCREEN).getY();
if (dragging) {
y = validateY(y);
drawSliderIcon(y);
}
event.preventDefault();
}
示例10: startDragging
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void startDragging(HumanInputEvent<?> event) {
dragging = true;
xy = eventParser.getLocation(event, RenderSpace.SCREEN);
updateRectangle(event);
event.stopPropagation();
event.preventDefault();
}
示例11: onDraggerMouseMove
import com.google.gwt.event.dom.client.HumanInputEvent; //导入方法依赖的package包/类
private void onDraggerMouseMove(HumanInputEvent event, double relativeY)
{
if( m_isMouseDown )
{
double mouseY = relativeY;
Magnifier.this.setDraggerPositionFromMouse(mouseY + m_mouseDownOffset);
event.preventDefault();
}
}