public class SeriesLabel extends java.lang.Object implements ISeriesLabel
| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.swt.graphics.Color |
color
the series label color
|
private static int |
DEFAULT_COLOR
the default label color
|
private static org.eclipse.swt.graphics.Font |
DEFAULT_FONT
the default font
|
private static java.lang.String |
DEFAULT_FORMAT
the default label format
|
protected org.eclipse.swt.graphics.Font |
font
the series label font
|
private java.lang.String |
format
the format for series label
|
private java.lang.String[] |
formats
the formats for series labels
|
private boolean |
isVisible
the visibility state of series label
|
| Constructor and Description |
|---|
SeriesLabel()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
draw(org.eclipse.swt.graphics.GC gc,
int h,
int v,
double ySeriesValue,
int seriesIndex,
int alignment)
Draws series label.
|
org.eclipse.swt.graphics.Font |
getFont()
Gets the label font.
|
org.eclipse.swt.graphics.Color |
getForeground()
Gets the label color.
|
java.lang.String |
getFormat()
Gets the format for label.
|
java.lang.String[] |
getFormats()
Gets the formats for all data points.
|
private static boolean |
isDecimalFormat(java.lang.String text)
Gets the state indicating if decimal format is given.
|
boolean |
isVisible()
Gets the label visibility state.
|
void |
setFont(org.eclipse.swt.graphics.Font font)
Sets the label font.
|
void |
setForeground(org.eclipse.swt.graphics.Color color)
Sets the label color.
|
void |
setFormat(java.lang.String format)
Sets the decimal format
DecimalFormat or/plus plain string. |
void |
setFormats(java.lang.String[] formats)
Sets the formats for all data points.
|
void |
setVisible(boolean visible)
Sets the label visibility state.
|
private boolean isVisible
protected org.eclipse.swt.graphics.Font font
protected org.eclipse.swt.graphics.Color color
private java.lang.String format
private java.lang.String[] formats
private static final int DEFAULT_COLOR
private static final org.eclipse.swt.graphics.Font DEFAULT_FONT
private static final java.lang.String DEFAULT_FORMAT
public java.lang.String getFormat()
ISeriesLabelgetFormat in interface ISeriesLabelpublic void setFormat(java.lang.String format)
ISeriesLabelDecimalFormat or/plus plain string.
If formats have been set with setFormats(String[]), the format set with this method will be ignored.
If null is given, default format "#.###########" will be set.
setFormat in interface ISeriesLabelformat - the formatpublic java.lang.String[] getFormats()
ISeriesLabelgetFormats in interface ISeriesLabelpublic void setFormats(java.lang.String[] formats)
ISeriesLabelsetFormats in interface ISeriesLabelformats - the formatspublic org.eclipse.swt.graphics.Color getForeground()
ISeriesLabelgetForeground in interface ISeriesLabelpublic void setForeground(org.eclipse.swt.graphics.Color color)
ISeriesLabelsetForeground in interface ISeriesLabelcolor - the label colorpublic org.eclipse.swt.graphics.Font getFont()
ISeriesLabelgetFont in interface ISeriesLabelpublic void setFont(org.eclipse.swt.graphics.Font font)
ISeriesLabelsetFont in interface ISeriesLabelfont - the label fontpublic boolean isVisible()
ISeriesLabelisVisible in interface ISeriesLabelpublic void setVisible(boolean visible)
ISeriesLabelsetVisible in interface ISeriesLabelvisible - the label visibility stateprotected void draw(org.eclipse.swt.graphics.GC gc,
int h,
int v,
double ySeriesValue,
int seriesIndex,
int alignment)
gc - the GC objecth - the horizontal coordinate to draw labelv - the vertical coordinate to draw labelySeriesValue - the Y series valueseriesIndex - the series indexalignment - the alignment of label position (SWT.CENTER or SWT.BOTTOM)private static boolean isDecimalFormat(java.lang.String text)
text - the text to be checked