protected void transformBackgroundImageCoordsToAnnotationCoords(
      DrawContext dc, int width, int height, WWTexture texture) {
    GL2 gl = dc.getGL().getGL2(); // GL initialization checks for GL2 compatibility.

    // Scale background image coordinates to fit the Annotation's dimensions.
    java.awt.Dimension size = this.getImageSize(dc);
    if (size != null) {
      gl.glScaled(size.getWidth() / (double) width, size.getHeight() / (double) height, 1d);
    }

    super.transformBackgroundImageCoordsToAnnotationCoords(dc, width, height, texture);
  }
  protected void drawToolTip(DrawContext dc) {
    if (dc.isPickingMode()) return;

    if (!this.isShowToolTip()) return;

    String text = this.getToolTipText();
    if (text == null) return;

    java.awt.Point point = this.getToolTipPoint();
    if (point == null) return;

    this.doDrawToolTip(dc, text, point.x, point.y);
  }
  protected void applyBackgroundTextureState(
      DrawContext dc, int width, int height, double opacity, WWTexture texture) {
    super.applyBackgroundTextureState(dc, width, height, opacity, texture);

    // Setup the texture filters to correspond to the smoothing and mipmap settings.
    int minFilter =
        this.isEnableSmoothing()
            ? (this.isUseMipmaps() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR)
            : GL.GL_NEAREST;
    int magFilter = this.isEnableSmoothing() ? GL.GL_LINEAR : GL.GL_NEAREST;

    GL gl = dc.getGL();
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, minFilter);
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, magFilter);
  }
 protected void doDrawToolTip(DrawContext dc, String text, int x, int y) {
   ToolTip toolTip = new ToolTip(text, x, y);
   dc.addOrderedRenderable(toolTip);
 }