public class nUIChartLabel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LABEL_DECIMAL_PLACES
For numeric labels, decimal places to view (0 for
integer flooring)
|
static int |
DEFAULT_LABEL_LEADING_ZERO_PAD
For numeric labels, pad values with leading zeros
|
static java.lang.Character |
DEFAULT_LABEL_THOUSAND_SEPARATOR
When rendering large numbers, use this value as the
thousand separator.
|
Constructor and Description |
---|
nUIChartLabel()
Default chart label constructor
|
nUIChartLabel(int x,
int y)
nUIChart label constructor at a specific position without any
text
|
nUIChartLabel(java.lang.String text)
Default chart label constructor
|
nUIChartLabel(java.lang.String text,
float hint)
nUIChart label constructor with a position hint.
|
nUIChartLabel(java.lang.String text,
int x,
int y)
nUIChart label constructor with text at a specific position
|
Modifier and Type | Method and Description |
---|---|
int |
fontHeight()
Gets the height of the font used to draw this label.
|
int |
getDecimalPlaces()
Gets the maximum number of decimal places that will be displayed for this label.
|
int |
getHAlign()
Gets the horizontal alignment of this label.
|
int |
getLeadingZeroPad()
Gets the current number of leading zeroes that numeric values will be padded with.
|
java.lang.String |
getText()
Gets the text that will be rendered for this label.
|
int |
getVAlign()
Gets the vertical alignment of this label.
|
void |
render(boolean ref_halign,
boolean ref_valign)
Renders the label to the chart's graphics.
|
void |
setDecimalPlaces(int decimal_places)
Sets the number of displayable decimal places for this label's value.
|
void |
setHAlign(int halign)
Sets the horizontal alignment of this label.
|
void |
setLeadingZeroPad(int leading_zero_pad)
If you wish to add zeroes to the beginning of this data label,
then you can set the number required here.
|
void |
setText(float ftext)
Sets the value to display on this label.
|
void |
setText(int itext)
Sets the value to display on this label.
|
void |
setText(java.lang.String text)
Sets the value to display on this label.
|
void |
setVAlign(int valign)
Sets the vertical alignment of this label.
|
int |
stringWidth()
Gets the width of the text set for this label.
|
public static final int DEFAULT_LABEL_LEADING_ZERO_PAD
public static final int DEFAULT_LABEL_DECIMAL_PLACES
public static final java.lang.Character DEFAULT_LABEL_THOUSAND_SEPARATOR
public nUIChartLabel()
public nUIChartLabel(java.lang.String text)
text
- The string this label should displaypublic nUIChartLabel(java.lang.String text, int x, int y)
text
- The string this label should displaypublic nUIChartLabel(int x, int y)
public nUIChartLabel(java.lang.String text, float hint)
text
- The string this label should displayhint
- The string position hintpublic void setDecimalPlaces(int decimal_places)
decimal_places
- public int getDecimalPlaces()
public void setLeadingZeroPad(int leading_zero_pad)
leading_zero_pad
- public int getLeadingZeroPad()
public void setText(float ftext)
ftext
- the value to show, as a floating-point number.public void setText(int itext)
itext
- the value to show, as an integer.public void setText(java.lang.String text)
text
- the String to show.public void setHAlign(int halign)
nUIConstants
.halign
- the horizontal alignment to set.nUIConstants
public int getHAlign()
nUIConstants
.nUIConstants
public void setVAlign(int valign)
nUIConstants
.valign
- the vertical alignment to set.nUIConstants
public int getVAlign()
nUIConstants
.nUIConstants
public java.lang.String getText()
setInteger()
or setFloat()
), then the number will be
appropriately formatted.public int stringWidth()
public int fontHeight()
public void render(boolean ref_halign, boolean ref_valign)
nUIChartImage.renderDataLabels()