예제 #1
0
  public void render(DrawContext dc, String text, int x, int y) {
    if (dc == null) {
      String message = Logging.getMessage("nullValue.DrawContextIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    if (text == null) {
      String message = Logging.getMessage("nullValue.StringIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    this.doRender(dc, text, x, y);
  }
예제 #2
0
    public boolean accept(File file) {
      if (file == null) {
        String message = Logging.getMessage("nullValue.FileIsNull");
        Logging.logger().severe(message);
        throw new IllegalArgumentException(message);
      }

      return file.isDirectory() || this.filter.accept(file);
    }
예제 #3
0
  public void setTextColor(Color color) {
    if (color == null) {
      String message = Logging.getMessage("nullValue.ColorIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    this.textColor = color;
  }
예제 #4
0
  public void setFont(java.awt.Font font) {
    if (font == null) {
      String message = Logging.getMessage("nullValue.FontIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    this.font = font;
  }
예제 #5
0
  public void setOutlineWidth(double width) {
    if (width < 0) {
      String message = Logging.getMessage("generic.ArgumentOutOfRange", "width < 0");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    this.outlineWidth = width;
  }
예제 #6
0
  public void setInsets(java.awt.Insets insets) {
    if (insets == null) {
      String message = Logging.getMessage("nullValue.InsetsIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    // Class java.awt.Insets is known to override the method Object.clone().
    this.insets = (java.awt.Insets) insets.clone();
  }
예제 #7
0
  public void setOpacity(double opacity) {
    if (opacity < 0 || opacity > 1) {
      String message =
          Logging.getMessage("generic.ArgumentOutOfRange", "opacity < 0 or opacity > 1");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    this.opacity = opacity;
  }
예제 #8
0
  protected void endRendering(DrawContext dc, OGLStackHandler stackHandler) {
    if (dc == null) {
      String message = Logging.getMessage("nullValue.DrawContextIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    GL2 gl = dc.getGL();

    stackHandler.pop(gl);
  }
예제 #9
0
  public ToolTipRenderer(java.awt.Font font) {
    if (font == null) {
      String message = Logging.getMessage("nullValue.FontIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    this.useSystemLookAndFeel = false;
    this.font = font;
    this.textColor = java.awt.Color.WHITE;
    this.interiorColor = java.awt.Color.BLACK;
    this.outlineColor = java.awt.Color.WHITE;
    this.outlineWidth = 1;
    this.opacity = 1;
    this.insets = new java.awt.Insets(1, 1, 1, 1);
  }
    public void doActionOnButton4() {
      ArrayList<LatLon> locations = new ArrayList<LatLon>();

      locations.add(LatLon.fromDegrees(45.50d, -123.3d));
      locations.add(LatLon.fromDegrees(45.52d, -123.3d));
      locations.add(LatLon.fromDegrees(45.54d, -123.3d));
      locations.add(LatLon.fromDegrees(45.56d, -123.3d));
      locations.add(LatLon.fromDegrees(45.58d, -123.3d));
      locations.add(LatLon.fromDegrees(45.60d, -123.3d));

      locations.add(LatLon.fromDegrees(40.50d, -120.1d));
      locations.add(LatLon.fromDegrees(40.52d, -120.2d));
      locations.add(LatLon.fromDegrees(40.54d, -120.3d));
      locations.add(LatLon.fromDegrees(40.56d, -120.4d));
      locations.add(LatLon.fromDegrees(40.58d, -120.5d));
      locations.add(LatLon.fromDegrees(40.60d, -120.6d));

      // Now, let's find WMSBasicElevationModel
      WMSBasicElevationModel wmsbem = null;

      ElevationModel model = this.wwd.getModel().getGlobe().getElevationModel();
      if (model instanceof CompoundElevationModel) {
        CompoundElevationModel cbem = (CompoundElevationModel) model;
        for (ElevationModel em : cbem.getElevationModels()) {
          // you can have additional checks if you know specific model name, etc.
          if (em instanceof WMSBasicElevationModel) {
            wmsbem = (WMSBasicElevationModel) em;
            break;
          }
        }
      } else if (model instanceof WMSBasicElevationModel) {
        wmsbem = (WMSBasicElevationModel) model;
      }

      if (null != wmsbem) {
        ElevationsRetriever retriever =
            new ElevationsRetriever(wmsbem, locations, 10000, 30000, new NotifyWhenReady());
        retriever.start();
      } else {
        String message =
            Logging.getMessage(
                "ElevationModel.ExceptionRequestingElevations",
                "No instance of WMSBasicElevationModel was found");
        Logging.logger().severe(message);
      }
    }
예제 #11
0
  protected void beginRendering(DrawContext dc, OGLStackHandler stackHandler) {
    if (dc == null) {
      String message = Logging.getMessage("nullValue.DrawContextIsNull");
      Logging.logger().fine(message);
      throw new IllegalArgumentException(message);
    }

    GL2 gl = dc.getGL();

    int attribMask =
        GL2.GL_COLOR_BUFFER_BIT // for alpha test func and ref, blend func
            | GL2.GL_CURRENT_BIT // for current color
            | GL2.GL_ENABLE_BIT // for enable/disable
            | GL2.GL_LINE_BIT // for line width
            | GL2.GL_TRANSFORM_BIT; // for matrix mode
    stackHandler.pushAttrib(gl, attribMask);

    stackHandler.pushTextureIdentity(gl);
    stackHandler.pushProjectionIdentity(gl);
    java.awt.Rectangle viewport = dc.getView().getViewport();
    gl.glOrtho(
        viewport.x, viewport.x + viewport.width, viewport.y, viewport.y + viewport.height, -1, 1);
    stackHandler.pushModelviewIdentity(gl);

    // Enable the alpha test.
    gl.glEnable(GL2.GL_ALPHA_TEST);
    gl.glAlphaFunc(GL2.GL_GREATER, 0.0f);

    // Enable blending in premultiplied color mode.
    gl.glEnable(GL2.GL_BLEND);
    OGLUtil.applyBlending(gl, true);

    gl.glDisable(GL2.GL_CULL_FACE);
    gl.glDisable(GL2.GL_DEPTH_TEST);
    gl.glDisable(GL2.GL_LIGHTING);
    gl.glDisable(GL2.GL_TEXTURE_2D);
  }
 public void onError(String error) {
   String message = Logging.getMessage("ElevationModel.ExceptionRequestingElevations", error);
   Logging.logger().severe(message);
 }