|
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 | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--com.klg.jclass.util.legend.JCLegend | +--com.klg.jclass.chart3d.JCChart3dLegend
JCChart3dLegend
manages and renders a grid-based legend.
It overrides JCLegend
's layout methods to position legend items
in a grid, where every row has the same height and every column the same
width.
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
protected boolean |
continuousLayout
Asks if the layout is really continuous. |
protected int |
distRange
The constraints to place upon the data ranges that appear in the legend. |
protected int |
groupGap
Space between groups in a legend (columns when legend vertical, rows when horizontal). |
protected int |
horizItemGap
Horizontal space between items. |
protected int |
insideItemGap
Space between the symbol and String inside an item. |
protected com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator |
labelGenerator
Label generator class. |
protected int |
layoutStyle
The style to use when laying out out ranges. |
protected int |
legendColumns
Number of columns in the legend. |
protected int |
legendRows
Number of rows in the legend. |
protected int |
marginGap
Space between outside and inside of legend. |
protected List |
userLabels
List of user-specified legend labels. |
protected int |
vertItemGap
Vertical space between items. |
Fields inherited from class com.klg.jclass.util.legend.JCLegend |
anchor, ascent, BOX, BOX_PLAIN, cachedFont, cachedVertical, cellRendererPane, changed, changedFlag, CUSTOM_ALL, CUSTOM_SYMBOL, descent, EAST, EASTWEST_MASK, HORIZONTAL, IMAGE, IMAGE_OUTLINED, imageMapInfo, legendItems, legendPopulator, legendRenderer, LINE, locale, NONE, NORTH, NORTHEAST, NORTHSOUTH_MASK, NORTHWEST, orientation, preferredSize, ps, SOUTH, SOUTHEAST, SOUTHWEST, symbolSize, textRend, updateParent, VERTICAL, WEST |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.klg.jclass.chart3d.JCChart3dLegendTemplate |
CONTINUOUS, RANGE_ALL, RANGE_DATA, STEPPED |
Fields inherited from interface com.klg.jclass.util.Changeable |
BASIC_CHANGE_MASK, LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JCChart3dLegend()
Default constructor. |
Method Summary | |
protected Dimension |
calcLegendSize(List itemList,
boolean vertical,
Dimension itemSize,
boolean[] hasTitle,
Dimension titleSize)
Calculates the size of a legend. |
protected boolean[] |
findBiggestLegendItem(List itemList,
boolean vertical,
Dimension maxItemSize,
Dimension titleSize)
Finds the biggest item in the legend. |
int |
getDistributionRange()
Gets the type of distribution range being used to display data in the legend (one of RANGE_DATA or RANGE_ALL ). |
int |
getGroupGap()
Gets the gap between groups of items in the legend (columns in a vertical legend, rows in a horizontal legend). |
int |
getHorizontalItemGap()
Gets the gap between the legend items in a horizontal legend. |
int |
getInsideItemGap()
Gets the gap between the symbol and text portions of a legend item. |
int |
getItemGap()
Gets the gap between the legend items depending on the orientation. |
com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator |
getLabelGenerator()
Gets the class specifying custom labels for the legend. |
List |
getLabels()
Gets the list of user specified label lists used to override default label generation. |
List |
getLabels(int dvIndex)
Gets the list of user specified labels being used to override the default label generation for the specified data view. |
int |
getLayoutStyle()
Gets the style being used for displaying data ranges in the legend. |
int |
getMarginGap()
Gets the gap between the edge of the legend and where the items start being layed out. |
int |
getVerticalItemGap()
Gets the gap between the legend items in a vertical legend. |
boolean |
isContinuousLayout()
For internal use only. |
void |
layoutContinuousLegendItems(List itemList,
boolean vertical,
Dimension maxItemSize,
Dimension legendSize,
boolean[] hasTitle,
Dimension titleSize)
Controls the layout of the items in a continuous legend. |
Dimension |
layoutLegend(List itemList,
boolean vertical,
Font useFont)
Overrides JCLegend 's layoutLegend() to layout the
legend items in a grid, calculating the overall size of the legend. |
protected void |
layoutSteppedLegendItems(List itemList,
boolean vertical,
Dimension maxItemSize,
Dimension legendSize,
boolean[] hasTitle,
Dimension titleSize)
Controls to layout of the items in a stepped legend. |
com.klg.jclass.util.legend.JCLegendItem |
pick(Point p)
Overrides parent legend pick to change default behaviour. |
protected void |
positionTitleItem(com.klg.jclass.util.legend.JCLegendItem thisItem,
int space,
int titlex,
int titley)
Positions the title item above the legend. |
void |
setAnchor(int a)
Sets the Anchor property, which determines the position of the
legend relative to the parent component's primary draw area. |
void |
setContinuousLayout(boolean continuous)
For internal use only. |
void |
setDistributionRange(int range)
Sets the type of distribution range to use to display data in the legend. |
void |
setGroupGap(int gap)
Sets the gap between groups of items in the legend (columns in a vertical legend, rows in a horizontal legend). |
void |
setHorizontalItemGap(int gap)
Sets the gap between the legend items in a horizontal legend. |
void |
setInsideItemGap(int gap)
Sets the gap between the symbol and text portions of a legend item. |
void |
setLabelGenerator(com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator generator)
Sets the class used to specify custom labels for the legend. |
void |
setLabels(int dvIndex,
List labels)
Sets a list of user specified labels used to override default label generation for the specified data view. |
void |
setLabels(List labels)
Sets the list of user specified label lists used to override default label generation. |
void |
setLayoutStyle(int style)
Sets the style to be used for displaying data ranges in the legend. |
void |
setMarginGap(int gap)
Sets the gap between the edge of the legend and where the items start being layed out. |
void |
setVerticalItemGap(int gap)
Sets the gap between the legend items in a vertical legend. |
Methods inherited from class com.klg.jclass.util.legend.JCLegend |
checkAnchor, drawLegendItem, getAnchor, getCellRendererPane, getChanged, getChanged, getDrawingArea, getDrawingArea, getGraphics, getImageMapInfo, getLegendItems, getLegendPopulator, getLegendRenderer, getOrientation, getPreferredSize, getSymbolSize, getTextRenderer, isBatched, isChanged, isChanged, isTitleItem, paintComponent, recalc, setChanged, setChanged, setGraphics, setImageMapInfo, setLegendPopulator, setLegendRenderer, setLocale, setOrientation, setPreferredSize, setUpLegendVariables, updateParent |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int layoutStyle
protected int distRange
protected com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator labelGenerator
protected List userLabels
protected int marginGap
protected int groupGap
protected int horizItemGap
protected int vertItemGap
protected int insideItemGap
protected boolean continuousLayout
protected int legendRows
protected int legendColumns
Constructor Detail |
public JCChart3dLegend()
Method Detail |
public void setAnchor(int a)
Anchor
property, which determines the position of the
legend relative to the parent component's primary draw area.
setAnchor
in class JCLegend
a
- The new anchor. Must be one of NORTH
,
SOUTH
, EAST
, WEST
,
NORTHWEST
, SOUTHWEST
, NORTHEAST
, or
SOUTHEAST
public void setLayoutStyle(int style)
STEPPED
.
style
- The range style to usepublic int getLayoutStyle()
CONTINUOUS
or STEPPED
.
getLayoutStyle
in interface JCChart3dLegendTemplate
public void setDistributionRange(int range)
RANGE_DATA
or RANGE_ALL
.
RANGE_DATA
constrains the legend data ranges to the minimum and
maximum of the data in the chart. RANGE_ALL
ensures that all
data ranges are included.
range
- The new distribution range typepublic int getDistributionRange()
RANGE_DATA
or RANGE_ALL
).
RANGE_DATA
constrains the legend data ranges to the minimum and
maximum of the data in the chart. RANGE_ALL ensures that all
data ranges are included.
getDistributionRange
in interface JCChart3dLegendTemplate
public void setLabelGenerator(com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator generator)
SCATTER
charts.
generator
- A class implementing the
JCChart3dLegendLabelGenerator
interfacepublic com.klg.jclass.chart3d.JCChart3dLegendLabelGenerator getLabelGenerator()
getLabelGenerator
in interface JCChart3dLegendTemplate
JCChart3dLegendLabelGenerator
interface that is being used to specify legend labelspublic void setLabels(List labels)
String
or JCMultiFieldString
objects) to represent the data view in the legend.
A null value in the main List indicates that there are no legend labels specified for the data view at that index. A null value for the property indicates that no legend labels have been specified for any data view.
If the LabelGenerator
property is set, this property is ignored.
labels
- the list of user specified label listspublic List getLabels()
String
or JCMultiFieldString
objects) to be used for the data view.
getLabels
in interface JCChart3dLegendTemplate
public void setLabels(int dvIndex, List labels)
String
or
JCMultiFieldString
objects). A null value indicates that no
override labels have been specified for the specified data view.
If the LabelGenerator
property is set, this property is ignored.
dvIndex
- the data view labels are being attached tolabels
- the list of user specified labelspublic List getLabels(int dvIndex)
String
or
JCMultiFieldString
objects). A null
value indicates that no override labels have been specified
for the specified data view.
dvIndex
- the data view that the labels are being requested for
public void setMarginGap(int gap)
gap
- the margin gappublic int getMarginGap()
public void setGroupGap(int gap)
gap
- the group gappublic int getGroupGap()
public int getItemGap()
getItemGap
in interface JCChart3dLegendTemplate
public void setHorizontalItemGap(int gap)
gap
- the item gappublic int getHorizontalItemGap()
public void setVerticalItemGap(int gap)
gap
- the item gappublic int getVerticalItemGap()
public void setInsideItemGap(int gap)
gap
- the inside item gappublic int getInsideItemGap()
public void setContinuousLayout(boolean continuous)
CONTINUOUS
layout is forced to a STEPPED
layout.)
setContinuousLayout
in interface JCChart3dLegendTemplate
continuous
- Is the layout actually continuous?public boolean isContinuousLayout()
true
if layout really is
continuous. (In some cases, CONTINUOUS
layout is forced to
behave like a STEPPED
layout.)
isContinuousLayout
in interface JCChart3dLegendTemplate
true
if the layout is really continuouspublic Dimension layoutLegend(List itemList, boolean vertical, Font useFont)
JCLegend
's layoutLegend()
to layout the
legend items in a grid, calculating the overall size of the legend. This is
accomplished by filling in the dim
, pos
,
textPos
, and symPos
member of each
JCLegendItem
instance in the legend vector. The
pickRectangle
member is also filled in.
layoutLegend
in class JCLegend
itemList
- The legend vector. It contains a number of group vectors.
Each group vector contains the legend items (JCLegendItem
instances) for that group.vertical
- true
if a vertical legend; false
if horizontaluseFont
- the font for the legend
protected boolean[] findBiggestLegendItem(List itemList, boolean vertical, Dimension maxItemSize, Dimension titleSize)
itemList
- the list of items to layoutvertical
- true
if the legend is verticalmaxItemSize
- the size of the largest legend item, to be filled in by
this methodtitleSize
- the size of the title item, to be filled in by this
method
true
if legend has a title; false
otherwiseprotected Dimension calcLegendSize(List itemList, boolean vertical, Dimension itemSize, boolean[] hasTitle, Dimension titleSize)
itemList
- the list of items to layoutvertical
- true
if the legend is verticalitemSize
- the size of the largest legend itemhasTitle
- true
of this list of legend items contains a
title itemtitleSize
- the size of the title item
protected void layoutSteppedLegendItems(List itemList, boolean vertical, Dimension maxItemSize, Dimension legendSize, boolean[] hasTitle, Dimension titleSize)
itemList
- the list of items to layoutvertical
- true
if the legend is verticalmaxItemSize
- the size of the largest legend itemlegendSize
- the size of the legendhasTitle
- true
of this list of legend items contains a
title itemtitleSize
- the size of the title itempublic void layoutContinuousLegendItems(List itemList, boolean vertical, Dimension maxItemSize, Dimension legendSize, boolean[] hasTitle, Dimension titleSize)
itemList
- the list of items to layoutvertical
- true
if the legend is verticalmaxItemSize
- the size of the largest legend itemlegendSize
- the size of the legendhasTitle
- true
if this list of legend items contains a
title itemtitleSize
- the size of the title itemprotected void positionTitleItem(com.klg.jclass.util.legend.JCLegendItem thisItem, int space, int titlex, int titley)
thisItem
- the legend item containing the legend titlespace
- the space availabletitlex
- the x position of space availabletitley
- the y position of space availablepublic com.klg.jclass.util.legend.JCLegendItem pick(Point p)
pick
in class JCLegend
p
- The point at which to pick
JCLegendItem
instance representing the picked point.
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |