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(java.lang.Object imageSource,
Position iconPosition) |
UserFacingIcon(java.lang.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 . |
java.lang.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.
|
java.lang.Object |
getImageSource()
Returns the icon's image source.
|
BasicWWTexture |
getImageTexture()
Returns the
WWTexture used to represent the icon. |
java.lang.String |
getPath() |
Position |
getPosition()
Returns the icon's geographic position.
|
Position |
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.
|
java.lang.String |
getRestorableState()
Returns an XML state document String describing the public attributes of this UserFacingIcon.
|
java.awt.Dimension |
getSize()
Returns the icon's specified screen size.
|
java.awt.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.
|
java.lang.String |
getToolTipText()
Returns the icon's current tool tip text.
|
java.awt.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(java.lang.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(java.lang.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(java.lang.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(java.awt.Dimension size)
Sets the desired screen size of the icon.
|
void |
setToolTipFont(java.awt.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(java.lang.String toolTipText)
Specifies the text string to display as the icon's tool tip.
|
void |
setToolTipTextColor(java.awt.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.
|
java.lang.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, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected BasicWWTexture backgroundTexture
protected boolean dragEnabled
protected DraggableSupport draggableSupport
protected BasicWWTexture imageTexture
public UserFacingIcon()
public UserFacingIcon(java.lang.Object imageSource, Position iconPosition)
public UserFacingIcon(java.lang.String iconPath, Position iconPosition)
protected void doDrag(DragContext dragContext)
public void drag(DragContext dragContext)
Draggable
DragContext
.drag
in interface Draggable
dragContext
- the DragContext
of this dragging event.public java.lang.Object getBackgroundImage()
WWIcon
getBackgroundImage
in interface WWIcon
public double getBackgroundScale()
WWIcon
getBackgroundScale
in interface WWIcon
public BasicWWTexture getBackgroundTexture()
WWIcon
WWTexture
used to represent the icon's background texture.getBackgroundTexture
in interface WWIcon
public double getHighlightScale()
getHighlightScale
in interface WWIcon
public java.lang.Object getImageSource()
WWIcon
getImageSource
in interface WWIcon
public BasicWWTexture getImageTexture()
WWIcon
WWTexture
used to represent the icon.getImageTexture
in interface WWIcon
public java.lang.String getPath()
public Position getPosition()
WWIcon
getPosition
in interface WWIcon
public Position getReferencePosition()
Movable
getReferencePosition
in interface Movable
public java.lang.String getRestorableState()
getRestorableState
in interface Restorable
public java.awt.Dimension getSize()
WWIcon
getSize
in interface WWIcon
WWIcon.setSize(java.awt.Dimension)
public java.awt.Font getToolTipFont()
WWIcon
getToolTipFont
in interface WWIcon
public Vec4 getToolTipOffset()
WWIcon
getToolTipOffset
in interface WWIcon
public java.lang.String getToolTipText()
WWIcon
getToolTipText
in interface WWIcon
public java.awt.Color getToolTipTextColor()
WWIcon
getToolTipTextColor
in interface WWIcon
public boolean isAlwaysOnTop()
WWIcon
isAlwaysOnTop
in interface WWIcon
public boolean isDragEnabled()
Draggable
isDragEnabled
in interface Draggable
public boolean isHighlighted()
WWIcon
isHighlighted
in interface WWIcon
public boolean isShowToolTip()
WWIcon
isShowToolTip
in interface WWIcon
public boolean isVisible()
WWIcon
public void move(Position position)
Movable
public void moveTo(Position position)
Movable
public void restoreState(java.lang.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 Restorable
stateInXml
- an XML document String describing a UserFacingIcon.java.lang.IllegalArgumentException
- If stateInXml
is null, or if stateInXml
is not a well
formed XML document String.public void setAlwaysOnTop(boolean alwaysOnTop)
WWIcon
setAlwaysOnTop
in interface WWIcon
alwaysOnTop
- true if the icon has visual priority, otherwise false, the default.public void setBackgroundImage(java.lang.Object background)
WWIcon
setBackgroundImage
in interface WWIcon
background
- the background image source. The default is null.public void setBackgroundScale(double backgroundScale)
WWIcon
setBackgroundScale
in interface WWIcon
backgroundScale
- the background image scale.public void setDragEnabled(boolean enabled)
Draggable
setDragEnabled
in interface Draggable
enabled
- true
if the object is enabled, else false
.public void setHighlighted(boolean highlighted)
WWIcon
setHighlighted
in interface WWIcon
highlighted
- true if the icon should be rendered as highlighted, otherwise false.public void setHighlightScale(double highlightScale)
WWIcon
setHighlightScale
in interface WWIcon
highlightScale
- the highlight scale.public void setImageSource(java.lang.Object imageSource)
WWIcon
String
file path and a BufferedImage
.setImageSource
in interface WWIcon
imageSource
- the image source.public void setPosition(Position iconPosition)
WWIcon
setPosition
in interface WWIcon
iconPosition
- 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)
WWIcon
setShowToolTip
in interface WWIcon
showToolTip
- true if the tool tip is displayed when the icon is rendered, otherwise false, the default.public void setSize(java.awt.Dimension size)
WWIcon
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.
public void setToolTipFont(java.awt.Font toolTipFont)
WWIcon
setToolTipFont
in interface WWIcon
toolTipFont
- the tool tip font. If null, an implementation dependent font is used.public void setToolTipOffset(Vec4 toolTipOffset)
WWIcon
setToolTipOffset
in interface WWIcon
toolTipOffset
- the tool tip offset. The default is null.public void setToolTipText(java.lang.String toolTipText)
WWIcon
setToolTipText
in interface WWIcon
toolTipText
- the tool tip text. May be null, the default, to indicate no tool tip is displaye.public void setToolTipTextColor(java.awt.Color textColor)
WWIcon
setToolTipTextColor
in interface WWIcon
textColor
- the tool tip text color. The default is null, in which case an implementation dependent color is
used.public void setVisible(boolean visible)
WWIcon
setVisible
in interface WWIcon
visible
- true if the icon is drawn, otherwise false. The default is true.public java.lang.String toString()
toString
in class java.lang.Object