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, 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
protected void doDrag(DragContext dragContext)
public void drag(DragContext dragContext)
Draggable
DragContext
.drag
in interface Draggable
dragContext
- the DragContext
of this dragging event.public 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 Object getImageSource()
WWIcon
getImageSource
in interface WWIcon
public BasicWWTexture getImageTexture()
WWIcon
WWTexture
used to represent the icon.getImageTexture
in interface WWIcon
public String getPath()
public Position getPosition()
WWIcon
getPosition
in interface WWIcon
public Position getReferencePosition()
Movable
getReferencePosition
in interface Movable
public String getRestorableState()
getRestorableState
in interface Restorable
public Dimension getSize()
WWIcon
getSize
in interface WWIcon
WWIcon.setSize(java.awt.Dimension)
public Font getToolTipFont()
WWIcon
getToolTipFont
in interface WWIcon
public Vec4 getToolTipOffset()
WWIcon
getToolTipOffset
in interface WWIcon
public String getToolTipText()
WWIcon
getToolTipText
in interface WWIcon
public 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(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.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(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(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(Dimension size)
WWIcon
public void setToolTipFont(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(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(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.