コード例 #1
0
    public void selectRenderables(DrawContext dc, Sector vs) {
      // Select our renderables
      if (this.gridElements == null) createRenderables();

      int gridStep = (int) this.size / 10;
      boolean drawMetricLabels = getSizeInPixels(dc) > MIN_CELL_SIZE_PIXELS * 4 * 1.7;
      String graticuleType = getTypeFor(gridStep);

      for (GridElement ge : this.gridElements) {
        if (ge.isInView(dc, vs)) {
          if (drawMetricLabels)
            metricScaleSupport.computeMetricScaleExtremes(
                this.UTMZone, this.hemisphere, ge, this.size);

          addRenderable(ge.renderable, graticuleType);
        }
      }

      if (getSizeInPixels(dc) <= MIN_CELL_SIZE_PIXELS * 4 * 2) return;

      // Select sub grids renderables
      if (this.subGrids == null) createSubGrids();
      for (SquareGrid sg : this.subGrids) {
        if (sg.isInView(dc)) {
          sg.selectRenderables(dc, vs);
        } else sg.clearRenderables();
      }
    }
コード例 #2
0
 public void clearRenderables() {
   if (this.gridElements != null) {
     this.gridElements.clear();
     this.gridElements = null;
   }
   if (this.subGrids != null) {
     for (SquareGrid sg : this.subGrids) {
       sg.clearRenderables();
     }
     this.subGrids.clear();
     this.subGrids = null;
   }
 }