public class ToolTipController extends java.lang.Object implements SelectListener, Disposable
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.Modifier and Type | Field and Description |
---|---|
protected ToolTipAnnotation |
annotation |
protected java.lang.String |
hoverKey |
protected java.lang.Object |
lastHoverObject |
protected java.lang.Object |
lastRolloverObject |
protected AnnotationLayer |
layer |
protected java.lang.String |
rolloverKey |
protected WorldWindow |
wwd |
Constructor and Description |
---|
ToolTipController(WorldWindow wwd)
Create a controller for a specified
WorldWindow that displays "DISPLAY_NAME" on rollover. |
ToolTipController(WorldWindow wwd,
java.lang.String rolloverKey,
java.lang.String hoverKey)
Create a controller for a specified
WorldWindow that displays tool tips on hover and/or rollover. |
Modifier and Type | Method and Description |
---|---|
protected void |
addLayer(Layer layer) |
void |
dispose()
Disposes of any internal resources allocated by the object.
|
protected java.lang.String |
getHoverText(SelectEvent event) |
protected java.lang.String |
getRolloverText(SelectEvent event) |
protected void |
handleHover(SelectEvent event) |
protected void |
handleRollover(SelectEvent event) |
protected void |
hideToolTip() |
protected void |
removeLayer(Layer layer) |
void |
selected(SelectEvent event) |
protected void |
showToolTip(SelectEvent event,
java.lang.String text) |
protected ToolTipAnnotation annotation
protected java.lang.String hoverKey
protected java.lang.Object lastHoverObject
protected java.lang.Object lastRolloverObject
protected AnnotationLayer layer
protected java.lang.String rolloverKey
protected WorldWindow wwd
public ToolTipController(WorldWindow wwd)
WorldWindow
that displays "DISPLAY_NAME" on rollover.wwd
- the WorldWindow to monitor.public ToolTipController(WorldWindow wwd, java.lang.String rolloverKey, java.lang.String hoverKey)
WorldWindow
that displays tool tips on hover and/or rollover.wwd
- the WorldWindow 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.protected void addLayer(Layer layer)
public void dispose()
Disposable
dispose
in interface Disposable
protected java.lang.String getHoverText(SelectEvent event)
protected java.lang.String getRolloverText(SelectEvent event)
protected void handleHover(SelectEvent event)
protected void handleRollover(SelectEvent event)
protected void hideToolTip()
protected void removeLayer(Layer layer)
public void selected(SelectEvent event)
selected
in interface SelectListener
protected void showToolTip(SelectEvent event, java.lang.String text)