Package gov.nasa.worldwind.render
Interface WWIcon
-
- All Superinterfaces:
AVList,Restorable
- All Known Implementing Classes:
Pedestal,UserFacingIcon
public interface WWIcon extends AVList, Restorable
Provides a general interface for icons rendered by WorldWind. Icons have a source image and optionally a background image. They may also have an associated tool tip. An icon has a geographic position. The indication of that position is determined by implementations. The simplest implementation is to center the icon at the position, but association by leader lines and other mechanisms are appropriate.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetBackgroundImage()Returns the icon's background image source, if any.doublegetBackgroundScale()Indicates the relative screen size of the background image, if specified.BasicWWTexturegetBackgroundTexture()Returns theWWTextureused to represent the icon's background texture.doublegetHighlightScale()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.java.lang.ObjectgetImageSource()Returns the icon's image source.BasicWWTexturegetImageTexture()Returns theWWTextureused to represent the icon.PositiongetPosition()Returns the icon's geographic position.java.awt.DimensiongetSize()Returns the icon's specified screen size.java.awt.FontgetToolTipFont()Returns the font used to render an icon's tool tip, if any.Vec4getToolTipOffset()Indicates the offset in screen coordinates at which to place the lower left corner of the icon tool tip's text box.java.lang.StringgetToolTipText()Returns the icon's current tool tip text.java.awt.ColorgetToolTipTextColor()Indicates the color in which the icon's tool tip, if any, is drawn.booleanisAlwaysOnTop()Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.booleanisHighlighted()Indicates whether the icon should be drawn in its highlighted state.booleanisShowToolTip()Indicates whether the icon's tool tip, if any, is displayed with the icon.booleanisVisible()Returns the state of the visibility flag.voidsetAlwaysOnTop(boolean alwaysOnTop)Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.voidsetBackgroundImage(java.lang.Object background)Specifies the icon's background image source.voidsetBackgroundScale(double backgroundScale)Indicates the relative screen size of the background image, if specified.voidsetHighlighted(boolean highlighted)Specifies whether the icon should be drawn in its highlighted state.voidsetHighlightScale(double highlightScale)Specifies the relative screen size of the icon when it's highlighted.voidsetImageSource(java.lang.Object imageSource)Specifies the source image for the icon.voidsetPosition(Position iconPosition)Sets the icon's geographic position.voidsetShowToolTip(boolean showToolTip)Indicates whether the icon's tool tip, if any, is displayed with the icon.voidsetSize(java.awt.Dimension size)Sets the desired screen size of the icon.voidsetToolTipFont(java.awt.Font toolTipFont)Specifies the font to use when displaying the icon's tool tip, if any.voidsetToolTipOffset(Vec4 toolTipOffset)Indicates the offset in screen coordinates at which to place the lower left corner of the icon tool tip's text box.voidsetToolTipText(java.lang.String toolTipText)Specifies the text string to display as the icon's tool tip.voidsetToolTipTextColor(java.awt.Color textColor)Specifies the color in which to display the icon's tool tip text, if any.voidsetVisible(boolean visible)Specifies whether the icon is drawn.-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from interface gov.nasa.worldwind.Restorable
getRestorableState, restoreState
-
-
-
-
Method Detail
-
setImageSource
void setImageSource(java.lang.Object imageSource)
Specifies the source image for the icon. Implementations of this interface determine the allowed source types, but generally allow at least aStringfile path and aBufferedImage.- Parameters:
imageSource- the image source.- Throws:
java.lang.IllegalArgumentException- ifimageSourceis null or the source is not an allowed type.
-
getImageSource
java.lang.Object getImageSource()
Returns the icon's image source.- Returns:
- the icon's image source.
-
getPosition
Position getPosition()
Returns the icon's geographic position.- Returns:
- the icon's geographic position.
-
setPosition
void setPosition(Position iconPosition)
Sets the icon's geographic position.- 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
boolean isHighlighted()
Indicates whether the icon should be drawn in its highlighted state. The representation of the highlighted state is implementation dependent.- Returns:
- true if the icon should be rendered as highlighted, otherwise false.
-
setHighlighted
void setHighlighted(boolean highlighted)
Specifies whether the icon should be drawn in its highlighted state. The representation of the highlighted state is implementation dependent.- Parameters:
highlighted- true if the icon should be rendered as highlighted, otherwise false.
-
getSize
java.awt.Dimension getSize()
Returns the icon's specified screen size.- Returns:
- the icon's specified screen size. The default value is false.
- See Also:
setSize(java.awt.Dimension)
-
setSize
void setSize(java.awt.Dimension size)
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.
- Parameters:
size- the desired screen size, or null if the icon should be displayed at its source image size.
-
isVisible
boolean isVisible()
Returns the state of the visibility flag.- Returns:
- the visibility flag. The default value is true.
-
setVisible
void setVisible(boolean visible)
Specifies whether the icon is drawn.- Parameters:
visible- true if the icon is drawn, otherwise false. The default is true.
-
getHighlightScale
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.- Returns:
- the icon's highlight scale.
-
setHighlightScale
void setHighlightScale(double highlightScale)
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.- Parameters:
highlightScale- the highlight scale.
-
getToolTipText
java.lang.String getToolTipText()
Returns the icon's current tool tip text.- Returns:
- the current tool tip text.
-
setToolTipText
void setToolTipText(java.lang.String toolTipText)
Specifies the text string to display as the icon's tool tip.- Parameters:
toolTipText- the tool tip text. May be null, the default, to indicate no tool tip is displaye.
-
getToolTipFont
java.awt.Font getToolTipFont()
Returns the font used to render an icon's tool tip, if any.- Returns:
- the tool tip font. The default is null.
-
setToolTipFont
void setToolTipFont(java.awt.Font toolTipFont)
Specifies the font to use when displaying the icon's tool tip, if any.- Parameters:
toolTipFont- the tool tip font. If null, an implementation dependent font is used.
-
isShowToolTip
boolean isShowToolTip()
Indicates whether the icon's tool tip, if any, is displayed with the icon.- Returns:
- true if the tool tip is displayed when the icon is rendered, otherwise false, the default.
-
setShowToolTip
void setShowToolTip(boolean showToolTip)
Indicates whether the icon's tool tip, if any, is displayed with the icon.- Parameters:
showToolTip- true if the tool tip is displayed when the icon is rendered, otherwise false, the default.
-
getToolTipTextColor
java.awt.Color getToolTipTextColor()
Indicates the color in which the icon's tool tip, if any, is drawn.- Returns:
- the tool tip's text color. The default value is null, in which case an implementation dependent color is used.
-
setToolTipTextColor
void setToolTipTextColor(java.awt.Color textColor)
Specifies the color in which to display the icon's tool tip text, if any.- Parameters:
textColor- the tool tip text color. The default is null, in which case an implementation dependent color is used.
-
isAlwaysOnTop
boolean isAlwaysOnTop()
Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.- Returns:
- true if the icon has visual priority, otherwise false, the default.
-
setAlwaysOnTop
void setAlwaysOnTop(boolean alwaysOnTop)
Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.- Parameters:
alwaysOnTop- true if the icon has visual priority, otherwise false, the default.
-
getBackgroundImage
java.lang.Object getBackgroundImage()
Returns the icon's background image source, if any.- Returns:
- the icon's background image source. The default is null.
-
setBackgroundImage
void setBackgroundImage(java.lang.Object background)
Specifies the icon's background image source. If non-null, the image is displayed centered and behind the icon.- Parameters:
background- the background image source. The default is null.
-
getBackgroundScale
double getBackgroundScale()
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.- Returns:
- the background image scale.
-
setBackgroundScale
void setBackgroundScale(double backgroundScale)
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.- Parameters:
backgroundScale- the background image scale.
-
getToolTipOffset
Vec4 getToolTipOffset()
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.- Returns:
- the tool tip offset. The default is null.
-
setToolTipOffset
void setToolTipOffset(Vec4 toolTipOffset)
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.- Parameters:
toolTipOffset- the tool tip offset. The default is null.
-
getImageTexture
BasicWWTexture getImageTexture()
Returns theWWTextureused to represent the icon.- Returns:
- the icon's texture.
-
getBackgroundTexture
BasicWWTexture getBackgroundTexture()
Returns theWWTextureused to represent the icon's background texture.- Returns:
- the icon's background texture.
-
-