当前位置: 首页>>代码示例>>Java>>正文


Java HumanInputEvent.preventDefault方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:lsst,项目名称:firefly,代码行数:24,代码来源:PopupPane.java

示例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();
        }
    }
 
开发者ID:lsst,项目名称:firefly,代码行数:21,代码来源:PopupPane.java

示例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();
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:17,代码来源:ZoomSliderController.java

示例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;
}
 
开发者ID:dougkoellmer,项目名称:swarm,代码行数:17,代码来源:Magnifier.java

示例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;
	}
}
 
开发者ID:dougkoellmer,项目名称:swarm,代码行数:20,代码来源:Magnifier.java

示例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);
        }
    }
 
开发者ID:lsst,项目名称:firefly,代码行数:15,代码来源:PopupPane.java

示例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());
}
 
开发者ID:umlet,项目名称:umlet,代码行数:11,代码来源:EventHandlingUtils.java

示例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();
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:12,代码来源:ZoomSliderController.java

示例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();
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:11,代码来源:ZoomSliderController.java

示例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();
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:8,代码来源:ZoomToRectangleControl.java

示例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();
	}
}
 
开发者ID:dougkoellmer,项目名称:swarm,代码行数:11,代码来源:Magnifier.java


注:本文中的com.google.gwt.event.dom.client.HumanInputEvent.preventDefault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。