本文整理汇总了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);
}
示例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();
}
示例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);
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}