|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eesgmbh.gimv.client.presenter.TooltipPresenter
public class TooltipPresenter
A presenter to display hover, clickable (not yet) and static (not yet) tooltips.
The actual tooltip html is obtained from the ImageEntity instances in the SetImageEntitiesEvent.
The html is passed into HTML widgets, that are internally constructed in a pool.
The presenter can be configured in what way it will match a particular tooltip to the current mouse position,
see configureHoverMatch(boolean, boolean, boolean).
The offset of the tooltip can be set with setDisplayOffset(int, int).
If there shouldn't be any tooltips for a certain ImageEntity group id, these can be set with addExcludedImageEntityGroupId(String).
Registers with the HandlerManager to receive the following events
SetImageEntitiesEvent (mandatory, won't do anything otherwise)
ViewportMouseMoveEvent (mandatory, won't do anything otherwise)
SetDataAreaPixelBoundsEvent (optional, will not show any tooltips, if the mouse cursor is outside these points)
ViewportMouseOutEvent (technically optional, but the last tooltip might remain visible after the mouse cursor wandered outside the viewport)
ViewportDragInProgressEvent (optional, will stop showing any tooltips, when there dragging takes places)
ViewportDragFinishedEvent (optional, will show tooltips again, after dragging finished )
Fires no events.
| Constructor Summary | |
|---|---|
TooltipPresenter(HandlerManager handlerManager)
Instantiates the presenter. |
|
| Method Summary | |
|---|---|
void |
addExcludedImageEntityGroupId(String groupId)
Add an ImageEntity group id, for which no tooltips should be displayed. |
void |
configureHoverMatch(boolean horizontal,
boolean vertical,
boolean displayAll)
Configures the tooltip display mechanism to be used as a result of the current mouse position. |
void |
setDisplayOffset(int xOffset,
int yOffset)
An offset in pixels for the tooltip position based on the center of the bounds of the ImageEntitys
The default is xOffset=1, yOffset=1 |
void |
setTooltipZIndex(int zIndex)
Set the z-index for all tooltips. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TooltipPresenter(HandlerManager handlerManager)
handlerManager - A HandlerManager| Method Detail |
|---|
public void configureHoverMatch(boolean horizontal,
boolean vertical,
boolean displayAll)
Configures the tooltip display mechanism to be used as a result of the current mouse position.
Setting both horizontal and vertical to true will require the mouse position to
be excactly above the ImageEntity bounds.
If for instance only horizontal is set to true, only the x position must match with
the ImageEntity bounds, meaning that the tooltip will be displayed even if the mouse cursor
is somewhere below or above the ImageEntity bounds.
The opposite holds true for horizontal=false and vertical=true.
The default is horizontal=true, vertical=false, displayAll=false
performance note: This current version of the presenter requires a lot of initialization time when both horizontal and vertical must match, tests in IE 7 (the slowest browsers) resulted in 10 sec of initialization for only 800 tooltips. So basically horizontal=true and vertical=true should not be used at the moment.
horizontal - mouse position must match horizontally with the ImageEntity boundsvertical - mouse position must match vertically with the ImageEntity boundsdisplayAll - whether to display all ImageEntity tooltips whose bound's center is exactly at the current mouse position
public void setDisplayOffset(int xOffset,
int yOffset)
ImageEntitys
The default is xOffset=1, yOffset=1
xOffset - offset in pixelsyOffset - offset in pixelspublic void addExcludedImageEntityGroupId(String groupId)
ImageEntity group id, for which no tooltips should be displayed.
groupId - an ImageEntity group idpublic void setTooltipZIndex(int zIndex)
The default z-index is 10000.
You only need to invoke this method, if the tooltips do not appear on top of other components with a z-index higher than 10000.
zIndex - A css z-index for all tooltips
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||