NASA World Wind

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 World Wind. 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
 Object getBackgroundImage()
          Returns the icon's background image source, if any.
 double getBackgroundScale()
          Indicates the relative screen size of the background image, if specified.
 BasicWWTexture getBackgroundTexture()
          Returns the WWTexture used to represent the icon's background texture.
 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.
 Object getImageSource()
          Returns the icon's image source.
 BasicWWTexture getImageTexture()
          Returns the WWTexture used to represent the icon.
 Position getPosition()
          Returns the icon's geographic position.
 Dimension getSize()
          Returns the icon's specified screen size.
 Font getToolTipFont()
          Returns the font used to render an icon's tool tip, if any.
 Vec4 getToolTipOffset()
          Indicates the offset in screen coordinates at which to place the lower left corner of the icon tool tip's text box.
 String getToolTipText()
          Returns the icon's current tool tip text.
 Color getToolTipTextColor()
          Indicates the color in which the icon's tool tip, if any, is drawn.
 boolean isAlwaysOnTop()
          Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.
 boolean isHighlighted()
          Indicates whether the icon should be drawn in its highlighted state.
 boolean isShowToolTip()
          Indicates whether the icon's tool tip, if any, is displayed with the icon.
 boolean isVisible()
          Returns the state of the visibility flag.
 void setAlwaysOnTop(boolean alwaysOnTop)
          Indicates whether the icon is always to be displayed "on top" of all other ordered renderables.
 void setBackgroundImage(Object background)
          Specifies the icon's background image source.
 void setBackgroundScale(double backgroundScale)
          Indicates the relative screen size of the background image, if specified.
 void setHighlighted(boolean highlighted)
          Specifies whether the icon should be drawn in its highlighted state.
 void setHighlightScale(double highlightScale)
          Specifies the relative screen size of the icon when it's highlighted.
 void setImageSource(Object imageSource)
          Specifies the source image for the icon.
 void setPosition(Position iconPosition)
          Sets the icon's geographic position.
 void setShowToolTip(boolean showToolTip)
          Indicates whether the icon's tool tip, if any, is displayed with the icon.
 void setSize(Dimension size)
          Sets the desired screen size of the icon.
 void setToolTipFont(Font toolTipFont)
          Specifies the font to use when displaying the icon's tool tip, if any.
 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.
 void setToolTipText(String toolTipText)
          Specifies the text string to display as the icon's tool tip.
 void setToolTipTextColor(Color textColor)
          Specifies the color in which to display the icon's tool tip text, if any.
 void setVisible(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

getBackgroundImage

Object getBackgroundImage()
Returns the icon's background image source, if any.

Returns:
the icon's 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.

getBackgroundTexture

BasicWWTexture getBackgroundTexture()
Returns the WWTexture used to represent the icon's background texture.

Returns:
the icon's background texture.

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.

getImageSource

Object getImageSource()
Returns the icon's image source.

Returns:
the icon's image source.

getImageTexture

BasicWWTexture getImageTexture()
Returns the WWTexture used to represent the icon.

Returns:
the icon's texture.

getPosition

Position getPosition()
Returns the icon's geographic position.

Returns:
the icon's geographic position.

getSize

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)

getToolTipFont

Font getToolTipFont()
Returns the font used to render an icon's tool tip, if any.

Returns:
the tool tip font. The default is null.

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.

getToolTipText

String getToolTipText()
Returns the icon's current tool tip text.

Returns:
the current tool tip text.

getToolTipTextColor

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.

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.

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.

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.

isVisible

boolean isVisible()
Returns the state of the visibility flag.

Returns:
the visibility flag. The default value is true.

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.

setBackgroundImage

void setBackgroundImage(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.

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.

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.

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.

setImageSource

void setImageSource(Object imageSource)
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.

Parameters:
imageSource - the image source.
Throws:
IllegalArgumentException - if imageSource is null or the source is not an allowed type.

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.

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.

setSize

void setSize(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.

setToolTipFont

void setToolTipFont(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.

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.

setToolTipText

void setToolTipText(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.

setToolTipTextColor

void setToolTipTextColor(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.

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.

NASA World Wind