|
|||||||||
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.ChartText
com.quinncurtis.chart2djava.ChartLabel
com.quinncurtis.chart2djava.NumericLabel
public class NumericLabel
The NumericLabel class is used to format floating point numbers as strings and position in a chart.
Field Summary |
---|
Constructor Summary | |
---|---|
NumericLabel()
The default NumericLabel constructor. |
|
NumericLabel(java.awt.Font tfont,
int nnumformat,
int ndecimal)
This method initializes an ChartText using the specified font, numeric format and decimal precision. |
|
NumericLabel(int nnumformat,
int ndecimal)
This method initializes an ChartText using the specified numeric format and decimal precision. |
|
NumericLabel(PhysicalCoordinates transform)
This constructor creates a new NumericLabel object using the specified scale. |
|
NumericLabel(PhysicalCoordinates transform,
java.awt.Font tfont,
double initialvalue1,
double x,
double y,
int npostype,
int nnumformat,
int ndecimal)
This method initializes an Text using the specified scale, font, initial value, position, position type, format and decimal precision. |
|
NumericLabel(PhysicalCoordinates transform,
java.awt.Font tfont,
double initialvalue1,
double x,
double y,
int npostype,
int nnumformat,
int ndecimal,
int xjust,
int yjust,
double rotation)
This method initializes an NumericLabel using the specified scale, font, initial value, position, position type, format, decimal precision, justification and rotation. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns an object that is a clone of this NumericLabel object. |
void |
copy(NumericLabel source)
Copies the source NumericLabel object. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
int |
errorCheck(int nerror)
Checks the NumericLabel object for common errors. |
int |
getDecimalPos()
Returns the number of digits to the right of the decimal for the numeric label. |
int |
getNumericFormat()
Returns the numeric format of the numeric label. |
double |
getNumericValue()
Returns the numeric value of the numeric label. |
static java.lang.String |
getNumStrFormatPostfix()
Returns the business format postfix characters. |
java.lang.String |
getPostfixString()
Get the postfix string for the label. |
java.lang.String |
getTextString()
This method formats the current numeric value, stores the result in the textString field of the parent ChartText object, and returns the formatted string. |
void |
makeLabel()
This method formats the current numeric value and stores the result in the textString field of the parent ChartText object. |
void |
setDecimalPos(int ndecplace)
Sets the number of digits to the right of the decimal for the numeric label. |
void |
setNumericFormat(int nformat)
Sets the numeric format of the numeric label. |
void |
setNumericValue(double rvalue)
Sets the numeric value of the numeric label. |
static void |
setNumStrFormatPostfix(java.lang.String bformat)
Sets the business format postfix characters. |
void |
setPostfixString(java.lang.String value)
Set the postfix string for the label. |
Methods inherited from class com.quinncurtis.chart2djava.ChartLabel |
---|
copy, setLabels, TypeSafeVectorCopy |
Methods inherited from class com.quinncurtis.chart2djava.ChartText |
---|
addNewLineTextString, checkIntersection, copy, drawText, drawTextBox, getLineLeading, getMultilineSubstring, getNumLines, getResizedTextFont, getTextBgColor, getTextBgMode, getTextBox, getTextBoxColor, getTextBoxMode, getTextDimension, getTextFont, getTextMaxSizeY, getTextNudge, getTextRotation, getTextSizeX, getTextSizeY, getXJust, getYJust, initChartText, preCalcTextBoundingBox, setLineLeading, setResizedTextFont, setTextBgColor, setTextBgMode, setTextBoxColor, setTextBoxMode, setTextFont, setTextNudge, setTextNudge, setTextRotation, setTextString, setXJust, setYJust, TypeSafeVectorCopy |
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 NumericLabel()
public NumericLabel(java.awt.Font tfont, int nnumformat, int ndecimal)
tfont
- A reference to a Font object.nnumformat
- Specifies the numeric format of the label. Use one of the numeric format
constants : DECIMALFORMAT, SCIENTIFICFORMAT, BUSINESSFORMAT, ENGINEERINGFORMAT, PERCENTFORMAT,
CURRENCYBUSINESSFORMAT, CURRENCYFORMAT and EXPONENTFORMAT.ndecimal
- The number of digits to display to the right of the decimal point.public NumericLabel(int nnumformat, int ndecimal)
nnumformat
- Specifies the numeric format of the label. Use one of the numeric format
constants : DECIMALFORMAT, SCIENTIFICFORMAT, BUSINESSFORMAT, ENGINEERINGFORMAT, PERCENTFORMAT,
CURRENCYBUSINESSFORMAT, CURRENCYFORMAT and EXPONENTFORMAT.ndecimal
- The number of digits to display to the right of the decimal point.public NumericLabel(PhysicalCoordinates transform)
transform
- The text object is placed in the coordinate system defined by transform.public NumericLabel(PhysicalCoordinates transform, java.awt.Font tfont, double initialvalue1, double x, double y, int npostype, int nnumformat, int ndecimal)
transform
- Places the text in the coordinate system defined by transform.tfont
- A reference to a Font object.initialvalue1
- The initial value of the numeric label.x
- Specifies the x-value of the text positiony
- Specifies the y-value of the text positionnpostype
- Specifies the if the position of the text is specified in physical coordinates,
normalized coordinates or window device coordinates. Use one of the position constants:DEV_POS,PHYS_POS,
NORM_GRAPH_POS,NORM_PLOT_POS.nnumformat
- Specifies the numeric format of the label. Use one of the numeric format
constants : DECIMALFORMAT, SCIENTIFICFORMAT, BUSINESSFORMAT, ENGINEERINGFORMAT, PERCENTFORMAT,
CURRENCYBUSINESSFORMAT, CURRENCYFORMAT and EXPONENTFORMAT.ndecimal
- The number of digits to display to the right of the decimal point.public NumericLabel(PhysicalCoordinates transform, java.awt.Font tfont, double initialvalue1, double x, double y, int npostype, int nnumformat, int ndecimal, int xjust, int yjust, double rotation)
transform
- Places the text in the coordinate system defined by transform.tfont
- A reference to a Font object.initialvalue1
- The initial value of the numeric label.x
- Specifies the x-value of the text positiony
- Specifies the y-value of the text positionnpostype
- Specifies the if the position of the text is specified in physical coordinates,
normalized coordinates or window device coordinates. Use one of the position constants:DEV_POS,PHYS_POS,
NORM_GRAPH_POS,NORM_PLOT_POS.nnumformat
- Specifies the numeric format of the label. Use one of the numeric format
constants : DECIMALFORMAT, SCIENTIFICFORMAT, BUSINESSFORMAT, ENGINEERINGFORMAT, PERCENTFORMAT,
CURRENCYBUSINESSFORMAT, CURRENCYFORMAT and EXPONENTFORMAT.ndecimal
- The number of digits to display to the right of the decimal point.xjust
- Specifies the horizontal justification of the text. Use one of the text
justification constants: JUSTIFY_MIN,JUSTIFY_CENTER orJUSTIFY_MAX.yjust
- Specifies the vertical justification of the text. Use one of the text
justification constants: JUSTIFY_MIN,JUSTIFY_CENTER orJUSTIFY_MAX.rotation
- The rotation (-360 to 360 degrees) of the text in the normal viewing plane.Method Detail |
---|
public java.lang.Object clone()
clone
in class ChartText
public void copy(NumericLabel source)
source
- The source NumericLabel object.public void draw(java.awt.Graphics2D g2)
draw
in class ChartText
g2
- The graphics context.public int errorCheck(int nerror)
errorCheck
in class ChartLabel
nerror
- Current error state
public int getDecimalPos()
public int getNumericFormat()
public double getNumericValue()
public static java.lang.String getNumStrFormatPostfix()
public java.lang.String getPostfixString()
public java.lang.String getTextString()
getTextString
in class ChartText
public void makeLabel()
makeLabel
in class ChartLabel
public void setDecimalPos(int ndecplace)
ndecplace
- Sets the number of digits to the right of the decimal for the numeric label.public void setNumericFormat(int nformat)
nformat
- Sets the numeric format of the numeric label.public void setNumericValue(double rvalue)
rvalue
- Sets the numeric value of the numeric label.public static void setNumStrFormatPostfix(java.lang.String bformat)
bformat
- Specifies the business format postfix characters. Use the
string format: "'thousands','millions','billions','trillions>'.public void setPostfixString(java.lang.String value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |