|
|||||||||
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.LegendItem
public class LegendItem
The LegendItem class contains the text and symbol used in displaying a single element of a chart legend.
Field Summary |
---|
Constructor Summary | |
---|---|
LegendItem()
The default LegendItem constructor. |
|
LegendItem(ChartText textitem,
GraphObj chartobj)
an LegendItem constructor creates a new object based on the source ChartText object, and the source nsymbol value. |
|
LegendItem(ChartText textitem,
int nsymbol)
The LegendItem constructor creates a new object based on the source ChartText object and the source nsymbol value. |
|
LegendItem(ChartText textitem,
int nsymbol,
GraphObj chartobj)
an LegendItem constructor creates a new object based on the source ChartText object, and the source nsymbol value. |
|
LegendItem(PhysicalCoordinates transform,
java.lang.String stext,
ChartPlot chartobj,
int ngroup,
java.awt.Font thefont)
an LegendItem constructor creates a new object based on the source chart scale, a text string, a symbol value, an GraphObj object, a group number, and an explicit font. |
|
LegendItem(PhysicalCoordinates transform,
java.lang.String stext,
GraphObj chartobj,
java.awt.Font thefont)
an LegendItem constructor creates a new object based on the source chart scale, a text string, a symbol value, an GraphObj object, and an explicit font. |
|
LegendItem(PhysicalCoordinates transform,
java.lang.String stext,
int nsymbol,
ChartAttribute attrib,
java.awt.Font thefont)
an LegendItem constructor creates a new object based on the source chart scale, a text string, a symbol value, an ChartAttribute object, and an explicit font. |
|
LegendItem(PhysicalCoordinates transform,
java.lang.String stext,
int nsymbol,
ChartPlot chartobj,
int ngroup,
java.awt.Font thefont)
an LegendItem constructor creates a new object based on the source chart scale, a text string, a symbol value, an GraphObj object, a group number, and an explicit font. |
|
LegendItem(PhysicalCoordinates transform,
java.lang.String stext,
int nsymbol,
GraphObj chartobj,
java.awt.Font thefont)
an LegendItem constructor creates a new object based on the source chart scale, a text string, a symbol value, an GraphObj object, and an explicit font. |
Method Summary | |
---|---|
boolean |
checkIntersection(ChartPoint2D testpoint,
NearestPointData np)
The checkIntersection method. |
java.lang.Object |
clone()
Returns an object that is a clone of this LegendItem object. |
void |
copy(LegendItem source)
Copies the source legend item object. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the legend item object for common errors. |
java.awt.Shape |
getLegendItemCustomShape()
Returns the user defined shape used by the ChartSymbol object used by the legend item. |
ChartSymbol |
getLegendItemSymbol()
Returns the ChartSymbol object used by the legend item. |
ChartText |
getLegendItemText()
Returns the ChartText object used by the legend item. |
double |
getResizeMultiplier()
Returns the resize multiplier used by the legend item. |
void |
setChartObjScale(PhysicalCoordinates transform)
Sets the reference to the PhysicalCoordinates object that the chart object is placed in. |
void |
setLegendItemCustomShape(java.awt.geom.GeneralPath symbolshape)
Initializes the ChartSymbol object used by the legend item for a user defined shape. |
void |
setLegendItemSymbol(ChartSymbol symbol)
Sets the ChartSymbol object used by the legend item. |
void |
setLegendItemText(ChartText text)
Sets the ChartText object used by the legend item. |
void |
setResizeMultiplier(double multiplier)
Sets the resize multiplier used by the legend item. |
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 LegendItem()
public LegendItem(ChartText textitem, GraphObj chartobj)
textitem
- A reference to an ChartText item used as the text for a legend item.chartobj
- A reference to an GraphObj object. The color of the legend item is copied out
of this object.public LegendItem(ChartText textitem, int nsymbol)
textitem
- A reference to an ChartText item used as the text for a legend item.nsymbol
- The symbol used in the legend item. Use one of the chart symbol constants: NOSYMBOL,
SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.public LegendItem(ChartText textitem, int nsymbol, GraphObj chartobj)
textitem
- A reference to an ChartText item used as the text for a legend item.nsymbol
- The symbol used in the legend item. Use one of the chart symbol constants: NOSYMBOL,
SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.chartobj
- A reference to an GraphObj object. The color of the legend item is copied out of this
object.public LegendItem(PhysicalCoordinates transform, java.lang.String stext, ChartPlot chartobj, int ngroup, java.awt.Font thefont)
transform
- The coordinate system for the new legend item object.stext
- A string used as the text for a legend item.chartobj
- A reference to an GraphObj object. The color of the legend item is
copied out of attributes for a particular group of this object.ngroup
- The group number of the GraphObj that the color for this legend item
is copied from.thefont
- A reference to the font that is to be used in the display of the legend item text.public LegendItem(PhysicalCoordinates transform, java.lang.String stext, GraphObj chartobj, java.awt.Font thefont)
transform
- The coordinate system for the new legend item object.stext
- A string used as the text for a legend item.chartobj
- A reference to an GraphObj object. The color of the legend item is copied
out of attributes of this object.thefont
- A reference to the font that is to be used in the display of the legend item text.public LegendItem(PhysicalCoordinates transform, java.lang.String stext, int nsymbol, ChartAttribute attrib, java.awt.Font thefont)
transform
- The coordinate system for the new legend item object.stext
- A string used as the text for a legend item.nsymbol
- The symbol used in the legend item. Use one of the chart symbol constants: NOSYMBOL,
SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.attrib
- A reference to an ChartAttribute object. The color of the legend item is copied out
of this object.thefont
- A reference to the font that is to be used in the display of the legend item text.public LegendItem(PhysicalCoordinates transform, java.lang.String stext, int nsymbol, ChartPlot chartobj, int ngroup, java.awt.Font thefont)
transform
- The coordinate system for the new legend item object.stext
- A string used as the text for a legend item.nsymbol
- The symbol used in the legend item. Use one of the chart symbol constants:
NOSYMBOL, SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.chartobj
- A reference to an GraphObj object. The color of the legend item is copied
out of attributes for a particular group of this object.ngroup
- The group number of the GraphObj that the color for this legend item is copied from.thefont
- A reference to the font that is to be used in the display of the legend item text.public LegendItem(PhysicalCoordinates transform, java.lang.String stext, int nsymbol, GraphObj chartobj, java.awt.Font thefont)
transform
- The coordinate system for the new legend item object.stext
- A string used as the text for a legend item.nsymbol
- The symbol used in the legend item. Use one of the chart symbol constants:
NOSYMBOL, SQUARE, TRIANGLE, DIAMOND, CROSS, PLUS, STAR, LINE, HBAR , VBAR, BAR3D, or CIRCLE.chartobj
- A reference to an GraphObj object. The color of the legend item is copied out
of attributes of this object.thefont
- A reference to the font that is to be used in the display of the legend item text.Method Detail |
---|
public boolean checkIntersection(ChartPoint2D testpoint, NearestPointData np)
checkIntersection
in class GraphObj
testpoint
- The test pointnp
- Nearest point information for data based objects.
public java.lang.Object clone()
clone
in class GraphObj
public void copy(LegendItem source)
source
- The source legend item object.public void draw(java.awt.Graphics2D g2)
draw
in class GraphObj
g2
- The graphics context.public int errorCheck(int nerror)
errorCheck
in class GraphObj
nerror
- Current error state
public java.awt.Shape getLegendItemCustomShape()
public ChartSymbol getLegendItemSymbol()
public ChartText getLegendItemText()
public double getResizeMultiplier()
getResizeMultiplier
in class GraphObj
public void setChartObjScale(PhysicalCoordinates transform)
setChartObjScale
in class GraphObj
transform
- A reference to the PhysicalCoordinates object that the chart object is placed inpublic void setLegendItemCustomShape(java.awt.geom.GeneralPath symbolshape)
symbolshape
- Specifies a user defined shape to use as the legend item symbol.public void setLegendItemSymbol(ChartSymbol symbol)
symbol
- Sets the ChartSymbol object used by the legend item.public void setLegendItemText(ChartText text)
text
- Sets the ChartText object used by the legend item.public void setResizeMultiplier(double multiplier)
setResizeMultiplier
in class GraphObj
multiplier
- Sets the resize multiplier used by the legend item.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |