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


Java MouseMoveEvent.getX方法代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.MouseMoveEvent.getX方法的典型用法代码示例。如果您正苦于以下问题:Java MouseMoveEvent.getX方法的具体用法?Java MouseMoveEvent.getX怎么用?Java MouseMoveEvent.getX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.event.dom.client.MouseMoveEvent的用法示例。


在下文中一共展示了MouseMoveEvent.getX方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onMouseMove

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
public void onMouseMove(MouseMoveEvent e) {
	e.preventDefault();
	mouseCursorX=e.getX();
	mouseCursorY=e.getY();
	if (mouseDragging) {
		mouseDragged(e);
		return;
	}
	mouseSelect(e);
}
 
开发者ID:sharpie7,项目名称:circuitjs1,代码行数:11,代码来源:CirSim.java

示例2: onMouseMove

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent event) {
	if (previousX == event.getX() && previousY == event.getY())
		return;
	previousX = event.getX();
	previousY = event.getY();
	showUI();
}
 
开发者ID:mateusz-matela,项目名称:djvu-html5,代码行数:9,代码来源:UIHider.java

示例3: continueDragging

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
private void continueDragging(MouseMoveEvent event) {
  if (dragging) {
    int absX = event.getX() + contentContainer.getAbsoluteLeft();
    int absY = event.getY() + contentContainer.getAbsoluteTop();

    // if the mouse is off the screen to the left, right, or top, don't
    // move the dialog box. This would let users lose dialog boxes, which
    // would be bad for modal popups.
    if (absX < clientLeft || absX >= windowWidth || absY < clientTop) {
      return;
    }

    setPopupPosition(absX - dragStartX, absY - dragStartY);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:16,代码来源:View.java

示例4: onMouseMove

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent event) {
	if (isMouseDown) {
		pan(event.getX() - x, event.getY() - y);
		x = event.getX();
		y = event.getY();
	}
}
 
开发者ID:mateusz-matela,项目名称:djvu-html5,代码行数:9,代码来源:PanListener.java

示例5: onMouseMove

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent event) {
	final int x = event.getX();
	final int y = event.getY();
	// System.out.println("onMouseMove(" + x + "," + y + ")");

	if (lastStroke != null) {
		addPointToLastStroke(x, y);

		updateCanvas();
	}
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:13,代码来源:StrokeCanvas.java

示例6: onMouseMove

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
public void onMouseMove(MouseMoveEvent event) {
	if (dragging) {
		int deltaX = event.getX() - startX;
		int deltaY = event.getY() - startY;
		rectangle.setX(rectangle.getX() + deltaX);
		rectangle.setY(rectangle.getY() + deltaY);
		text.setX(text.getX() + deltaX);
		text.setY(text.getY() + deltaY);
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt2,代码行数:11,代码来源:DrawingInteractionPanel.java

示例7: mouseDragged

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
public void mouseDragged(MouseMoveEvent e) {
  	// ignore right mouse button with no modifiers (needed on PC)
  	if (e.getNativeButton()==NativeEvent.BUTTON_RIGHT) {
  		if (!(e.isMetaKeyDown() ||
  				e.isShiftKeyDown() ||
  				e.isControlKeyDown() ||
  				e.isAltKeyDown()))
  			return;
  	}
  	
  	if (tempMouseMode==MODE_DRAG_SPLITTER) {
  		dragSplitter(e.getX(), e.getY());
  		return;
  	}
  	int gx = inverseTransformX(e.getX());
  	int gy = inverseTransformY(e.getY());
  	if (!circuitArea.contains(e.getX(), e.getY()))
  	    return;
  	if (dragElm != null)
  	    dragElm.drag(gx, gy);
  	boolean success = true;
  	switch (tempMouseMode) {
  	case MODE_DRAG_ALL:
  		dragAll(e.getX(), e.getY());
  		break;
  	case MODE_DRAG_ROW:
  		dragRow(snapGrid(gx), snapGrid(gy));
  		break;
  	case MODE_DRAG_COLUMN:
dragColumn(snapGrid(gx), snapGrid(gy));
  		break;
  	case MODE_DRAG_POST:
  		if (mouseElm != null)
  		    dragPost(snapGrid(gx), snapGrid(gy));
  		break;
  	case MODE_SELECT:
  		if (mouseElm == null)
  		    selectArea(gx, gy);
  		else {
  		    // wait short delay before dragging.  This is to fix problem where switches were accidentally getting
  		    // dragged when tapped on mobile devices
  		    if (System.currentTimeMillis()-mouseDownTime < 150)
  			return;
  		
  		    tempMouseMode = MODE_DRAG_SELECTED;
  		    success = dragSelected(gx, gy);
  		}
  		break;
  	case MODE_DRAG_SELECTED:
  		success = dragSelected(gx, gy);
  		break;

  	}
  	dragging = true;
  	if (success) {
  	    dragScreenX = e.getX();
  	    dragScreenY = e.getY();
  //	    console("setting dragGridx in mousedragged");
  	    dragGridX = inverseTransformX(dragScreenX);
  	    dragGridY = inverseTransformY(dragScreenY);
  	    if (!(tempMouseMode == MODE_DRAG_SELECTED && onlyGraphicsElmsSelected())) {
  		dragGridX = snapGrid(dragGridX);
  		dragGridY = snapGrid(dragGridY);
  	    }
  	}
  }
 
开发者ID:sharpie7,项目名称:circuitjs1,代码行数:67,代码来源:CirSim.java

示例8: onMouseMove

import com.google.gwt.event.dom.client.MouseMoveEvent; //导入方法依赖的package包/类
@Override
public void onMouseMove(MouseMoveEvent event) {
	if(useTrackball){
		return;
	}
	
	/*
	if(selectedObject!=null && event.getNativeButton()==NativeEvent.BUTTON_MIDDLE){
		
		Ray ray=projector.gwtCreateRay(event.getX(), event.getY(), screenWidth, screenHeight, camera);
		JsArray<Intersect> intersects = ray.intersectObject( mouseClickCatcher );
		
		
		Vector3 newPos=intersects.get(0).getPoint().subSelf( offset );
		
		Matrix4 rotM=THREE.Matrix4();
		rotM.getInverse(selectedObject.getMatrixRotationWorld());
		rotM.multiplyVector3(newPos);		
		
		selectedObject.getPosition().copy( newPos);
		return;
	}*/
	
	
	
	
	if(mouseDown){
		
		int diffX=event.getX()-mouseDownX;
		int diffY=event.getY()-mouseDownY;
		mouseDownX=event.getX();
		mouseDownY=event.getY();
		
		
		
		
		if(event.getNativeButton()==NativeEvent.BUTTON_MIDDLE){
			int newX=rotationXRange.getValue()+diffY;
			if(newX<-180){
				newX=360+newX;
			}
			if(newX>180){
				newX=360-newX;
			}
			rotationXRange.setValue(newX);
			
			int newY=rotationYRange.getValue()+diffX;
			if(newY<-180){
				newY=360+newY;
			}
			if(newY>180){
				newY=360-newY;
			}
			rotationYRange.setValue(newY);
			return;
		}
		
		
		
		if(event.isControlKeyDown()){//TODO future function
			/*
		int index=indexWeightEditor.getArrayIndex();	
		if(index!=-1){
			loadedGeometry.vertices().get(index).getPosition().incrementX(diffX);
			loadedGeometry.vertices().get(index).getPosition().incrementX(diffY);
			createSkinnedMesh();
			createWireBody();
			
		}*/
		}else if(event.isAltKeyDown()){
		posX+=(double)diffX/16*posScale;
		posY-=(double)diffY/16*posScale;
		}else{
			rotX=(rotX+diffY);
			rotY=(rotY+diffX);
		}
	}
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:79,代码来源:CopyOfGWTModelWeight.java


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