public long getNavigatorStoppedDelay() { return this.navigatorEvents.getNavigatorStoppedDelay(); }
@Override public boolean handleMessage(Message msg) { onNavigatorStopped(); return false; } });
public void setNavigatorStoppedDelay(long delay, TimeUnit unit) { this.navigatorEvents.setNavigatorStoppedDelay(delay, unit); }
protected void onNavigatorStopped() { this.notifyListeners(WorldWind.NAVIGATOR_STOPPED, this.stopTouchEvent); if (this.stopTouchEvent != null) { this.stopTouchEvent.recycle(); this.stopTouchEvent = null; } }
public void removeNavigatorListener(NavigatorListener listener) { if (listener == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "WorldWindow", "removeNavigatorListener", "missingListener")); } this.navigatorEvents.removeNavigatorListener(listener); }
public void addNavigatorListener(NavigatorListener listener) { if (listener == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "WorldWindow", "addNavigatorListener", "missingListener")); } this.navigatorEvents.addNavigatorListener(listener); }
public void onFrameRendered(RenderContext rc) { if (this.listeners.isEmpty()) { return; // no listeners to notify; ignore the event } if (this.lastModelview == null) { // this is the first frame; copy the frame's modelview this.lastModelview = new Matrix4(rc.modelview); } else if (!this.lastModelview.equals(rc.modelview)) { // the frame's modelview has changed this.lastModelview.set(rc.modelview); // Notify the listeners of a navigator moved event. this.onNavigatorMoved(); // Schedule a navigator stopped event after a specified delay in milliseconds. this.stopHandler.removeMessages(0 /*what*/); this.stopHandler.sendEmptyMessageDelayed(0 /*what*/, this.stoppedEventDelay); } }
@Override public boolean onTouchEvent(MotionEvent event) { // Give the superclass first opportunity to handle the event. if (super.onTouchEvent(event)) { return true; } // Give the WorldWindow's controller an opportunity to handle the event try { if (this.worldWindowController.onTouchEvent(event)) { this.navigatorEvents.onTouchEvent(event); } } catch (Exception e) { Logger.logMessage(Logger.ERROR, "WorldWindow", "onTouchEvent", "Exception while handling touch event \'" + event + "\'", e); } // Always return true indicating that the event was handled, otherwise Android suppresses subsequent events. return true; }
/** * Resets this WorldWindow to its initial internal state. */ protected void reset() { // Reset any state associated with navigator events. this.navigatorEvents.reset(); // Clear the render resource cache; it's entries are now invalid. this.renderResourceCache.clear(); // Clear the viewport dimensions. this.viewport.setEmpty(); // Clear the frame queue and recycle pending frames back into the frame pool. this.clearFrameQueue(); // Cancel any outstanding request redraw messages. Choreographer.getInstance().removeFrameCallback(this); this.mainThreadHandler.removeMessages(MSG_ID_REQUEST_REDRAW /*msg.what*/); this.isWaitingForRedraw = false; }
this.navigatorEvents.onFrameRendered(this.rc);
protected void onNavigatorMoved() { this.notifyListeners(WorldWind.NAVIGATOR_MOVED, this.lastTouchEvent); if (this.lastTouchEvent != null) { if (this.stopTouchEvent != null) { this.stopTouchEvent.recycle(); } this.stopTouchEvent = this.lastTouchEvent; this.lastTouchEvent = null; } }