Class ScreenAnnotation

    • Field Detail

      • screenPoint

        protected java.awt.Point screenPoint
    • Constructor Detail

      • ScreenAnnotation

        public ScreenAnnotation​(java.lang.String text,
                                java.awt.Point position)
        Creates a ScreenAnnotation with the given text, at the given viewport position.
        Parameters:
        text - the annotation text.
        position - the annotation viewport position.
      • ScreenAnnotation

        public ScreenAnnotation​(java.lang.String text,
                                java.awt.Point position,
                                java.awt.Font font)
        Creates a ScreenAnnotation with the given text, at the given viewport position. Specifiy the Font to be used.
        Parameters:
        text - the annotation text.
        position - the annotation viewport position.
        font - the Font to use.
      • ScreenAnnotation

        public ScreenAnnotation​(java.lang.String text,
                                java.awt.Point position,
                                java.awt.Font font,
                                java.awt.Color textColor)
        Creates a ScreenAnnotation with the given text, at the given viewport position. Specifiy the Font and text Color to be used.
        Parameters:
        text - the annotation text.
        position - the annotation viewport position.
        font - the Font to use.
        textColor - the text Color.
      • ScreenAnnotation

        public ScreenAnnotation​(java.lang.String text,
                                java.awt.Point position,
                                AnnotationAttributes defaults)
        Creates a ScreenAnnotation with the given text, at the given viewport position. Specify the default AnnotationAttributes set.
        Parameters:
        text - the annotation text.
        position - the annotation viewport position.
        defaults - the default AnnotationAttributes set.
    • Method Detail

      • getScreenPoint

        public java.awt.Point getScreenPoint()
        Get the Point where the annotation is drawn in the viewport.
        Returns:
        the Point where the annotation is drawn in the viewport.
      • getScreenPoint

        protected java.awt.Point getScreenPoint​(DrawContext dc)
        Get the Point where the annotation is drawn in the viewport.
        Parameters:
        dc - the current draw context.
        Returns:
        the Point where the annotation is drawn in the viewport.
      • computeAnnotationPosition

        protected java.awt.Point computeAnnotationPosition​(DrawContext dc,
                                                           Position pos)
      • setScreenPoint

        public void setScreenPoint​(java.awt.Point position)
        Set the Point where the annotation will be drawn in the viewport.
        Parameters:
        position - the Point where the annotation will be drawn in the viewport.
      • setPosition

        public void setPosition​(Position position)
        Specifies an optional geographic position that is mapped to a screen position during rendering. This value overrides this object's screen point and computes it anew each time this annotation is drawn.
        Parameters:
        position - This annotation's geographic position. May be null, in which case this annotation's screen point is used directly.
        See Also:
        setScreenPoint(java.awt.Point)
      • computeSize

        protected java.awt.Point computeSize​(DrawContext dc)
      • computeOffset

        protected double[] computeOffset​(DrawContext dc)
      • getRestorableState

        public java.lang.String getRestorableState()
        Returns an XML state document String describing the public attributes of this ScreenAnnotation.
        Specified by:
        getRestorableState in interface Restorable
        Overrides:
        getRestorableState in class AbstractAnnotation
        Returns:
        XML state document string describing this ScreenAnnotation.
      • restoreState

        public void restoreState​(java.lang.String stateInXml)
        Restores publicly settable attribute values found in the specified XML state document String. The document specified by stateInXml must be a well formed XML document String, or this will throw an IllegalArgumentException. Unknown structures in stateInXml are benign, because they will simply be ignored.
        Specified by:
        restoreState in interface Restorable
        Overrides:
        restoreState in class AbstractAnnotation
        Parameters:
        stateInXml - an XML document String describing a ScreenAnnotation.
        Throws:
        java.lang.IllegalArgumentException - If stateInXml is null, or if stateInXml is not a well formed XML document String.