Пример #1
0
  public void draw(DrawWindow dw) {
    dw.setFill(true);
    dw.setColor(Color.argb(100, 0, 200, 0));
    dw.drawCircle(RADIUS, RADIUS, RADIUS);

    float scale = range / RADIUS;

    // TODO:these should also be ordered.

    for (Placemark pm : state.getLayer().getZOrderedPlacemarks()) {
      float x = pm.obj.location.x / scale;
      float y = pm.obj.location.z / scale;

      if (x * x + y * y < RADIUS * RADIUS && pm.xmlShowInRadar) {
        dw.setFill(true);
        dw.setColor(Color.rgb(0, 255, 0));
        dw.drawRectangle(x + RADIUS - 1, y + RADIUS - 1, 2, 2);
      }
    }
  }