|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart2djava.ChartObj
com.quinncurtis.chart2djava.GraphObj
com.quinncurtis.chart2djava.Legend
com.quinncurtis.chart2djava.StandardLegend
public class StandardLegend
The StandardLegend class manages a collection LegendItem objects that represent legend items.
Field Summary |
---|
Constructor Summary | |
---|---|
StandardLegend()
The default Legend constructor. |
|
StandardLegend(double rx,
double ry,
ChartAttribute attrib,
int nlayout1mode)
an StandardLegend constructor that initializes the position, size, color attributes, and layout mode of the legend. |
|
StandardLegend(double rx,
double ry,
double rwidth,
double rheight,
ChartAttribute attrib,
int nlayout1mode)
A StandardLegend constructor that initializes the position, size, color attributes, and layout mode of the legend. |
Method Summary | |
---|---|
int |
addLegendItem(LegendItem legenditem)
Add a legend item to the current legend, using another legend item as the source. |
int |
addLegendItem(java.lang.String stext,
ChartPlot chartobj,
int ngroup,
java.awt.Font thefont)
Add a legend item to the current legend, specifying the legend item text, symbol, the associated PlotObj object, the group number of the attributes to copy in the PlotObject, and font. |
int |
addLegendItem(java.lang.String stext,
java.awt.geom.GeneralPath symbolshape,
ChartAttribute attrib,
java.awt.Font thefont)
Add a legend item to the current legend, specifying the legend item text, symbol, attributes and font. |
int |
addLegendItem(java.lang.String stext,
java.awt.geom.GeneralPath symbolshape,
GraphObj chartobj,
java.awt.Font thefont)
Add a legend item to the current legend, specifying the legend item text, symbol, attributes and font. |
int |
addLegendItem(java.lang.String stext,
GraphObj chartobj,
java.awt.Font thefont)
Add a legend item to the current legend, specifying the legend item text, symbol, the associated GraphObj object, and font. |
int |
addLegendItem(java.lang.String stext,
int nsymbol,
ChartAttribute attrib,
java.awt.Font thefont)
Add a legend item to the current legend, specifying the legend item text, symbol, attributes and font. |
int |
addLegendItem(java.lang.String stext,
int nsymbol,
ChartPlot chartobj,
int ngroup,
java.awt.Font thefont)
Add a legend item to the current legend, specifying the legend item text, symbol, the associated PlotObj object, the group number of the attributes to copy in the PlotObject, and font. |
int |
addLegendItem(java.lang.String stext,
int nsymbol,
GraphObj chartobj,
java.awt.Font thefont)
Add a legend item to the current legend, specifying the legend item text, symbol, the associated GraphObj object, and font. |
boolean |
checkIntersection(ChartPoint2D testpoint,
NearestPointData np)
The checkIntersection method. |
java.lang.Object |
clone()
Returns an object that is a clone of this StandardLegend object. |
void |
copy(StandardLegend source)
Copies the source legend object. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the legend object for common errors. |
double |
getLayoutMode()
Returns the legend item layout mode. |
LegendItem |
getLegendItem(int itemnum)
Returns the LegendItem object at the specified index. |
int |
getNumLegendItems()
Returns the number of legend items in the current legend. |
void |
setChartObjScale(PhysicalCoordinates transform)
Sets the reference to the PhysicalCoordinates object that the chart object is placed in. |
void |
setLayoutMode(int layout1mode)
Sets the legend item layout mode. |
void |
setLegendItem(LegendItem legenditem,
int itemnum)
Set an LegendItem object in the legendItems list. |
void |
setLegendItemUniformTextColor(java.awt.Color color)
Sets a uniform color for legend item text. |
Methods inherited from class com.quinncurtis.chart2djava.Legend |
---|
addLegendGeneralText, addLegendGeneralText, addLegendGeneralText, copy, getAutoSizeLegendRectangle, getHorizontalSpacing, getInnerLegendRectangle, getLegendBorderRect, getLegendGeneralText, getLegendHeight, getLegendWidth, getSize, getVerticalSpacing, initLegendPosition, setAutoSizeLegendRectangle, setHorizontalSpacing, setLegendBorderRect, setLegendHeight, setLegendWidth, setSize, setVerticalSpacing |
Methods inherited from class com.quinncurtis.chart2djava.ChartObj |
---|
copy, getChartObjIDCntr, getChartObjType, getThisChartObjID, TypeSafeVectorCopy |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StandardLegend()
public StandardLegend(double rx, double ry, ChartAttribute attrib, int nlayout1mode)
rx
- The x-position, in chart normalized coordinates, of the legend rectangle.ry
- The y-position, in chart normalized coordinates, of the legend rectangle.attrib
- Specifies the out1line color, out1line line style, and fill color for
the legend rectangle.nlayout1mode
- Specifies if the legend has a horizontal, or vertical layout. Use
one of the orientation constants: HORIZ_DIR (row major) or VERT_DIR (column major).public StandardLegend(double rx, double ry, double rwidth, double rheight, ChartAttribute attrib, int nlayout1mode)
rx
- The x-position, in chart normalized coordinates, of the legend rectangle.ry
- The y-position, in chart normalized coordinates, of the legend rectangle.rwidth
- The width, in chart normalized coordinates, of the legend rectangle.rheight
- The height, in chart normalized coordinates, of the legend rectangle.attrib
- Specifies the out1line color, out1line line style, and fill color for the
legend rectangle.nlayout1mode
- Specifies if the legend has a horizontal, or vertical layout. Use one
of the orientation constants: HORIZ_DIR (row major) or VERT_DIR (column major).Method Detail |
---|
public int addLegendItem(LegendItem legenditem)
legenditem
- Specifies the legend item that is the source.
public int addLegendItem(java.lang.String stext, ChartPlot chartobj, int ngroup, java.awt.Font thefont)
stext
- Specifies the text string for the legend item.chartobj
- The color and fill attributes for the legend item are copied from the
attributes of this Plot object.ngroup
- The group number of the attributes to copy in the associated Plot object.thefont
- Specifies the text font for the legend item.
public int addLegendItem(java.lang.String stext, java.awt.geom.GeneralPath symbolshape, ChartAttribute attrib, java.awt.Font thefont)
stext
- Specifies the text string for the legend item.symbolshape
- Specifies a user defined shape to use as the legend item symbol.attrib
- Specifies the ChartAttribute object to get the color and fill attributes of
the legend item.thefont
- Specifies the text font for the legend item.
public int addLegendItem(java.lang.String stext, java.awt.geom.GeneralPath symbolshape, GraphObj chartobj, java.awt.Font thefont)
stext
- Specifies the text string for the legend item.symbolshape
- Specifies a user defined shape to use as the legend item symbol.chartobj
- The color and fill attributes for the legend item are copied from
the attributes of this chart object.thefont
- Specifies the text font for the legend item.
public int addLegendItem(java.lang.String stext, GraphObj chartobj, java.awt.Font thefont)
stext
- Specifies the text string for the legend item.chartobj
- The color and fill attributes for the legend item are copied from the attributes
of this chart object.thefont
- Specifies the text font for the legend item.
public int addLegendItem(java.lang.String stext, int nsymbol, ChartAttribute attrib, java.awt.Font thefont)
stext
- Specifies the text string for the legend item.nsymbol
- Specifies the symbol for the legend item. Use one of the chart symbol
constants: NOSYMBOL, SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.attrib
- Specifies the ChartAttribute object to get the color and fill attributes
of the legend item.thefont
- Specifies the text font for the legend item.
public int addLegendItem(java.lang.String stext, int nsymbol, ChartPlot chartobj, int ngroup, java.awt.Font thefont)
stext
- Specifies the text string for the legend item.nsymbol
- Specifies the symbol for the legend item. Use one of the chart symbol constants:
NOSYMBOL, SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.chartobj
- The color and fill attributes for the legend item are copied from the attributes
of this Plot object.ngroup
- The group number of the attributes to copy in the associated Plot object.thefont
- Specifies the text font for the legend item.
public int addLegendItem(java.lang.String stext, int nsymbol, GraphObj chartobj, java.awt.Font thefont)
stext
- Specifies the text string for the legend item.nsymbol
- Specifies the symbol for the legend item. Use one of the chart symbol constants:
NOSYMBOL, SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.chartobj
- The color and fill attributes for the legend item are copied from the attributes
of this chart object.thefont
- Specifies the text font for the legend item.
public boolean checkIntersection(ChartPoint2D testpoint, NearestPointData np)
checkIntersection
in class Legend
testpoint
- The test pointnp
- Nearest point information for data based objects.
public java.lang.Object clone()
clone
in class GraphObj
public void copy(StandardLegend source)
source
- The source legend object.public void draw(java.awt.Graphics2D g2)
draw
in class Legend
g2
- The graphics context.public int errorCheck(int nerror)
errorCheck
in class Legend
nerror
- Current error state
public double getLayoutMode()
public LegendItem getLegendItem(int itemnum)
itemnum
- The index of the LegendItem in the legendItems list.
public int getNumLegendItems()
public void setChartObjScale(PhysicalCoordinates transform)
setChartObjScale
in class Legend
transform
- A reference to the PhysicalCoordinates object that the chart object is placed inpublic void setLayoutMode(int layout1mode)
layout1mode
- Sets the legend layout mode. Use one of the orientation constants: HORIZ_DIR
(row major) or VERT_DIR (column major).public void setLegendItem(LegendItem legenditem, int itemnum)
legenditem
- The LegendItem that will override an existing LegendItem in the legendItems list.itemnum
- The index in the legendItems list where the LegendItem will be placed.public void setLegendItemUniformTextColor(java.awt.Color color)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |