non-global Tooltip settings questions

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
medloh
Posts: 16
Joined: Tue May 07, 2013 11:26 pm
antibot: No, of course not.

non-global Tooltip settings questions

Post by medloh » Wed Jun 05, 2013 12:47 am

I've implemented a simple XYToolTipGenerator and plugged it into my Chart and was very happy. Then I realized I'd like to customize a few things, like the tooltip delay, maybe the font and color, etc. So after a bit of googling I found out about ToolTipManager:

"Manages all the ToolTips in the system."

My problem is that I don't want to change all the tooltips in the VM--I'd only like to change some behaviors of tooltips in the Chart. The Chart is just a tiny part of a huge application and there's a very good chance that some people would get upset if the tooltip behavior changed in the app after the chart was loaded.

Any advice on how to best customize things like tooltip delay for only tooltips in a chart and not the whole app?

remiohead
Posts: 201
Joined: Fri Oct 02, 2009 3:53 pm
antibot: No, of course not.

Re: non-global Tooltip settings questions

Post by remiohead » Wed Jun 05, 2013 3:30 pm

See these methods in ChartPanel which can be customised on a per panel basis. They work by setting the appropriate properties in ToolTipManager on mouse entry and reset the original values on mouse exit.

Code: Select all

public void setInitialDelay(int delay)
public void setReshowDelay(int delay)
public void setDismissDelay(int delay) 

medloh
Posts: 16
Joined: Tue May 07, 2013 11:26 pm
antibot: No, of course not.

Re: non-global Tooltip settings questions

Post by medloh » Wed Jun 05, 2013 4:34 pm

Thanks, exactly what I was looking for.

I suppose we could just use the HTML markup features of tooltips for changing the style.

Locked