gov.nasa.worldwind.examples.util
Class ToolTipController
java.lang.Object
gov.nasa.worldwind.examples.util.ToolTipController
- All Implemented Interfaces:
- Disposable, SelectListener, EventListener
public class ToolTipController
- extends Object
- implements SelectListener, Disposable
Controls display of tool tips on picked objects. Any shape implementing AVList
can participate. Shapes
provide tool tip text in their AVList for either or both of hover and rollover events. The keys associated with the
text are specified to the constructor.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
annotation
protected ToolTipAnnotation annotation
hoverKey
protected String hoverKey
lastHoverObject
protected Object lastHoverObject
lastRolloverObject
protected Object lastRolloverObject
layer
protected AnnotationLayer layer
rolloverKey
protected String rolloverKey
wwd
protected WorldWindow wwd
ToolTipController
public ToolTipController(WorldWindow wwd)
- Create a controller for a specified
WorldWindow
that displays "DISPLAY_NAME" on rollover.
- Parameters:
wwd
- the World Window to monitor.
ToolTipController
public ToolTipController(WorldWindow wwd,
String rolloverKey,
String hoverKey)
- Create a controller for a specified
WorldWindow
that displays tool tips on hover and/or rollover.
- Parameters:
wwd
- the World Window to monitor.rolloverKey
- the key to use when looking up tool tip text from the shape's AVList when a rollover event
occurs. May be null, in which case a tool tip is not displayed for rollover events.hoverKey
- the key to use when looking up tool tip text from the shape's AVList when a hover event
occurs. May be null, in which case a tool tip is not displayed for hover events.
addLayer
protected void addLayer(Layer layer)
dispose
public void dispose()
- Description copied from interface:
Disposable
- Disposes of any internal resources allocated by the object.
- Specified by:
dispose
in interface Disposable
getHoverText
protected String getHoverText(SelectEvent event)
getRolloverText
protected String getRolloverText(SelectEvent event)
handleHover
protected void handleHover(SelectEvent event)
handleRollover
protected void handleRollover(SelectEvent event)
hideToolTip
protected void hideToolTip()
removeLayer
protected void removeLayer(Layer layer)
selected
public void selected(SelectEvent event)
- Specified by:
selected
in interface SelectListener
showToolTip
protected void showToolTip(SelectEvent event,
String text)