comment out all InputLayer stuff
This commit is contained in:
parent
4e01de31f7
commit
0f52eff9c9
@ -1,228 +1,228 @@
|
|||||||
/*
|
///*
|
||||||
* Copyright 2012 osmdroid authors
|
// * Copyright 2012 osmdroid authors
|
||||||
* Copyright 2013 Hannes Janetzek
|
// * Copyright 2013 Hannes Janetzek
|
||||||
*
|
// *
|
||||||
* This program is free software: you can redistribute it and/or modify it under the
|
// * This program is free software: you can redistribute it and/or modify it under the
|
||||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
// * terms of the GNU Lesser General Public License as published by the Free Software
|
||||||
* Foundation, either version 3 of the License, or (at your option) any later version.
|
// * Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
// *
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
// * This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
// * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
// * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||||
*
|
// *
|
||||||
* You should have received a copy of the GNU Lesser General Public License along with
|
// * You should have received a copy of the GNU Lesser General Public License along with
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
// * this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
// */
|
||||||
package org.oscim.layers;
|
//package org.oscim.layers;
|
||||||
|
//
|
||||||
import org.oscim.event.KeyEvent;
|
//import org.oscim.event.KeyEvent;
|
||||||
import org.oscim.event.MotionEvent;
|
//import org.oscim.event.MotionEvent;
|
||||||
import org.oscim.map.Map;
|
//import org.oscim.map.Map;
|
||||||
|
//
|
||||||
public abstract class InputLayer extends Layer {
|
//public abstract class InputLayer extends Layer {
|
||||||
|
//
|
||||||
public InputLayer(Map map) {
|
// public InputLayer(Map map) {
|
||||||
super(map);
|
// super(map);
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param keyCode
|
// * @param keyCode
|
||||||
* ...
|
// * ...
|
||||||
* @param event
|
// * @param event
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
// public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param keyCode
|
// * @param keyCode
|
||||||
* ...
|
// * ...
|
||||||
* @param event
|
// * @param event
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
// public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* <b>You can prevent all(!) other Touch-related events from happening!</b><br />
|
// * <b>You can prevent all(!) other Touch-related events from happening!</b><br />
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param event
|
// * @param event
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onTouchEvent(MotionEvent event) {
|
// public boolean onTouchEvent(MotionEvent event) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param e
|
// * @param e
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onTrackballEvent(MotionEvent e) {
|
// public boolean onTrackballEvent(MotionEvent e) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/** GestureDetector.OnDoubleTapListener **/
|
// /** GestureDetector.OnDoubleTapListener **/
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param e
|
// * @param e
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onDoubleTap(MotionEvent e) {
|
// public boolean onDoubleTap(MotionEvent e) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param e
|
// * @param e
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onDoubleTapEvent(MotionEvent e) {
|
// public boolean onDoubleTapEvent(MotionEvent e) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param e
|
// * @param e
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onSingleTapConfirmed(MotionEvent e) {
|
// public boolean onSingleTapConfirmed(MotionEvent e) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/** OnGestureListener **/
|
// /** OnGestureListener **/
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param e
|
// * @param e
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onDown(MotionEvent e) {
|
// public boolean onDown(MotionEvent e) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
///**
|
// ///**
|
||||||
// * By default does nothing (<code>return false</code>). If you handled the
|
// // * By default does nothing (<code>return false</code>). If you handled the
|
||||||
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// // * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
// * you returned <code>true</code> none of the following Overlays or the
|
// // * you returned <code>true</code> none of the following Overlays or the
|
||||||
// * underlying {@link MapView} has the chance to handle this event.
|
// // * underlying {@link MapView} has the chance to handle this event.
|
||||||
// *
|
// // *
|
||||||
// * @param pEvent1
|
// // * @param pEvent1
|
||||||
// * ...
|
// // * ...
|
||||||
// * @param pEvent2
|
// // * @param pEvent2
|
||||||
// * ...
|
// // * ...
|
||||||
// * @param pVelocityX
|
// // * @param pVelocityX
|
||||||
// * ...
|
// // * ...
|
||||||
// * @param pVelocityY
|
// // * @param pVelocityY
|
||||||
// * ...
|
// // * ...
|
||||||
// * @return ...
|
// // * @return ...
|
||||||
// */
|
// // */
|
||||||
//public boolean onFling(MotionEvent pEvent1, MotionEvent pEvent2,
|
// //public boolean onFling(MotionEvent pEvent1, MotionEvent pEvent2,
|
||||||
// float pVelocityX, float pVelocityY) {
|
// // float pVelocityX, float pVelocityY) {
|
||||||
// return false;
|
// // return false;
|
||||||
//}
|
// //}
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param e
|
// * @param e
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onLongPress(MotionEvent e) {
|
// public boolean onLongPress(MotionEvent e) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param pEvent1
|
// * @param pEvent1
|
||||||
* ...
|
// * ...
|
||||||
* @param pEvent2
|
// * @param pEvent2
|
||||||
* ...
|
// * ...
|
||||||
* @param pDistanceX
|
// * @param pDistanceX
|
||||||
* ...
|
// * ...
|
||||||
* @param pDistanceY
|
// * @param pDistanceY
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onScroll(MotionEvent pEvent1, MotionEvent pEvent2,
|
// public boolean onScroll(MotionEvent pEvent1, MotionEvent pEvent2,
|
||||||
float pDistanceX, float pDistanceY) {
|
// float pDistanceX, float pDistanceY) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* @param pEvent
|
// * @param pEvent
|
||||||
* ...
|
// * ...
|
||||||
*/
|
// */
|
||||||
public void onShowPress(MotionEvent pEvent) {
|
// public void onShowPress(MotionEvent pEvent) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* By default does nothing (<code>return false</code>). If you handled the
|
// * By default does nothing (<code>return false</code>). If you handled the
|
||||||
* Event, return <code>true</code>, otherwise return <code>false</code>. If
|
// * Event, return <code>true</code>, otherwise return <code>false</code>. If
|
||||||
* you returned <code>true</code> none of the following Overlays or the
|
// * you returned <code>true</code> none of the following Overlays or the
|
||||||
* underlying {@link Map} has the chance to handle this event.
|
// * underlying {@link Map} has the chance to handle this event.
|
||||||
*
|
// *
|
||||||
* @param e
|
// * @param e
|
||||||
* ...
|
// * ...
|
||||||
* @return ...
|
// * @return ...
|
||||||
*/
|
// */
|
||||||
public boolean onSingleTapUp(MotionEvent e) {
|
// public boolean onSingleTapUp(MotionEvent e) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
@ -98,37 +98,37 @@ public class ItemizedIconLayer<Item extends MarkerItem> extends ItemizedLayer<It
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* Each of these methods performs a item sensitive check. If the item is
|
// * Each of these methods performs a item sensitive check. If the item is
|
||||||
* located its corresponding method is called. The result of the call is
|
// * located its corresponding method is called. The result of the call is
|
||||||
* returned. Helper methods are provided so that child classes may more
|
// * returned. Helper methods are provided so that child classes may more
|
||||||
* easily override behavior without resorting to overriding the
|
// * easily override behavior without resorting to overriding the
|
||||||
* ItemGestureListener methods.
|
// * ItemGestureListener methods.
|
||||||
*/
|
// */
|
||||||
@Override
|
// @Override
|
||||||
public boolean onSingleTapUp(MotionEvent event) {
|
// public boolean onSingleTapUp(MotionEvent event) {
|
||||||
return activateSelectedItems(event, mActiveItemSingleTap) || super.onSingleTapUp(event);
|
// return activateSelectedItems(event, mActiveItemSingleTap) || super.onSingleTapUp(event);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
protected boolean onSingleTapUpHelper(int index, Item item) {
|
// protected boolean onSingleTapUpHelper(int index, Item item) {
|
||||||
return this.mOnItemGestureListener.onItemSingleTapUp(index, item);
|
// return this.mOnItemGestureListener.onItemSingleTapUp(index, item);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
private final ActiveItem mActiveItemSingleTap = new ActiveItem() {
|
// private final ActiveItem mActiveItemSingleTap = new ActiveItem() {
|
||||||
@Override
|
// @Override
|
||||||
public boolean run(int index) {
|
// public boolean run(int index) {
|
||||||
final ItemizedIconLayer<Item> that = ItemizedIconLayer.this;
|
// final ItemizedIconLayer<Item> that = ItemizedIconLayer.this;
|
||||||
if (that.mOnItemGestureListener == null) {
|
// if (that.mOnItemGestureListener == null) {
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
return onSingleTapUpHelper(index, that.mItemList.get(index));
|
// return onSingleTapUpHelper(index, that.mItemList.get(index));
|
||||||
}
|
// }
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public boolean onLongPress(MotionEvent event) {
|
// public boolean onLongPress(MotionEvent event) {
|
||||||
return activateSelectedItems(event, mActiveItemLongPress) || super.onLongPress(event);
|
// return activateSelectedItems(event, mActiveItemLongPress) || super.onLongPress(event);
|
||||||
}
|
// }
|
||||||
|
|
||||||
protected boolean onLongPressHelper(int index, Item item) {
|
protected boolean onLongPressHelper(int index, Item item) {
|
||||||
return this.mOnItemGestureListener.onItemLongPress(index, item);
|
return this.mOnItemGestureListener.onItemLongPress(index, item);
|
||||||
|
@ -17,20 +17,10 @@
|
|||||||
package org.oscim.layers.marker;
|
package org.oscim.layers.marker;
|
||||||
|
|
||||||
import org.oscim.core.Point;
|
import org.oscim.core.Point;
|
||||||
import org.oscim.layers.InputLayer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
|
|
||||||
/**
|
public abstract class MarkerLayer extends Layer {
|
||||||
* Base class representing an overlay which may be displayed on top of a
|
|
||||||
* {@link Map}. To add an overlay, subclass this class, create an instance,
|
|
||||||
* and add via addOverlay() of {@link Map}.
|
|
||||||
* This class implements a form of Gesture Handling similar to
|
|
||||||
* {@link android.view.GestureDetector.SimpleOnGestureListener} and
|
|
||||||
* GestureDetector.OnGestureListener.
|
|
||||||
*
|
|
||||||
* @author Nicolas Gramlich
|
|
||||||
*/
|
|
||||||
public abstract class MarkerLayer extends InputLayer {
|
|
||||||
|
|
||||||
public MarkerLayer(Map map) {
|
public MarkerLayer(Map map) {
|
||||||
super(map);
|
super(map);
|
||||||
|
@ -16,17 +16,14 @@ package org.oscim.layers.tile.vector;
|
|||||||
|
|
||||||
import org.oscim.core.MapPosition;
|
import org.oscim.core.MapPosition;
|
||||||
import org.oscim.event.MotionEvent;
|
import org.oscim.event.MotionEvent;
|
||||||
import org.oscim.layers.InputLayer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.map.Map;
|
import org.oscim.map.Map;
|
||||||
import org.oscim.renderer.ExtrusionRenderer;
|
import org.oscim.renderer.ExtrusionRenderer;
|
||||||
import org.oscim.renderer.MapRenderer.Matrices;
|
import org.oscim.renderer.MapRenderer.Matrices;
|
||||||
import org.oscim.tiling.TileRenderer;
|
import org.oscim.tiling.TileRenderer;
|
||||||
import org.oscim.utils.FastMath;
|
import org.oscim.utils.FastMath;
|
||||||
|
|
||||||
/**
|
public class BuildingLayer extends Layer {
|
||||||
* @author Hannes Janetzek
|
|
||||||
*/
|
|
||||||
public class BuildingLayer extends InputLayer {
|
|
||||||
//private final static String TAG = BuildingOverlay.class.getName();
|
//private final static String TAG = BuildingOverlay.class.getName();
|
||||||
|
|
||||||
final ExtrusionRenderer mExtLayer;
|
final ExtrusionRenderer mExtLayer;
|
||||||
@ -81,8 +78,8 @@ public class BuildingLayer extends InputLayer {
|
|||||||
|
|
||||||
private final static int MIN_ZOOM = 17;
|
private final static int MIN_ZOOM = 17;
|
||||||
|
|
||||||
@Override
|
//@Override
|
||||||
public boolean onTouchEvent(MotionEvent e) {
|
//public boolean onTouchEvent(MotionEvent e) {
|
||||||
// int action = e.getAction() & MotionEvent.ACTION_MASK;
|
// int action = e.getAction() & MotionEvent.ACTION_MASK;
|
||||||
// if (action == MotionEvent.ACTION_POINTER_DOWN) {
|
// if (action == MotionEvent.ACTION_POINTER_DOWN) {
|
||||||
// multi++;
|
// multi++;
|
||||||
@ -101,8 +98,8 @@ public class BuildingLayer extends InputLayer {
|
|||||||
// mTimer = null;
|
// mTimer = null;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,6 @@ package org.oscim.map;
|
|||||||
import java.util.AbstractList;
|
import java.util.AbstractList;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
import org.oscim.backend.Log;
|
|
||||||
import org.oscim.core.MapPosition;
|
|
||||||
import org.oscim.event.KeyEvent;
|
|
||||||
import org.oscim.event.MotionEvent;
|
|
||||||
import org.oscim.layers.InputLayer;
|
|
||||||
import org.oscim.layers.Layer;
|
import org.oscim.layers.Layer;
|
||||||
import org.oscim.renderer.LayerRenderer;
|
import org.oscim.renderer.LayerRenderer;
|
||||||
|
|
||||||
@ -92,7 +87,7 @@ public class Layers extends AbstractList<Layer> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Layer[] mLayers;
|
Layer[] mLayers;
|
||||||
InputLayer[] mInputLayer;
|
// InputLayer[] mInputLayer;
|
||||||
|
|
||||||
private synchronized void updateLayers() {
|
private synchronized void updateLayers() {
|
||||||
if (!mDirtyLayers)
|
if (!mDirtyLayers)
|
||||||
@ -109,14 +104,14 @@ public class Layers extends AbstractList<Layer> {
|
|||||||
if (o.getRenderer() != null)
|
if (o.getRenderer() != null)
|
||||||
numRenderLayers++;
|
numRenderLayers++;
|
||||||
|
|
||||||
if (o instanceof InputLayer)
|
// if (o instanceof InputLayer)
|
||||||
numInputLayers++;
|
// numInputLayers++;
|
||||||
|
|
||||||
mLayers[i] = o;
|
mLayers[i] = o;
|
||||||
}
|
}
|
||||||
|
|
||||||
mLayerRenderer = new LayerRenderer[numRenderLayers];
|
mLayerRenderer = new LayerRenderer[numRenderLayers];
|
||||||
mInputLayer = new InputLayer[numInputLayers];
|
// mInputLayer = new InputLayer[numInputLayers];
|
||||||
|
|
||||||
for (int i = 0, cntR = 0, cntI = 1, n = mLayerList.size(); i < n; i++) {
|
for (int i = 0, cntR = 0, cntI = 1, n = mLayerList.size(); i < n; i++) {
|
||||||
Layer o = mLayerList.get(i);
|
Layer o = mLayerList.get(i);
|
||||||
@ -124,12 +119,12 @@ public class Layers extends AbstractList<Layer> {
|
|||||||
if (l != null)
|
if (l != null)
|
||||||
mLayerRenderer[cntR++] = l;
|
mLayerRenderer[cntR++] = l;
|
||||||
|
|
||||||
if (o instanceof InputLayer) {
|
// if (o instanceof InputLayer) {
|
||||||
// sort from top to bottom, so that highest layers
|
// // sort from top to bottom, so that highest layers
|
||||||
// process event first.
|
// // process event first.
|
||||||
mInputLayer[numInputLayers - cntI] = (InputLayer) o;
|
// mInputLayer[numInputLayers - cntI] = (InputLayer) o;
|
||||||
cntI++;
|
// cntI++;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
mDirtyLayers = false;
|
mDirtyLayers = false;
|
||||||
@ -137,27 +132,27 @@ public class Layers extends AbstractList<Layer> {
|
|||||||
|
|
||||||
//private boolean mCancelGesture;
|
//private boolean mCancelGesture;
|
||||||
|
|
||||||
public boolean handleMotionEvent(MotionEvent e) {
|
//public boolean handleMotionEvent(MotionEvent e) {
|
||||||
//boolean handleGesture = true;
|
// //boolean handleGesture = true;
|
||||||
|
//
|
||||||
//if (mCancelGesture) {
|
// //if (mCancelGesture) {
|
||||||
// int action = e.getAction();
|
// // int action = e.getAction();
|
||||||
// handleGesture = (action == MotionEvent.ACTION_CANCEL ||
|
// // handleGesture = (action == MotionEvent.ACTION_CANCEL ||
|
||||||
// action == MotionEvent.ACTION_UP);
|
// // action == MotionEvent.ACTION_UP);
|
||||||
//}
|
// //}
|
||||||
|
//
|
||||||
//if (handleGesture) {
|
// //if (handleGesture) {
|
||||||
// if (mGestureDetector.onTouchEvent(e))
|
// // if (mGestureDetector.onTouchEvent(e))
|
||||||
// return true;
|
// // return true;
|
||||||
//
|
// //
|
||||||
// mCancelGesture = false;
|
// // mCancelGesture = false;
|
||||||
//}
|
// //}
|
||||||
|
//
|
||||||
if (onTouchEvent(e))
|
// if (onTouchEvent(e))
|
||||||
return true;
|
// return true;
|
||||||
|
//
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
|
||||||
///**
|
///**
|
||||||
// * Call this to not foward events to generic GestureDetector until
|
// * Call this to not foward events to generic GestureDetector until
|
||||||
@ -169,52 +164,52 @@ public class Layers extends AbstractList<Layer> {
|
|||||||
// mCancelGesture = true;
|
// mCancelGesture = true;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
public boolean onTouchEvent(MotionEvent event) {
|
//public boolean onTouchEvent(MotionEvent event) {
|
||||||
if (mDirtyLayers)
|
// if (mDirtyLayers)
|
||||||
updateLayers();
|
// updateLayers();
|
||||||
|
//
|
||||||
for (InputLayer o : mInputLayer) {
|
// for (InputLayer o : mInputLayer) {
|
||||||
if (o.onTouchEvent(event)) {
|
// if (o.onTouchEvent(event)) {
|
||||||
if (debugInput)
|
// if (debugInput)
|
||||||
Log.d(TAG, "onTouch\t\t" + o.getClass());
|
// Log.d(TAG, "onTouch\t\t" + o.getClass());
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
//public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if (mDirtyLayers)
|
// if (mDirtyLayers)
|
||||||
updateLayers();
|
// updateLayers();
|
||||||
|
//
|
||||||
for (InputLayer o : mInputLayer)
|
// for (InputLayer o : mInputLayer)
|
||||||
if (o.onKeyDown(keyCode, event))
|
// if (o.onKeyDown(keyCode, event))
|
||||||
return true;
|
// return true;
|
||||||
|
//
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
//public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
if (mDirtyLayers)
|
// if (mDirtyLayers)
|
||||||
updateLayers();
|
// updateLayers();
|
||||||
|
//
|
||||||
for (InputLayer o : mInputLayer)
|
// for (InputLayer o : mInputLayer)
|
||||||
if (o.onKeyUp(keyCode, event))
|
// if (o.onKeyUp(keyCode, event))
|
||||||
return true;
|
// return true;
|
||||||
|
//
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
public boolean onTrackballEvent(MotionEvent event) {
|
//public boolean onTrackballEvent(MotionEvent event) {
|
||||||
if (mDirtyLayers)
|
// if (mDirtyLayers)
|
||||||
updateLayers();
|
// updateLayers();
|
||||||
|
//
|
||||||
for (InputLayer o : mInputLayer)
|
// for (InputLayer o : mInputLayer)
|
||||||
if (o.onTrackballEvent(event))
|
// if (o.onTrackballEvent(event))
|
||||||
return true;
|
// return true;
|
||||||
|
//
|
||||||
return false;
|
// return false;
|
||||||
}
|
//}
|
||||||
|
|
||||||
// /* GestureDetector.OnDoubleTapListener */
|
// /* GestureDetector.OnDoubleTapListener */
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user