public class ToolTipController extends 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 String |
hoverKey |
protected Object |
lastHoverObject |
protected Object |
lastRolloverObject |
protected AnnotationLayer |
layer |
protected 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,
String rolloverKey,
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 String |
getHoverText(SelectEvent event) |
protected 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,
String text) |
protected ToolTipAnnotation annotation
protected String hoverKey
protected Object lastHoverObject
protected Object lastRolloverObject
protected AnnotationLayer layer
protected String rolloverKey
protected WorldWindow wwd
public ToolTipController(WorldWindow wwd)
WorldWindow
that displays "DISPLAY_NAME" on rollover.wwd
- the World Window to monitor.public ToolTipController(WorldWindow wwd, String rolloverKey, String hoverKey)
WorldWindow
that displays tool tips on hover and/or rollover.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.protected void addLayer(Layer layer)
public void dispose()
Disposable
dispose
in interface Disposable
protected String getHoverText(SelectEvent event)
protected 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, String text)