本文整理了Java中com.google.gwt.dom.client.Touch.getIdentifier()
方法的一些代码示例,展示了Touch.getIdentifier()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Touch.getIdentifier()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Touch
类名称:Touch
方法名:getIdentifier
[英]Gets a unique identifier for this touch.
[中]获取此触摸的唯一标识符。
代码示例来源:origin: libgdx/libgdx
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId;
touchMap.put(real, touchId = getAvailablePointer());
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
deltaX[touchId] = getRelativeX(touch, canvas) - touchX[touchId];
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
touchMap.remove(real);
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
touchMap.remove(real);
代码示例来源:origin: libgdx/libgdx
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId;
touchMap.put(real, touchId = getAvailablePointer());
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
deltaX[touchId] = getRelativeX(touch, canvas) - touchX[touchId];
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
touchMap.remove(real);
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
touchMap.remove(real);
代码示例来源:origin: errai/errai
public TouchPoint(Touch touch) {
this.id = touch.getIdentifier();
this.x = touch.getPageX();
this.y = touch.getPageY();
}
代码示例来源:origin: org.jboss.errai/errai-cordova
public TouchPoint(Touch touch) {
this.id = touch.getIdentifier();
this.x = touch.getPageX();
this.y = touch.getPageY();
}
代码示例来源:origin: dankurka/mgwt
public static TouchCopy copy(Touch touch) {
return new TouchCopy(touch.getPageX(), touch.getPageY(), touch.getIdentifier());
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
public static TouchCopy copy(Touch touch) {
return new TouchCopy(touch.getPageX(), touch.getPageY(), touch.getIdentifier());
}
代码示例来源:origin: errai/errai
@Override
public void onTouchMove(TouchMoveEvent event) {
switch (state) {
case WAITING:
case FINGERS_DOWN:
case FINGERS_UP:
// compare positions
JsArray<Touch> currentTouches = event.getTouches();
for (int i = 0; i < currentTouches.length(); i++) {
Touch currentTouch = currentTouches.get(i);
for (TouchPoint startTouch : startPositions) {
if (currentTouch.getIdentifier() == startTouch.getId()) {
if (Math.abs(currentTouch.getPageX() - startTouch.getX()) > DEFAULT_MAX_DISTANCE
|| Math.abs(currentTouch.getPageY() - startTouch.getY()) > DEFAULT_MAX_DISTANCE) {
state = State.INVALID;
break;
}
}
if (state == State.INVALID) {
break;
}
}
}
break;
default:
state = State.INVALID;
break;
}
}
代码示例来源:origin: org.jboss.errai/errai-cordova
@Override
public void onTouchMove(TouchMoveEvent event) {
switch (state) {
case WAITING:
case FINGERS_DOWN:
case FINGERS_UP:
// compare positions
JsArray<Touch> currentTouches = event.getTouches();
for (int i = 0; i < currentTouches.length(); i++) {
Touch currentTouch = currentTouches.get(i);
for (TouchPoint startTouch : startPositions) {
if (currentTouch.getIdentifier() == startTouch.getId()) {
if (Math.abs(currentTouch.getPageX() - startTouch.getX()) > DEFAULT_MAX_DISTANCE
|| Math.abs(currentTouch.getPageY() - startTouch.getY()) > DEFAULT_MAX_DISTANCE) {
state = State.INVALID;
break;
}
}
if (state == State.INVALID) {
break;
}
}
}
break;
default:
state = State.INVALID;
break;
}
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
@Override
public void onTouchMove(TouchMoveEvent event) {
switch (state) {
case FINGERS_GOING_DOWN:
case FINGERS_GOING_UP:
// compare positions
JsArray<Touch> currentTouches = event.getTouches();
for (int i = 0; i < currentTouches.length(); i++) {
Touch currentTouch = currentTouches.get(i);
for (int j = 0; j < touches.length(); j++) {
TouchCopy startTouch = touches.get(j);
if (currentTouch.getIdentifier() == startTouch.getIdentifier()) {
if (Math.abs(currentTouch.getPageX() - startTouch.getPageX()) > distance || Math.abs(currentTouch.getPageY() - startTouch.getPageY()) > distance) {
state = State.INVALID;
break;
}
}
if (state == State.INVALID) {
break;
}
}
}
break;
default:
break;
}
}
代码示例来源:origin: dankurka/mgwt
@Override
public void onTouchMove(TouchMoveEvent event) {
switch (state) {
case FINGERS_GOING_DOWN:
case FINGERS_GOING_UP:
// compare positions
JsArray<Touch> currentTouches = event.getTouches();
for (int i = 0; i < currentTouches.length(); i++) {
Touch currentTouch = currentTouches.get(i);
for (int j = 0; j < touches.length(); j++) {
TouchCopy startTouch = touches.get(j);
if (currentTouch.getIdentifier() == startTouch.getIdentifier()) {
if (Math.abs(currentTouch.getPageX() - startTouch.getPageX()) > distance || Math.abs(currentTouch.getPageY() - startTouch.getPageY()) > distance) {
state = State.INVALID;
break;
}
}
if (state == State.INVALID) {
break;
}
}
}
break;
default:
break;
}
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
@Override
public void onTouchMove(TouchMoveEvent event) {
switch (state) {
case WAITING:
case FINGERS_DOWN:
case FINGERS_UP:
// compare positions
JsArray<Touch> currentTouches = event.getTouches();
for (int i = 0; i < currentTouches.length(); i++) {
Touch currentTouch = currentTouches.get(i);
for (int j = 0; j < startPositions.length(); j++) {
TouchCopy startTouch = startPositions.get(j);
if (currentTouch.getIdentifier() == startTouch.getIdentifier()) {
if (Math.abs(currentTouch.getPageX() - startTouch.getPageX()) > distance || Math.abs(currentTouch.getPageY() - startTouch.getPageY()) > distance) {
state = State.INVALID;
break;
}
}
if (state == State.INVALID) {
break;
}
}
}
break;
default:
state = State.INVALID;
break;
}
}
代码示例来源:origin: dankurka/mgwt
@Override
public void onTouchMove(TouchMoveEvent event) {
switch (state) {
case WAITING:
case FINGERS_DOWN:
case FINGERS_UP:
// compare positions
JsArray<Touch> currentTouches = event.getTouches();
for (int i = 0; i < currentTouches.length(); i++) {
Touch currentTouch = currentTouches.get(i);
for (int j = 0; j < startPositions.length(); j++) {
TouchCopy startTouch = startPositions.get(j);
if (currentTouch.getIdentifier() == startTouch.getIdentifier()) {
if (Math.abs(currentTouch.getPageX() - startTouch.getPageX()) > distance || Math.abs(currentTouch.getPageY() - startTouch.getPageY()) > distance) {
state = State.INVALID;
break;
}
}
if (state == State.INVALID) {
break;
}
}
}
break;
default:
state = State.INVALID;
break;
}
}
代码示例来源:origin: thothbot/parallax
final int real = touch.getIdentifier();
int touchId;
this.touchMap.put( real, touchId = this.getAvailablePointer() );
final int real = touch.getIdentifier();
final int touchId = this.touchMap.get( real );
this.deltaX[ touchId ] = this.getRelativeX( touch, this.canvas ) - this.touchX[ touchId ];
final int real = touch.getIdentifier();
final int touchId = this.touchMap.get( real );
this.touchMap.remove( real );
final int real = touch.getIdentifier();
final int touchId = this.touchMap.get( real );
this.touchMap.remove( real );
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-gwt
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId;
touchMap.put(real, touchId = getAvailablePointer());
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
deltaX[touchId] = getRelativeX(touch, canvas) - touchX[touchId];
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
touchMap.remove(real);
for (int i = 0, j = touches.length(); i < j; i++) {
Touch touch = touches.get(i);
int real = touch.getIdentifier();
int touchId = touchMap.get(real);
touchMap.remove(real);
内容来源于网络,如有侵权,请联系作者删除!