|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.swt.SwtToolTipGenerator
This is the default SWT implementation of
ToolTipGenerator.
Note this implementation is largely inspired from a sample provided in
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-swt-home/dev.html#snippets.
Instances of SwtToolTipGenerator are associated with a single
Control, the one passed as parameter to the
class constructor. See SwtToolTipGenerator(Control).
Subclasses can overwrite createTooltip(Shell, Object, int, int) in order
to customize the tooltips.
Also, the two methods getOffsetX() and getOffsetY() provide
them with the mean of changing the tooltips position.
The getTooltipBackGroundColor(Display) and
getTooltipForeGroundColor(Display) methods are provided in order to
customize the tooltips.
The following properties can also be set:
setInitialDelay(int)setReshowDelay(int)setDismissDelay(int)
An instance of SwtToolTipGenerator can be registered on the
SwtToolTipManager instance in order
to allow a central management of tooltips.
Use the abstract subclass SwtGraphPanelToolTipGenerator
in order to provide your SwtGraphPanel
with custom tootips.
Use the destroy() method in order to
unregister a SwtToolTipGenerator instance.
| Constructor Summary | |
SwtToolTipGenerator(org.eclipse.swt.widgets.Control control)
Initialises and activates tooltips on the given Control. |
|
| Method Summary | |
protected void |
createTooltip(org.eclipse.swt.widgets.Shell shell,
java.lang.Object tooltip,
int x,
int y)
This methods create a default tooltip. |
void |
destroy()
Removes internal listeners and unregisters the
from the instance.
|
org.eclipse.swt.widgets.Control |
getControl()
Returns the . |
protected int |
getDismissDelay()
Returns the dismissDelay. |
protected int |
getInitialDelay()
Returns the initialDelay. |
protected int |
getOffsetX()
Returns the offset used to display the tooltip on the X axis. |
protected int |
getOffsetY()
Returns the offset used to display the tooltip on the Y axis. |
protected int |
getReshowDelay()
Returns the reshowDelay. |
protected org.eclipse.swt.graphics.Color |
getTooltipBackGroundColor(org.eclipse.swt.widgets.Display display)
Returns the background color used for tooltips. |
protected org.eclipse.swt.graphics.Color |
getTooltipForeGroundColor(org.eclipse.swt.widgets.Display display)
Returns the foreground color used for tooltips. |
protected boolean |
isEnabled()
Returns true if tooltips are enabled, false otherwise. |
protected void |
setDismissDelay(int dismissDelay)
Sets the dismissDelay property. |
protected void |
setEnabled(boolean enabled)
Enables or disables the tooltips. |
protected void |
setInitialDelay(int initialDelay)
Sets the initialDelay property. |
protected void |
setReshowDelay(int reshowDelay)
Sets the reshowDelay property. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.tensegrity.gui.graphdocument.ToolTipGenerator |
getToolTip, getToolTip |
| Constructor Detail |
public SwtToolTipGenerator(org.eclipse.swt.widgets.Control control)
Control.
control - the Control for which tooltips are herein generated.| Method Detail |
public void destroy()
Removes internal listeners and unregisters the
from the SwtToolTipGenerator instance.
SwtToolTipManager
protected int getOffsetX()
protected int getOffsetY()
protected void createTooltip(org.eclipse.swt.widgets.Shell shell,
java.lang.Object tooltip,
int x,
int y)
This methods create a default tooltip. Subclasses can override this method in order to provide application specific tooltips.
shell - Shell which displays to tooltiptooltip - tooltip objectx - mouse position, x directiony - mouse position, y directionprotected org.eclipse.swt.graphics.Color getTooltipForeGroundColor(org.eclipse.swt.widgets.Display display)
Returns the foreground color used for tooltips.
display - a Display which can be used to retrieve system
colors.
protected org.eclipse.swt.graphics.Color getTooltipBackGroundColor(org.eclipse.swt.widgets.Display display)
Returns the background color used for tooltips.
display - a Display which can be used to retrieve system
colors.
protected int getDismissDelay()
protected void setDismissDelay(int dismissDelay)
dismissDelay - The dismissDelay to set.protected boolean isEnabled()
protected void setEnabled(boolean enabled)
enabled - if false no tooltip is displayed.protected int getInitialDelay()
protected void setInitialDelay(int initialDelay)
initialDelay - The initialDelay to set.protected int getReshowDelay()
protected void setReshowDelay(int reshowDelay)
reshowDelay - The reshowDelay to set.public final org.eclipse.swt.widgets.Control getControl()
Control.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||