コード例 #1
0
ファイル: Dummy.java プロジェクト: ubdsgroup/wglobe
  @Override
  protected void applyDefaultAttributes(ShapeAttributes attributes) {
    super.applyDefaultAttributes(attributes);

    attributes.setOutlineWidth(2.0);
    attributes.setOutlineStippleFactor(15);
    attributes.setOutlineStipplePattern((short) 0xAAAA);
  }
コード例 #2
0
ファイル: SearchArea.java プロジェクト: metsci/worldwind
  /** {@inheritDoc} Overridden to update symbol attributes. */
  @Override
  protected void determineActiveAttributes() {
    super.determineActiveAttributes();

    // Apply active attributes to the symbol.
    if (this.symbolAttributes != null) {
      ShapeAttributes activeAttributes = this.getActiveShapeAttributes();
      this.symbolAttributes.setOpacity(activeAttributes.getInteriorOpacity());
      this.symbolAttributes.setScale(this.activeOverrides.getScale());
    }
  }
コード例 #3
0
    protected void addPath(RenderableLayer layer, List<Position> positions, String displayName) {
      ShapeAttributes attrs = new BasicShapeAttributes();
      attrs.setOutlineWidth(5);

      Path path = new Path(positions);
      path.setPathType(AVKey.LINEAR);
      path.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
      path.setAttributes(attrs);
      path.setValue(AVKey.DISPLAY_NAME, displayName);
      layer.addRenderable(path);

      // Show how to make the colors vary along the paths.
      path.setPositionColors(new ExamplePositionColors());
    }
コード例 #4
0
    protected void addContourShapes(
        List<List<Position>> contourList, double value, RenderableLayer layer) {
      String text = this.textForValue(value);
      Color color = this.colorForValue(value, 1.0); // color for value at 100% brightness

      ShapeAttributes attrs = new BasicShapeAttributes();
      attrs.setOutlineMaterial(new Material(color));
      attrs.setOutlineWidth(2);

      for (List<Position> positions : contourList) {
        Path path = new Path(positions);
        path.setAttributes(attrs);
        path.setAltitudeMode(WorldWind.CLAMP_TO_GROUND);
        path.setFollowTerrain(true);
        path.setValue(AVKey.DISPLAY_NAME, text);
        layer.addRenderable(path);
      }
    }
コード例 #5
0
ファイル: SearchArea.java プロジェクト: metsci/worldwind
  /** {@inheritDoc} */
  @Override
  protected void applyDefaultAttributes(ShapeAttributes attributes) {
    super.applyDefaultAttributes(attributes);

    // Enable the polygon interior for the "thick line" polygon. All other parts of the graphic are
    // drawn with Path,
    // so the draw interior setting will not affect them.
    attributes.setDrawInterior(true);
  }
コード例 #6
0
    protected void showGridSightLines(List<Position> grid, Position cPos) {
      this.sightLinesLayer.removeAllRenderables();

      // Display lines from the center to each grid point.
      ShapeAttributes lineAttributes;
      lineAttributes = new BasicShapeAttributes();
      lineAttributes.setDrawOutline(true);
      lineAttributes.setDrawInterior(false);
      lineAttributes.setOutlineMaterial(Material.GREEN);
      lineAttributes.setOutlineOpacity(0.6);

      for (Position p : grid) {
        List<Position> endPoints = new ArrayList<Position>();
        endPoints.add(cPos);
        endPoints.add(new Position(p.getLatitude(), p.getLongitude(), 0));

        Path path = new Path(endPoints);
        path.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
        path.setAttributes(lineAttributes);
        this.sightLinesLayer.addRenderable(path);
      }
    }
コード例 #7
0
    protected void showSightLines(List<Position[]> sightLines) {
      this.sightLinesLayer.removeAllRenderables();

      // Display the sight lines as green lines.
      ShapeAttributes lineAttributes;
      lineAttributes = new BasicShapeAttributes();
      lineAttributes.setDrawOutline(true);
      lineAttributes.setDrawInterior(false);
      lineAttributes.setOutlineMaterial(Material.GREEN);
      lineAttributes.setOutlineOpacity(0.6);

      for (Position[] pp : sightLines) {
        List<Position> endPoints = new ArrayList<Position>();
        endPoints.add(pp[0]);
        endPoints.add(pp[1]);

        Path path = new Path(endPoints);
        path.setAltitudeMode(WorldWind.RELATIVE_TO_GROUND);
        path.setAttributes(lineAttributes);
        this.sightLinesLayer.addRenderable(path);
      }
    }