|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart3d.JCChart3dLegendManager
This is the default implementation of both JCLegendPopulator
and
JCLegendRenderer
. These interfaces, respectively, control the
creation and display characteristics of the JCLegendItem
s.
JCLegend.setLegendPopulator(com.klg.jclass.util.legend.JCLegendPopulator)
,
JCLegend.setLegendRenderer(com.klg.jclass.util.legend.JCLegendRenderer)
,
Serialized FormField Summary | |
protected com.klg.jclass.chart3d.JCChart3d |
chart3d
The 3d chart instance containing the legend. |
protected int |
fieldGap
The gap between fields in JCMultiColumnStrings . |
protected com.klg.jclass.util.legend.JCLegend |
legend
The legend being managed by this class. |
protected Vector |
legendItems
List of legend items to be passed to the legend. |
protected int[] |
maxFieldWidths
The max value of each field used in a JCMultiColumnString
object. |
protected Color |
outlineColor
User-specified outline color for legend items. |
protected static int |
STYLE_BOX_RANGE
|
protected static int |
STYLE_CNTN_H
|
protected static int |
STYLE_CNTN_V
|
protected static int |
STYLE_CONTOUR
|
protected static int |
STYLE_LINE_RANGE
|
protected static int |
STYLE_NONE
|
protected static int |
STYLE_SYMBOL_RANGE
|
Constructor Summary | |
JCChart3dLegendManager(com.klg.jclass.chart3d.JCChart3d chart3d,
com.klg.jclass.util.legend.JCLegend legend)
Creates a Populator and Renderer for a
JCLegend . |
Method Summary | |
protected void |
calcTextWidthsFromFields(int numTextFields,
List legendItems,
com.klg.jclass.chart3d.JCChart3dLegendTemplate threeDLegend,
FontMetrics fm)
Runs through the given list of legend items and adjusts text sizes for the number of fields being used by JCMultiFieldString objects. |
void |
drawLegendItem(Graphics gc,
Font useFont,
com.klg.jclass.util.legend.JCLegendItem thisItem)
For implementing custom legend item draws. |
void |
drawLegendItemSymbol(Graphics gc,
Font useFont,
com.klg.jclass.util.legend.JCLegendItem thisItem)
For implementing custom legend item symbol draws. |
void |
drawLegendItemText(Graphics gc,
Font useFont,
com.klg.jclass.util.legend.JCLegendItem thisItem)
For implementing custom legend item text draws. |
protected Vector |
filterLevels(com.klg.jclass.chart3d.Chart3dDataView view,
int legendStyle,
com.klg.jclass.chart3d.JCChart3dLegendTemplate threeDLegend,
com.klg.jclass.chart3d.JCContour contour)
Filters the contour levels into a list that can be used to create legend item labels. |
int |
getFieldGap()
Gets the value being used as a gap between fields in JCMultiColumnString objects. |
List |
getLegendItems(FontMetrics fm)
Creates legend items for each range listed in the ranges list. |
protected Object |
getNonScatterLabel(int legendStyle,
com.klg.jclass.chart3d.JCChart3dNumberFormat formatter,
int nfrac,
Vector levels,
List userLabels,
int index,
com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator labelGenerator)
Gets the label for a legend item in a non-Scatter legend. |
Color |
getOutlineColor(com.klg.jclass.util.legend.JCLegendItem thisItem)
Gets the outline color to use when drawing this legend item's symbol. |
boolean |
isTitleItem(com.klg.jclass.util.legend.JCLegendItem item)
Indicates if an item is a title, creating a way to identify it from all the other JCLegendItem s. |
protected int |
populate3dLegendItem(com.klg.jclass.util.legend.JCLegendItem item,
FontMetrics fm,
Object label,
int drawType,
Dimension symbolDim,
Object itemInfo,
int numTextFields)
Populates a legend item for the 3d legend. |
void |
setFieldGap(int gap)
Sets the value to use as a gap between fields in JCMultiColumnString objects. |
void |
setFillGraphics(Graphics gc,
com.klg.jclass.util.legend.JCLegendItem thisItem)
Sets the provided Graphics object with the appropriate settings to
use when drawing this legend item's symbol. |
void |
setOutlineColor(Color outlineColor)
Sets the outline color to use when drawing this legend item's symbol. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected com.klg.jclass.chart3d.JCChart3d chart3d
protected com.klg.jclass.util.legend.JCLegend legend
protected Color outlineColor
protected Vector legendItems
protected int fieldGap
JCMultiColumnStrings
.
protected int[] maxFieldWidths
JCMultiColumnString
object.
protected static final int STYLE_NONE
protected static final int STYLE_BOX_RANGE
protected static final int STYLE_LINE_RANGE
protected static final int STYLE_SYMBOL_RANGE
protected static final int STYLE_CONTOUR
protected static final int STYLE_CNTN_H
protected static final int STYLE_CNTN_V
Constructor Detail |
public JCChart3dLegendManager(com.klg.jclass.chart3d.JCChart3d chart3d, com.klg.jclass.util.legend.JCLegend legend)
Populator
and Renderer
for a
JCLegend
.
chart3d
- legend
- the JCLegend
that this class will populate
and render JCLegendItems
forMethod Detail |
public void setFieldGap(int gap)
JCMultiColumnString
objects.
gap
- the field gappublic int getFieldGap()
JCMultiColumnString
objects.
public List getLegendItems(FontMetrics fm)
JCLegendItem
s.
getLegendItems
in interface JCLegendPopulator
fm
- FontMetrics - information about the font in which legend text will
be written
protected Vector filterLevels(com.klg.jclass.chart3d.Chart3dDataView view, int legendStyle, com.klg.jclass.chart3d.JCChart3dLegendTemplate threeDLegend, com.klg.jclass.chart3d.JCContour contour)
view
- legendStyle
- style of this legend; one of STYLE_CNTN_H
,
STYLE_CNTN_V
, STYLE_CONTOUR
,
STYLE_BOX_RANGE
, or STYLE_LINE_RANGE
threeDLegend
- the legend class if it implements the
JCChart3DLegendTemplate
interfacecontour
- the JCContour
object representing the contour
levels
protected Object getNonScatterLabel(int legendStyle, com.klg.jclass.chart3d.JCChart3dNumberFormat formatter, int nfrac, Vector levels, List userLabels, int index, com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator labelGenerator)
legendStyle
- style of this legend; one of STYLE_CNTN_H
,
STYLE_CNTN_V
, STYLE_CONTOUR
,
STYLE_BOX_RANGE
, or STYLE_LINE_RANGE
formatter
- class used to format labels from numbersnfrac
- the number of fractional digits in the formatted labellevels
- the array of range levels (used for default labels)userLabels
- a List of user-set labels; possibly nullindex
- the index of the current range levellabelGenerator
- user-set generator for custom labels; possibly null
protected int populate3dLegendItem(com.klg.jclass.util.legend.JCLegendItem item, FontMetrics fm, Object label, int drawType, Dimension symbolDim, Object itemInfo, int numTextFields)
JCMultiFieldString
, it notes the number of fields and returns
the value. Item text dimensions are determined from the label parameter with
passed fontmetrics. Other parameters are passed to the legend item as is.
item
- the legend item to populatefm
- the font metrics to use for sizing the passed legend labellabel
- the label to use for the contents of this legend itemdrawType
- the draw type to use for this legend itemsymbolDim
- the symbol dimensions to use for this legend itemitemInfo
- the itemInfo
field to use for this legend itemnumTextFields
- the maximum number of fields contained in any
JCMultiFieldString
objects used so far
JCMultiFieldString
objects for labels, this
value will be the maximum number of fields used so far; if not using
such any such objects, the return value is -1protected void calcTextWidthsFromFields(int numTextFields, List legendItems, com.klg.jclass.chart3d.JCChart3dLegendTemplate threeDLegend, FontMetrics fm)
JCMultiFieldString
objects.
numTextFields
- the maximum number of text fields being used by
JCMultiFieldString
objects in this legendlegendItems
- the list of legend itemsthreeDLegend
- the legend class if it implements the
JCChart3DLegendTemplate
interfacefm
- public boolean isTitleItem(com.klg.jclass.util.legend.JCLegendItem item)
JCLegendItem
s. In this case, a null itemInfo
indicates that this is a title.
isTitleItem
in interface JCLegendPopulator
item
-
true
if this item is the legend titlepublic void drawLegendItem(Graphics gc, Font useFont, com.klg.jclass.util.legend.JCLegendItem thisItem)
CUSTOM_ALL
draw type.
drawLegendItem
in interface JCLegendRenderer
gc
- tbe graphics object used to drawuseFont
- the font to usethisItem
- the item to drawpublic void drawLegendItemSymbol(Graphics gc, Font useFont, com.klg.jclass.util.legend.JCLegendItem thisItem)
CUSTOM_SYMBOL
draw type.
drawLegendItemSymbol
in interface JCLegendRenderer
gc
- tbe graphics object used to drawuseFont
- the font to usethisItem
- the item to drawpublic void drawLegendItemText(Graphics gc, Font useFont, com.klg.jclass.util.legend.JCLegendItem thisItem)
String
object.
drawLegendItemText
in interface JCLegendRenderer
gc
- tbe graphics object used to drawuseFont
- the font to usethisItem
- the item to drawpublic Color getOutlineColor(com.klg.jclass.util.legend.JCLegendItem thisItem)
getOutlineColor
in interface JCLegendRenderer
thisItem
- which item to get outline color from
public void setOutlineColor(Color outlineColor)
outlineColor
- the new outline colorpublic void setFillGraphics(Graphics gc, com.klg.jclass.util.legend.JCLegendItem thisItem)
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.
setFillGraphics
in interface JCLegendRenderer
gc
- the graphics object to setthisItem
- the item to get information from
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |