コード例 #1
0
  @Override
  public synchronized void initialize() {
    astroSources.clear();
    Log.d("RLP", "RLP this is initialization in Abstract source layer");
    initializeAstroSources(astroSources);

    for (AstronomicalSource astroSource : astroSources) {
      Sources sources = astroSource.initialize();
      textSources.addAll(sources.getLabels());
      imageSources.addAll(sources.getImages());
      pointSources.addAll(sources.getPoints());
      lineSources.addAll(sources.getLines());

      List<String> names = astroSource.getNames();
      if (!names.isEmpty()) {
        GeocentricCoordinates searchLoc = astroSource.getSearchLocation();
        for (String name : names) {
          searchIndex.put(name.toLowerCase(), new SearchResult(name, searchLoc));
          prefixStore.add(name.toLowerCase());
        }
      }
    }

    // update the renderer
    updateLayerForControllerChange();
  }
コード例 #2
0
  /**
   * Redraws the sources on this layer, after first refreshing them based on the current state of
   * the {@link com.google.android.stardroid.control.AstronomerModel}.
   */
  protected synchronized void refreshSources(EnumSet<UpdateType> updateTypes) {
    for (AstronomicalSource astroSource : astroSources) {
      updateTypes.addAll(astroSource.update());
    }

    if (!updateTypes.isEmpty()) {
      redraw(updateTypes);
    }
  }