| Constructor: |
public StandardXYZToolTipGenerator() {
this(
DEFAULT_TOOL_TIP_FORMAT,
NumberFormat.getNumberInstance(),
NumberFormat.getNumberInstance(),
NumberFormat.getNumberInstance()
);
}
Creates a new tool tip generator using default number formatters for the
x, y and z-values. |
public StandardXYZToolTipGenerator(String formatString,
NumberFormat xFormat,
NumberFormat yFormat,
NumberFormat zFormat) {
super(formatString, xFormat, yFormat);
if (zFormat == null) {
throw new IllegalArgumentException("Null 'zFormat' argument.");
}
this.zFormat = zFormat;
}
Constructs a new tool tip generator using the specified number
formatters. Parameters:
formatString - the format string.
xFormat - the format object for the x values (null
not permitted).
yFormat - the format object for the y values (null
not permitted).
zFormat - the format object for the z values (null
not permitted).
|
public StandardXYZToolTipGenerator(String formatString,
DateFormat xFormat,
DateFormat yFormat,
DateFormat zFormat) {
super(formatString, xFormat, yFormat);
if (zFormat == null) {
throw new IllegalArgumentException("Null 'zFormat' argument.");
}
this.zDateFormat = zFormat;
}
Constructs a new tool tip generator using the specified date formatters. Parameters:
formatString - the format string.
xFormat - the format object for the x values (null
not permitted).
yFormat - the format object for the y values (null
not permitted).
zFormat - the format object for the z values (null
not permitted).
|
| Method from org.jfree.chart.labels.StandardXYZToolTipGenerator Detail: |
protected Object[] createItemArray(XYZDataset dataset,
int series,
int item) {
Object[] result = new Object[4];
result[0] = dataset.getSeriesKey(series).toString();
Number x = dataset.getX(series, item);
DateFormat xf = getXDateFormat();
if (xf != null) {
result[1] = xf.format(x);
}
else {
result[1] = getXFormat().format(x);
}
Number y = dataset.getY(series, item);
DateFormat yf = getYDateFormat();
if (yf != null) {
result[2] = yf.format(y);
}
else {
result[2] = getYFormat().format(y);
}
Number z = dataset.getZ(series, item);
if (this.zDateFormat != null) {
result[3] = this.zDateFormat.format(z);
}
else {
result[3] = this.zFormat.format(z);
}
return result;
}
Creates the array of items that can be passed to the
MessageFormat class for creating labels. |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof StandardXYZToolTipGenerator)) {
return false;
}
if (!super.equals(obj)) {
return false;
}
StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj;
if (!ObjectUtilities.equal(this.zFormat, that.zFormat)) {
return false;
}
if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat)) {
return false;
}
return true;
}
Tests this object for equality with an arbitrary object. |
public String generateLabelString(XYDataset dataset,
int series,
int item) {
String result = null;
Object[] items = createItemArray((XYZDataset) dataset, series, item);
result = MessageFormat.format(getFormatString(), items);
return result;
}
Generates a label string for an item in the dataset. |
public String generateToolTip(XYZDataset dataset,
int series,
int item) {
return generateLabelString(dataset, series, item);
}
Generates a tool tip text item for a particular item within a series. |
public DateFormat getZDateFormat() {
return this.zDateFormat;
}
Returns the date formatter for the z-values. |
public NumberFormat getZFormat() {
return this.zFormat;
}
Returns the number formatter for the z-values. |