What is the difference on set**LabelGenerator

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
DavidThi808
Posts: 106
Joined: Fri May 27, 2005 7:44 pm
Location: Boulder, CO
Contact:

What is the difference on set**LabelGenerator

Post by DavidThi808 » Mon Oct 12, 2009 4:21 am

There's:
setBaseItemLabelGenerator()
setItemLabelGenerator()

What's is each for?

thanks - dave

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

Re: What is the difference on set**LabelGenerator

Post by remiohead » Mon Oct 12, 2009 9:24 pm

setItemLabelGenerater() is deprecated so you shouldn't use it.

setBaseItemLabelGenerator() is the label generator used if you don't specify any alternative for series/points.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: What is the difference on set**LabelGenerator

Post by david.gilbert » Tue Oct 13, 2009 6:40 am

setBaseXXX() sets the default value for an attribute when it doesn't have a "per series" value. I should call these methods setDefaultXXX.

setSeriesXXX() sets the value for an attribute for a particular series. I often refer to this as the "per series" setting.

setXXX() generally overrides both the "per series" and the base or default attribute values...handy to make a temporary override and then restore the previous settings (just by setting the override to null again), but it adds clutter and confusion in an already large API so I've deprecated these methods and they'll be removed later. I should probably have called these methods setOverrideXXX().
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked