Class UserFacingIcon

    • Constructor Detail

      • UserFacingIcon

        public UserFacingIcon()
      • UserFacingIcon

        public UserFacingIcon​(java.lang.String iconPath,
                              Position iconPosition)
      • UserFacingIcon

        public UserFacingIcon​(java.lang.Object imageSource,
                              Position iconPosition)
    • Method Detail

      • getBackgroundTexture

        public BasicWWTexture getBackgroundTexture()
        Description copied from interface: WWIcon
        Returns the WWTexture used to represent the icon's background texture.
        Specified by:
        getBackgroundTexture in interface WWIcon
        Returns:
        the icon's background texture.
      • getImageSource

        public java.lang.Object getImageSource()
        Description copied from interface: WWIcon
        Returns the icon's image source.
        Specified by:
        getImageSource in interface WWIcon
        Returns:
        the icon's image source.
      • setImageSource

        public void setImageSource​(java.lang.Object imageSource)
        Description copied from interface: WWIcon
        Specifies the source image for the icon. Implementations of this interface determine the allowed source types, but generally allow at least a String file path and a BufferedImage.
        Specified by:
        setImageSource in interface WWIcon
        Parameters:
        imageSource - the image source.
      • getPath

        public java.lang.String getPath()
      • getPosition

        public Position getPosition()
        Description copied from interface: WWIcon
        Returns the icon's geographic position.
        Specified by:
        getPosition in interface WWIcon
        Returns:
        the icon's geographic position.
      • setPosition

        public void setPosition​(Position iconPosition)
        Description copied from interface: WWIcon
        Sets the icon's geographic position.
        Specified by:
        setPosition in interface WWIcon
        Parameters:
        iconPosition - the icon's geographic position. May be null to indicate that the icon has no current position and therefore should not be displayed.
      • isHighlighted

        public boolean isHighlighted()
        Description copied from interface: WWIcon
        Indicates whether the icon should be drawn in its highlighted state. The representation of the highlighted state is implementation dependent.
        Specified by:
        isHighlighted in interface WWIcon
        Returns:
        true if the icon should be rendered as highlighted, otherwise false.
      • setHighlighted

        public void setHighlighted​(boolean highlighted)
        Description copied from interface: WWIcon
        Specifies whether the icon should be drawn in its highlighted state. The representation of the highlighted state is implementation dependent.
        Specified by:
        setHighlighted in interface WWIcon
        Parameters:
        highlighted - true if the icon should be rendered as highlighted, otherwise false.
      • getHighlightScale

        public double getHighlightScale()
        Returns the icon's highlight scale, which indicates the degree of expansion or shrinkage applied to the icon when it's drawn in its highlighted state.
        Specified by:
        getHighlightScale in interface WWIcon
        Returns:
        the icon's highlight scale. The default scale is 1.2.
      • setHighlightScale

        public void setHighlightScale​(double highlightScale)
        Description copied from interface: WWIcon
        Specifies the relative screen size of the icon when it's highlighted. The scale indicates the degree of expansion or shrinkage from the icon's base size.
        Specified by:
        setHighlightScale in interface WWIcon
        Parameters:
        highlightScale - the highlight scale.
      • getSize

        public java.awt.Dimension getSize()
        Description copied from interface: WWIcon
        Returns the icon's specified screen size.
        Specified by:
        getSize in interface WWIcon
        Returns:
        the icon's specified screen size. The default value is false.
        See Also:
        WWIcon.setSize(java.awt.Dimension)
      • setSize

        public void setSize​(java.awt.Dimension size)
        Description copied from interface: WWIcon
        Sets the desired screen size of the icon. When rendered, the icon is scaled to this size if it's specified. If a screen size is not specified, the icon is displayed at the size of its source image.

        This size is not related to the icon's image source size. Whatever the source size is, it's scaled to display at the specified screen size, if any.

        Specified by:
        setSize in interface WWIcon
        Parameters:
        size - the desired screen size, or null if the icon should be displayed at its source image size.
      • isVisible

        public boolean isVisible()
        Description copied from interface: WWIcon
        Returns the state of the visibility flag.
        Specified by:
        isVisible in interface WWIcon
        Returns:
        the visibility flag. The default value is true.
      • setVisible

        public void setVisible​(boolean visible)
        Description copied from interface: WWIcon
        Specifies whether the icon is drawn.
        Specified by:
        setVisible in interface WWIcon
        Parameters:
        visible - true if the icon is drawn, otherwise false. The default is true.
      • getToolTipText

        public java.lang.String getToolTipText()
        Description copied from interface: WWIcon
        Returns the icon's current tool tip text.
        Specified by:
        getToolTipText in interface WWIcon
        Returns:
        the current tool tip text.
      • setToolTipText

        public void setToolTipText​(java.lang.String toolTipText)
        Description copied from interface: WWIcon
        Specifies the text string to display as the icon's tool tip.
        Specified by:
        setToolTipText in interface WWIcon
        Parameters:
        toolTipText - the tool tip text. May be null, the default, to indicate no tool tip is displaye.
      • getToolTipFont

        public java.awt.Font getToolTipFont()
        Description copied from interface: WWIcon
        Returns the font used to render an icon's tool tip, if any.
        Specified by:
        getToolTipFont in interface WWIcon
        Returns:
        the tool tip font. The default is null.
      • setToolTipFont

        public void setToolTipFont​(java.awt.Font toolTipFont)
        Description copied from interface: WWIcon
        Specifies the font to use when displaying the icon's tool tip, if any.
        Specified by:
        setToolTipFont in interface WWIcon
        Parameters:
        toolTipFont - the tool tip font. If null, an implementation dependent font is used.
      • getToolTipOffset

        public Vec4 getToolTipOffset()
        Description copied from interface: WWIcon
        Indicates the offset in screen coordinates at which to place the lower left corner of the icon tool tip's text box. If the offset is null, the tool tip is drawn at the icon's position.
        Specified by:
        getToolTipOffset in interface WWIcon
        Returns:
        the tool tip offset. The default is null.
      • setToolTipOffset

        public void setToolTipOffset​(Vec4 toolTipOffset)
        Description copied from interface: WWIcon
        Indicates the offset in screen coordinates at which to place the lower left corner of the icon tool tip's text box. If the offset is null, the tool tip is drawn at the icon's position.
        Specified by:
        setToolTipOffset in interface WWIcon
        Parameters:
        toolTipOffset - the tool tip offset. The default is null.
      • isShowToolTip

        public boolean isShowToolTip()
        Description copied from interface: WWIcon
        Indicates whether the icon's tool tip, if any, is displayed with the icon.
        Specified by:
        isShowToolTip in interface WWIcon
        Returns:
        true if the tool tip is displayed when the icon is rendered, otherwise false, the default.
      • setShowToolTip

        public void setShowToolTip​(boolean showToolTip)
        Description copied from interface: WWIcon
        Indicates whether the icon's tool tip, if any, is displayed with the icon.
        Specified by:
        setShowToolTip in interface WWIcon
        Parameters:
        showToolTip - true if the tool tip is displayed when the icon is rendered, otherwise false, the default.
      • getToolTipTextColor

        public java.awt.Color getToolTipTextColor()
        Description copied from interface: WWIcon
        Indicates the color in which the icon's tool tip, if any, is drawn.
        Specified by:
        getToolTipTextColor in interface WWIcon
        Returns:
        the tool tip's text color. The default value is null, in which case an implementation dependent color is used.
      • setToolTipTextColor

        public void setToolTipTextColor​(java.awt.Color textColor)
        Description copied from interface: WWIcon
        Specifies the color in which to display the icon's tool tip text, if any.
        Specified by:
        setToolTipTextColor in interface WWIcon
        Parameters:
        textColor - the tool tip text color. The default is null, in which case an implementation dependent color is used.
      • isAlwaysOnTop

        public boolean isAlwaysOnTop()
        Description copied from interface: WWIcon
        Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.
        Specified by:
        isAlwaysOnTop in interface WWIcon
        Returns:
        true if the icon has visual priority, otherwise false, the default.
      • setAlwaysOnTop

        public void setAlwaysOnTop​(boolean alwaysOnTop)
        Description copied from interface: WWIcon
        Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.
        Specified by:
        setAlwaysOnTop in interface WWIcon
        Parameters:
        alwaysOnTop - true if the icon has visual priority, otherwise false, the default.
      • getBackgroundImage

        public java.lang.Object getBackgroundImage()
        Description copied from interface: WWIcon
        Returns the icon's background image source, if any.
        Specified by:
        getBackgroundImage in interface WWIcon
        Returns:
        the icon's background image source. The default is null.
      • setBackgroundImage

        public void setBackgroundImage​(java.lang.Object background)
        Description copied from interface: WWIcon
        Specifies the icon's background image source. If non-null, the image is displayed centered and behind the icon.
        Specified by:
        setBackgroundImage in interface WWIcon
        Parameters:
        background - the background image source. The default is null.
      • getBackgroundScale

        public double getBackgroundScale()
        Description copied from interface: WWIcon
        Indicates the relative screen size of the background image, if specified. The scale indicates the degree of expansion or shrinkage from the image's source size.
        Specified by:
        getBackgroundScale in interface WWIcon
        Returns:
        the background image scale.
      • setBackgroundScale

        public void setBackgroundScale​(double backgroundScale)
        Description copied from interface: WWIcon
        Indicates the relative screen size of the background image, if specified. The scale indicates the degree of expansion or shrinkage from the image's source size.
        Specified by:
        setBackgroundScale in interface WWIcon
        Parameters:
        backgroundScale - the background image scale.
      • move

        public void move​(Position position)
        Description copied from interface: Movable
        Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
        Specified by:
        move in interface Movable
        Parameters:
        position - the latitude and longitude to add to the shape's reference position.
      • moveTo

        public void moveTo​(Position position)
        Description copied from interface: Movable
        Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
        Specified by:
        moveTo in interface Movable
        Parameters:
        position - the new position of the shape's reference position.
      • getReferencePosition

        public Position getReferencePosition()
        Description copied from interface: Movable
        A position associated with the object that indicates its aggregate geographic position. The chosen position varies among implementers of this interface. For objects defined by a list of positions, the reference position is typically the first position in the list. For symmetric objects the reference position is often the center of the object. In many cases the object's reference position may be explicitly specified by the application.
        Specified by:
        getReferencePosition in interface Movable
        Returns:
        the object's reference position, or null if no reference position is available.
      • isDragEnabled

        public boolean isDragEnabled()
        Description copied from interface: Draggable
        Indicates whether the object is enabled for dragging.
        Specified by:
        isDragEnabled in interface Draggable
        Returns:
        true if the object is enabled, else false.
      • setDragEnabled

        public void setDragEnabled​(boolean enabled)
        Description copied from interface: Draggable
        Controls whether the object is enabled for dragging.
        Specified by:
        setDragEnabled in interface Draggable
        Parameters:
        enabled - true if the object is enabled, else false.
      • doDrag

        protected void doDrag​(DragContext dragContext)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getRestorableState

        public java.lang.String getRestorableState()
        Returns an XML state document String describing the public attributes of this UserFacingIcon.
        Specified by:
        getRestorableState in interface Restorable
        Returns:
        XML state document string describing this UserFacingIcon.
      • 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
        Parameters:
        stateInXml - an XML document String describing a UserFacingIcon.
        Throws:
        java.lang.IllegalArgumentException - If stateInXml is null, or if stateInXml is not a well formed XML document String.