/** * Performs a pick at the tap location and conditionally arms the dragging flag, so that dragging can occur if * the next event is an onScroll event. */ public void pick(MotionEvent event) { // Perform the pick at the screen x, y PickedObjectList pickList = getWorldWindow().pick(event.getX(), event.getY()); // Examine the picked objects for Renderables PickedObject topPickedObject = pickList.topPickedObject(); // There is only one placemark on the globe and this.isDraggingArmed = topPickedObject != null && topPickedObject.getUserObject() instanceof Placemark; }
/** * Performs a pick at the tap location. */ public void pick(MotionEvent event) { // Forget our last picked object this.pickedObject = null; // Perform a new pick at the screen x, y PickedObjectList pickList = getWorldWindow().pick(event.getX(), event.getY()); // Get the top-most object for our new picked object PickedObject topPickedObject = pickList.topPickedObject(); if (topPickedObject != null) { this.pickedObject = topPickedObject.getUserObject(); } }
/** * Performs a pick at the tap location. */ public void pick(MotionEvent event) { // Forget our last picked object this.pickedObject = null; // Perform a new pick at the screen x, y PickedObjectList pickList = getWorldWindow().pick(event.getX(), event.getY()); // Get the top-most object for our new picked object PickedObject topPickedObject = pickList.topPickedObject(); if (topPickedObject != null) { this.pickedObject = topPickedObject.getUserObject(); } }
/** * Performs a pick at the tap location and conditionally arms the dragging flag, so that dragging can occur if * the next event is an onScroll event. */ public void pick(MotionEvent event) { // Reset our last picked object this.pickedObject = null; // Perform the pick at the screen x, y PickedObjectList pickList = getWorldWindow().pick(event.getX(), event.getY()); // Examine the picked objects for Renderables PickedObject topPickedObject = pickList.topPickedObject(); if (topPickedObject != null) { if (topPickedObject.getUserObject() instanceof Renderable) { this.pickedObject = (Renderable) topPickedObject.getUserObject(); } } // Determine whether the dragging flag should be "armed". The prerequisite for dragging that an object must // have been previously selected (via a single tap) and the selected object must manifest a "movable" // capability. this.isDraggingArmed = (this.pickedObject != null) && (this.selectedObject == this.pickedObject) && (this.selectedObject.hasUserProperty(MOVABLE)); }