@Override public void dispatch(MapsLoadedEvent event) { MapOptions mapOptions = MapOptions.newInstance(); mapOptions.center(LatLng.newInstance(42.163403, -82.900772)); mapOptions.zoom(11); mapOptions.roadmap(); map = Map.newInstance(mapPlace, mapOptions); addClickListener(map, firePositionChange); switch (modeHolder.mode()) { case NEW: // fall through case LAST: // fall through case UPDATED: if (pendingPoint != null) { dispatch(pendingPoint); pendingPoint = null; } if (pendingLevel != null) { dispatch(pendingLevel); pendingLevel = null; } break; case LIST: if (pendingOverview != null) { dispatch(pendingOverview); pendingOverview = null; } break; default: throw new RuntimeException("mode not supported: " + modeHolder.mode()); } }
@Override public void call(LatLng latLng) { switch (modeHolder.mode()) { case NEW: // fall through case LAST: // fall through case UPDATED: firePositionChange(latLng); break; case LIST: break; default: throw new RuntimeException("mode not supported: " + modeHolder.mode()); } }
@Override public void dispatch(ModeEvent event) { switch (modeHolder.mode()) { case NEW: detachOverview(); break; case LAST: // fall through case UPDATED: detachOverview(); attachCurrentHum(); break; case LIST: break; default: throw new RuntimeException("mode not supported: " + modeHolder.mode()); } }