|
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.util.legend.JCGridLegend
JCGridLegend
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 | |
int[] |
colWidths
|
protected int |
groupGap
|
protected int |
insideItemGap
|
protected int |
itemGap
|
protected int |
marginGap
|
int[] |
rowFirstLineHeights
|
int[] |
rowHeights
|
int[] |
strWidths
|
int[] |
symWidths
|
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.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 | |
JCGridLegend()
|
Method Summary | |
Dimension |
calcLegendSize(boolean vert)
Calculates the size of the legend based on the height and width of rows and columns. |
void |
fillSizeArrays(List itemList,
boolean vert,
Font useFont)
Cacluates the size of each row and column. |
int |
getGroupGap()
Gets the gap between the groups of items in the legend (for example, the columns/rows associated with a data view). |
int |
getInsideItemGap()
Gets the gap between the symbol and text portions of a legend item. |
int |
getItemGap()
Gets the gap between the legend items in the same group. |
int |
getMarginGap()
Gets the gap between the edge of the legend and where the items start being layed out. |
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. |
void |
layoutLegendItems(List itemList,
boolean vert)
Lays out the legend items from the legend vector by calculating their position within the legend and filling that in the JCLegendItem instances that define the legend item. |
Point |
positionItemSymbol(boolean vertical,
com.klg.jclass.util.legend.JCLegendItem thisItem,
Dimension boxDim,
Point startPos)
Positions an legend item's symbol component. |
Point |
positionItemText(boolean vertical,
com.klg.jclass.util.legend.JCLegendItem thisItem,
Dimension boxDim,
Point startPos)
|
void |
setGroupGap(int gap)
Sets the gap between the groups of items in the legend (for example, the columns/rows associated with a data view). |
void |
setInsideItemGap(int gap)
Sets the gap between the symbol and text portions of a legend item. |
void |
setItemGap(int gap)
Sets the gap between the legend items in the same group. |
void |
setMarginGap(int gap)
Sets the gap between the edge of the legend and where the items start being layed out. |
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, pick, recalc, setAnchor, 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 |
public int[] rowHeights
public int[] rowFirstLineHeights
public int[] colWidths
public int[] symWidths
public int[] strWidths
protected int marginGap
protected int itemGap
protected int insideItemGap
protected int groupGap
Constructor Detail |
public JCGridLegend()
Method Detail |
public void setMarginGap(int gap)
gap
- the margin gappublic int getMarginGap()
public void setItemGap(int gap)
gap
- the item gappublic int getItemGap()
public void setInsideItemGap(int gap)
gap
- the inside item gappublic int getInsideItemGap()
public void setGroupGap(int gap)
gap
- the group gappublic int getGroupGap()
public 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, which contains a number of group
vectors; each group vector contains the legend items
(JCLegendItem
instances) for that groupvertical
- true
if a vertical legend, false
if a horizontal legenduseFont
- the font for the legend
public void fillSizeArrays(List itemList, boolean vert, Font useFont)
itemList
- the legend vector of groups and itemvert
- true
if a vertical legend, false
if a
horizontal legenduseFont
- the font for the legendpublic Dimension calcLegendSize(boolean vert)
vert
- true
if a vertical legend, false
if a
horizontal legend
public void layoutLegendItems(List itemList, boolean vert)
JCLegendItem
instances that define the legend item.
itemList
- the legend vector of groups and itemsvert
- true
if a vertical legend, false
if
a horizontal legendpublic Point positionItemSymbol(boolean vertical, com.klg.jclass.util.legend.JCLegendItem thisItem, Dimension boxDim, Point startPos)
vertical
- true
for a vertical legend; false
for a horizontal legendthisItem
- the legend item containing the symbol to be positionedboxDim
- the area to be positioned instartPos
- the position within the item's area to start positioning at
public Point positionItemText(boolean vertical, com.klg.jclass.util.legend.JCLegendItem thisItem, Dimension boxDim, Point startPos)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |