本文整理汇总了Java中org.oscim.event.Gesture类的典型用法代码示例。如果您正苦于以下问题:Java Gesture类的具体用法?Java Gesture怎么用?Java Gesture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gesture类属于org.oscim.event包,在下文中一共展示了Gesture类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (!(e instanceof MotionHandler)) return false;
if (g instanceof Gesture.Tap)
return activateSelectedItems(e, mActiveItemSingleTap);
if (g instanceof Gesture.LongPress)
return activateSelectedItems(e, mActiveItemLongPress);
return false;
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:12,代码来源:WaypointLayer.java
示例2: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.Tap)
return activateSelectedItems(e, mActiveItemSingleTap);
//noinspection SimplifiableIfStatement
if (g instanceof Gesture.LongPress)
return activateSelectedItems(e, mActiveItemLongPress);
return false;
}
开发者ID:andreynovikov,项目名称:trekarta,代码行数:12,代码来源:ItemizedLayer.java
示例3: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture gesture, MotionEvent event) {
Point point = new Point();
mMap.viewport().fromScreenPoint(event.getX(), event.getY(), point);
int tileX = (int) (point.getX() / TILE_SCALE);
int tileY = (int) (point.getY() / TILE_SCALE);
if (tileX < 0 || tileX > 127 || tileY < 0 || tileY > 127)
return false;
Index.MapStatus mapStatus = mMapIndex.getNativeMap(tileX, tileY);
if (gesture instanceof Gesture.LongPress) {
if (mapStatus.downloading != 0L)
mMapIndex.selectNativeMap(tileX, tileY, Index.ACTION.CANCEL);
else if (mapStatus.created > 0)
mMapIndex.selectNativeMap(tileX, tileY, Index.ACTION.REMOVE);
return true;
}
if (gesture instanceof Gesture.Tap || gesture instanceof Gesture.DoubleTap) {
if (mapStatus.downloading != 0L)
return true;
if (mMapIndex.hasDownloadSizes()) {
if (mapStatus.downloadSize == 0L)
return true;
}
mMapIndex.selectNativeMap(tileX, tileY, Index.ACTION.DOWNLOAD);
return true;
}
return false;
}
开发者ID:andreynovikov,项目名称:trekarta,代码行数:29,代码来源:MapCoverageLayer.java
示例4: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(final Gesture g, final MotionEvent e) {
if (g instanceof Gesture.Tap) {
return activateSelectedMarker(e, _activeMarker_SingleTap);
}
if (g instanceof Gesture.LongPress) {
return activateSelectedMarker(e, _ActiveMarker_LongPress);
}
return false;
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:14,代码来源:MarkerLayer.java
示例5: onItemSingleTapUp_shouldNotifyListener
import org.oscim.event.Gesture; //导入依赖的package包/类
@Test
public void onItemSingleTapUp_shouldNotifyListener() throws Exception {
ItemizedLayer<MarkerItem> poiLayer = mapFragment.getPoiLayer();
poiLayer.addItem(new MarkerItem("Title", "Description", new GeoPoint(0, 0)));
poiLayer.onGesture(Gesture.TAP, new FakeMotionEvent(0, 0));
assertThat(listener.getIndex()).isEqualTo(0);
assertThat(listener.getItem().getTitle()).isEqualTo("Title");
}
开发者ID:mapzen,项目名称:open,代码行数:9,代码来源:MapFragmentTest.java
示例6: handleGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
boolean handleGesture(Gesture g, MotionEvent e) {
if (mDirtyLayers)
updateLayers();
for (Layer o : mLayers)
if (o instanceof GestureListener)
if (((GestureListener) o).onGesture(g, e))
return true;
return false;
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:12,代码来源:Layers.java
示例7: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g == Gesture.DOUBLE_TAP) {
mDoubleTap = true;
return true;
}
return false;
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:9,代码来源:MapEventLayer.java
示例8: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.Tap)
return activateSelectedItems(e, mActiveItemSingleTap);
if (g instanceof Gesture.LongPress)
return activateSelectedItems(e, mActiveItemLongPress);
return false;
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:11,代码来源:ItemizedLayer.java
示例9: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
if (g instanceof Gesture.LongPress) {
GeoPoint p = mMap.viewport().fromScreenPoint(e.getX(), e.getY());
return mReceiver.longPressHelper(p);
}
return false;
}
开发者ID:opensciencemap,项目名称:vtm-app,代码行数:9,代码来源:DistanceTouchOverlay.java
示例10: handleGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
public boolean handleGesture(Gesture g, MotionEvent e) {
this.updateMap(true);
return super.handleGesture(g, e);
}
开发者ID:Longri,项目名称:cachebox3.0,代码行数:5,代码来源:CacheboxMapAdapter.java
示例11: onGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onGesture(Gesture g, MotionEvent e) {
return mListener.onGesture(g, e);
}
开发者ID:andreynovikov,项目名称:trekarta,代码行数:5,代码来源:MapEventLayer.java
示例12: onLongPress
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public void onLongPress(MotionEvent e) {
mMap.handleGesture(Gesture.LONG_PRESS, mMotionEvent.wrap(e));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:5,代码来源:GestureHandler.java
示例13: onDown
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onDown(MotionEvent e) {
return mMap.handleGesture(Gesture.PRESS, mMotionEvent.wrap(e));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:5,代码来源:GestureHandler.java
示例14: onSingleTapConfirmed
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
return mMap.handleGesture(Gesture.TAP, mMotionEvent.wrap(e));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:5,代码来源:GestureHandler.java
示例15: onDoubleTap
import org.oscim.event.Gesture; //导入依赖的package包/类
@Override
public boolean onDoubleTap(MotionEvent e) {
return mMap.handleGesture(Gesture.DOUBLE_TAP, mMotionEvent.wrap(e));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:5,代码来源:GestureHandler.java
示例16: handleGesture
import org.oscim.event.Gesture; //导入依赖的package包/类
public boolean handleGesture(Gesture g, MotionEvent e) {
return mLayers.handleGesture(g, e);
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:4,代码来源:Map.java
示例17: simulateDoubleTap
import org.oscim.event.Gesture; //导入依赖的package包/类
private void simulateDoubleTap() {
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_DOWN, 1, 1));
layer.onGesture(Gesture.DOUBLE_TAP, new TestMotionEvent(MotionEvent.ACTION_UP, 1, 1));
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_UP, 1, 1));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:6,代码来源:MapEventLayerTest.java
示例18: simulateDoubleTouchDragUp
import org.oscim.event.Gesture; //导入依赖的package包/类
private void simulateDoubleTouchDragUp() {
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_DOWN, 1, 1));
layer.onGesture(Gesture.DOUBLE_TAP, new TestMotionEvent(MotionEvent.ACTION_MOVE, 1, 0));
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_MOVE, -100, 0));
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_UP, 1, 0));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:7,代码来源:MapEventLayerTest.java
示例19: simulateDoubleTouchDragDown
import org.oscim.event.Gesture; //导入依赖的package包/类
private void simulateDoubleTouchDragDown() {
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_DOWN, 1, 1));
layer.onGesture(Gesture.DOUBLE_TAP, new TestMotionEvent(MotionEvent.ACTION_MOVE, 1, 2));
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_MOVE, 100, 2));
layer.onTouchEvent(new TestMotionEvent(MotionEvent.ACTION_UP, 1, 2));
}
开发者ID:opensciencemap,项目名称:vtm,代码行数:7,代码来源:MapEventLayerTest.java
注:本文中的org.oscim.event.Gesture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论