Class AbstractAnnotationBalloon

    • Constructor Detail

      • AbstractAnnotationBalloon

        public AbstractAnnotationBalloon​(java.lang.String text)
        Create a new annotation balloon.
        Parameters:
        text - Balloon text. May not be null.
    • Method Detail

      • getBounds

        public java.awt.Rectangle getBounds​(DrawContext dc)
        Get the balloon bounding Rectangle using OGL coordinates - bottom-left corner x and y relative to the WorldWindow bottom-left corner, and the balloon callout width and height.

        The balloon offset from it's reference point is factored in such that the callout leader shape and reference point are included in the bounding rectangle.

        Parameters:
        dc - the current DrawContext.
        Returns:
        the balloon bounding Rectangle using OGL viewport coordinates.
      • createAnnotation

        protected abstract Annotation createAnnotation()
        Create an annotation to render the balloon.
        Returns:
        The new annotation.
      • getAnnotation

        protected abstract Annotation getAnnotation()
        Get the annotation used to render the balloon.
        Returns:
        The annotation that renders this balloon.
      • computePosition

        protected abstract void computePosition​(DrawContext dc)
        Compute the annotation position, and set it in the annotation.
        Parameters:
        dc - Draw context.
      • render

        public void render​(DrawContext dc)
        Causes this Renderable to render itself using the provided draw context.
        Parameters:
        dc - the DrawContext to be used
        See Also:
        DrawContext
      • applyAttributesToAnnotation

        protected void applyAttributesToAnnotation()
        Apply the balloon attributes to the annotation.
      • computeOffsets

        protected void computeOffsets​(DrawContext dc)
        Compute the position and offsets, and set in them in the annotation.
        Parameters:
        dc - DrawContext in which the balloon is being rendered.