s.
- See Also:
JCLegend.setLegendPopulator(com.klg.jclass.util.legend.JCLegendPopulator)
,
JCLegend.setLegendRenderer(com.klg.jclass.util.legend.JCLegendRenderer)
, Serialized Form
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ranges
protected Vector ranges
legend
protected JCLegend legend
outlineColor
protected Color outlineColor
legendTitle
protected String legendTitle
DefaultLegendPopulatorRenderer
public DefaultLegendPopulatorRenderer(JCLegend legend,
Vector ranges)
- Creates a Populator and Renderer for a
JCLegend
.
- Parameters:
legend
- The JCLegend
for which this class will populate
and render JCLegendItems
ranges
- The Vector
of ranges which are used to create
corresponding JCLegendItems
getLegendItems
public List getLegendItems(FontMetrics fm)
- Creates legend items for each range listed in the ranges list.
This uses the range name and range foreground color to create the
JCLegendItem
s.
- Specified by:
- getLegendItems in interface JCLegendPopulator
- Parameters:
fm
- FontMetrics Information about the font in which legend text will
be written
createLegendItem
protected JCLegendItem createLegendItem(String name,
int symbolSize,
int width,
int height,
Color c)
- Creates a legend item.
- Parameters:
name
- symbolSize
- width
- height
- c
-
isTitleItem
public boolean isTitleItem(JCLegendItem item)
- Since the title is just another
JCLegendItem
we need
a way to identify it as the title. This method indicates
if an item is a title. In this case a null itemInfo
indicates
that this is a title.
- Specified by:
- isTitleItem in interface JCLegendPopulator
- Parameters:
item
- - Returns:
- true If this item is the legend title
drawLegendItem
public void drawLegendItem(Graphics gc,
Font useFont,
JCLegendItem thisItem)
- For implementing custom legend item draws. For use with CUSTOM_ALL
draw type.
- Specified by:
- drawLegendItem in interface JCLegendRenderer
- Parameters:
gc
- useFont
- thisItem
-
drawLegendItemSymbol
public void drawLegendItemSymbol(Graphics gc,
Font useFont,
JCLegendItem thisItem)
- For implementing custom legend item symbol draws. For use with
CUSTOM_SYMBOL
draw type.
- Specified by:
- drawLegendItemSymbol in interface JCLegendRenderer
- Parameters:
gc
- useFont
- thisItem
-
getOutlineColor
public Color getOutlineColor(JCLegendItem thisItem)
- Gets the outline color to use when drawing this legend item's symbol. If
null, the legend will use its own foreground color.
- Specified by:
- getOutlineColor in interface JCLegendRenderer
- Parameters:
thisItem
-
setOutlineColor
public void setOutlineColor(Color outlineColor)
- Sets the outline color to use when drawing this legend item's symbol. If
null, legend will use its own foreground color. The default is black.
- Parameters:
outlineColor
-
setFillGraphics
public void setFillGraphics(Graphics gc,
JCLegendItem thisItem)
- Sets the provided
Graphics
object with the appropriate settings to
use when drawing this legend item's symbol. In this case it sets
the gc
color to the range's foreground color.
- Specified by:
- setFillGraphics in interface JCLegendRenderer
- Parameters:
gc
- thisItem
-
getLegendTitle
public String getLegendTitle()
- Returns this legend's title.
- Returns:
- the title
setLegendTitle
public void setLegendTitle(String legendTitle)
- Sets the legend's title.
- Parameters:
legendTitle
- The legend's title