public class UserFacingIcon extends AVListImpl implements WWIcon, Movable, Draggable
| Modifier and Type | Field and Description |
|---|---|
protected BasicWWTexture |
backgroundTexture |
protected boolean |
dragEnabled |
protected DraggableSupport |
draggableSupport |
protected BasicWWTexture |
imageTexture |
| Constructor and Description |
|---|
UserFacingIcon() |
UserFacingIcon(Object imageSource,
Position iconPosition) |
UserFacingIcon(String iconPath,
Position iconPosition) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doDrag(DragContext dragContext) |
void |
drag(DragContext dragContext)
Drag the object given the provided
DragContext. |
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. |
String |
getPath() |
Position |
getPosition()
Returns the icon's geographic position.
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
String |
getRestorableState()
Returns an XML state document String describing the public attributes of this UserFacingIcon.
|
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 |
isDragEnabled()
Indicates whether the object is enabled for dragging.
|
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 |
move(Position position)
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to
North.
|
void |
moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to
North.
|
void |
restoreState(String stateInXml)
Restores publicly settable attribute values found in the specified XML state document String.
|
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 |
setDragEnabled(boolean enabled)
Controls whether the object is enabled for dragging.
|
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.
|
String |
toString() |
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValuesclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValuesprotected BasicWWTexture backgroundTexture
protected boolean dragEnabled
protected DraggableSupport draggableSupport
protected BasicWWTexture imageTexture
protected void doDrag(DragContext dragContext)
public void drag(DragContext dragContext)
DraggableDragContext.drag in interface DraggabledragContext - the DragContext of this dragging event.public Object getBackgroundImage()
WWIcongetBackgroundImage in interface WWIconpublic double getBackgroundScale()
WWIcongetBackgroundScale in interface WWIconpublic BasicWWTexture getBackgroundTexture()
WWIconWWTexture used to represent the icon's background texture.getBackgroundTexture in interface WWIconpublic double getHighlightScale()
getHighlightScale in interface WWIconpublic Object getImageSource()
WWIcongetImageSource in interface WWIconpublic BasicWWTexture getImageTexture()
WWIconWWTexture used to represent the icon.getImageTexture in interface WWIconpublic String getPath()
public Position getPosition()
WWIcongetPosition in interface WWIconpublic Position getReferencePosition()
MovablegetReferencePosition in interface Movablepublic String getRestorableState()
getRestorableState in interface Restorablepublic Dimension getSize()
WWIcongetSize in interface WWIconWWIcon.setSize(java.awt.Dimension)public Font getToolTipFont()
WWIcongetToolTipFont in interface WWIconpublic Vec4 getToolTipOffset()
WWIcongetToolTipOffset in interface WWIconpublic String getToolTipText()
WWIcongetToolTipText in interface WWIconpublic Color getToolTipTextColor()
WWIcongetToolTipTextColor in interface WWIconpublic boolean isAlwaysOnTop()
WWIconisAlwaysOnTop in interface WWIconpublic boolean isDragEnabled()
DraggableisDragEnabled in interface Draggablepublic boolean isHighlighted()
WWIconisHighlighted in interface WWIconpublic boolean isShowToolTip()
WWIconisShowToolTip in interface WWIconpublic boolean isVisible()
WWIconpublic void move(Position position)
Movablepublic void moveTo(Position position)
Movablepublic void restoreState(String stateInXml)
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.restoreState in interface RestorablestateInXml - an XML document String describing a UserFacingIcon.IllegalArgumentException - If stateInXml is null, or if stateInXml is not a well
formed XML document String.public void setAlwaysOnTop(boolean alwaysOnTop)
WWIconsetAlwaysOnTop in interface WWIconalwaysOnTop - true if the icon has visual priority, otherwise false, the default.public void setBackgroundImage(Object background)
WWIconsetBackgroundImage in interface WWIconbackground - the background image source. The default is null.public void setBackgroundScale(double backgroundScale)
WWIconsetBackgroundScale in interface WWIconbackgroundScale - the background image scale.public void setDragEnabled(boolean enabled)
DraggablesetDragEnabled in interface Draggableenabled - true if the object is enabled, else false.public void setHighlighted(boolean highlighted)
WWIconsetHighlighted in interface WWIconhighlighted - true if the icon should be rendered as highlighted, otherwise false.public void setHighlightScale(double highlightScale)
WWIconsetHighlightScale in interface WWIconhighlightScale - the highlight scale.public void setImageSource(Object imageSource)
WWIconString file path and a BufferedImage.setImageSource in interface WWIconimageSource - the image source.public void setPosition(Position iconPosition)
WWIconsetPosition in interface WWIconiconPosition - the icon's geographic position. May be null to indicate that the icon has no current position
and therefore should not be displayed.public void setShowToolTip(boolean showToolTip)
WWIconsetShowToolTip in interface WWIconshowToolTip - true if the tool tip is displayed when the icon is rendered, otherwise false, the default.public void setSize(Dimension size)
WWIconpublic void setToolTipFont(Font toolTipFont)
WWIconsetToolTipFont in interface WWIcontoolTipFont - the tool tip font. If null, an implementation dependent font is used.public void setToolTipOffset(Vec4 toolTipOffset)
WWIconsetToolTipOffset in interface WWIcontoolTipOffset - the tool tip offset. The default is null.public void setToolTipText(String toolTipText)
WWIconsetToolTipText in interface WWIcontoolTipText - the tool tip text. May be null, the default, to indicate no tool tip is displaye.public void setToolTipTextColor(Color textColor)
WWIconsetToolTipTextColor in interface WWIcontextColor - the tool tip text color. The default is null, in which case an implementation dependent color is
used.public void setVisible(boolean visible)
WWIconsetVisible in interface WWIconvisible - true if the icon is drawn, otherwise false. The default is true.