Java Code Examples for org.jfree.data.contour.ContourDataset#getXValue()

The following examples show how to use org.jfree.data.contour.ContourDataset#getXValue() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StandardContourToolTipGenerator.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param data  the dataset.
 * @param item  the item index (zero-based).
 *
 * @return The tooltip text.
 */
@Override
public String generateToolTip(ContourDataset data, int item) {

    double x = data.getXValue(0, item);
    double y = data.getYValue(0, item);
    double z = data.getZValue(0, item);
    String xString;

    if (data.isDateAxis(0)) {
        SimpleDateFormat formatter
            = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        StringBuffer strbuf = new StringBuffer();
        strbuf = formatter.format(
            new Date((long) x), strbuf, new java.text.FieldPosition(0)
        );
        xString = strbuf.toString();
    }
    else {
        xString = this.valueForm.format(x);
    }
    if (!Double.isNaN(z)) {
        return "X: " + xString
               + ", Y: " + this.valueForm.format(y)
               + ", Z: " + this.valueForm.format(z);
    }
    else {
        return "X: " + xString
             + ", Y: " + this.valueForm.format(y)
             + ", Z: no data";
    }

}
 
Example 2
Source File: StandardContourToolTipGenerator.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param data  the dataset.
 * @param item  the item index (zero-based).
 *
 * @return The tooltip text.
 */
@Override
public String generateToolTip(ContourDataset data, int item) {

    double x = data.getXValue(0, item);
    double y = data.getYValue(0, item);
    double z = data.getZValue(0, item);
    String xString;

    if (data.isDateAxis(0)) {
        SimpleDateFormat formatter
            = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        StringBuffer strbuf = new StringBuffer();
        strbuf = formatter.format(
            new Date((long) x), strbuf, new java.text.FieldPosition(0)
        );
        xString = strbuf.toString();
    }
    else {
        xString = this.valueForm.format(x);
    }
    if (!Double.isNaN(z)) {
        return "X: " + xString
               + ", Y: " + this.valueForm.format(y)
               + ", Z: " + this.valueForm.format(z);
    }
    else {
        return "X: " + xString
             + ", Y: " + this.valueForm.format(y)
             + ", Z: no data";
    }

}
 
Example 3
Source File: StandardContourToolTipGenerator.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param data  the dataset.
 * @param item  the item index (zero-based).
 *
 * @return The tooltip text.
 */
@Override
public String generateToolTip(ContourDataset data, int item) {

    double x = data.getXValue(0, item);
    double y = data.getYValue(0, item);
    double z = data.getZValue(0, item);
    String xString;

    if (data.isDateAxis(0)) {
        SimpleDateFormat formatter
            = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        StringBuffer strbuf = new StringBuffer();
        strbuf = formatter.format(
            new Date((long) x), strbuf, new java.text.FieldPosition(0)
        );
        xString = strbuf.toString();
    }
    else {
        xString = this.valueForm.format(x);
    }
    if (!Double.isNaN(z)) {
        return "X: " + xString
               + ", Y: " + this.valueForm.format(y)
               + ", Z: " + this.valueForm.format(z);
    }
    else {
        return "X: " + xString
             + ", Y: " + this.valueForm.format(y)
             + ", Z: no data";
    }

}
 
Example 4
Source File: StandardContourToolTipGenerator.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param data  the dataset.
 * @param item  the item index (zero-based).
 *
 * @return The tooltip text.
 */
@Override
public String generateToolTip(ContourDataset data, int item) {

    double x = data.getXValue(0, item);
    double y = data.getYValue(0, item);
    double z = data.getZValue(0, item);
    String xString;

    if (data.isDateAxis(0)) {
        SimpleDateFormat formatter
            = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        StringBuffer strbuf = new StringBuffer();
        strbuf = formatter.format(
            new Date((long) x), strbuf, new java.text.FieldPosition(0)
        );
        xString = strbuf.toString();
    }
    else {
        xString = this.valueForm.format(x);
    }
    if (!Double.isNaN(z)) {
        return "X: " + xString
               + ", Y: " + this.valueForm.format(y)
               + ", Z: " + this.valueForm.format(z);
    }
    else {
        return "X: " + xString
             + ", Y: " + this.valueForm.format(y)
             + ", Z: no data";
    }

}
 
Example 5
Source File: StandardContourToolTipGenerator.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param data  the dataset.
 * @param item  the item index (zero-based).
 *
 * @return The tooltip text.
 */
public String generateToolTip(ContourDataset data, int item) {

    double x = data.getXValue(0, item);
    double y = data.getYValue(0, item);
    double z = data.getZValue(0, item);
    String xString = null;

    if (data.isDateAxis(0)) {
        SimpleDateFormat formatter 
            = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        StringBuffer strbuf = new StringBuffer();
        strbuf = formatter.format(
            new Date((long) x), strbuf, new java.text.FieldPosition(0)
        );
        xString = strbuf.toString();
    }
    else {
        xString = this.valueForm.format(x);
    }
    if (!Double.isNaN(z)) {
        return "X: " + xString
               + ", Y: " + this.valueForm.format(y)
               + ", Z: " + this.valueForm.format(z);
    }
    else {
        return "X: " + xString
             + ", Y: " + this.valueForm.format(y)
             + ", Z: no data";
    }

}
 
Example 6
Source File: StandardContourToolTipGenerator.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param data  the dataset.
 * @param item  the item index (zero-based).
 *
 * @return The tooltip text.
 */
@Override
public String generateToolTip(ContourDataset data, int item) {

    double x = data.getXValue(0, item);
    double y = data.getYValue(0, item);
    double z = data.getZValue(0, item);
    String xString;

    if (data.isDateAxis(0)) {
        SimpleDateFormat formatter
            = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        StringBuffer strbuf = new StringBuffer();
        strbuf = formatter.format(
            new Date((long) x), strbuf, new java.text.FieldPosition(0)
        );
        xString = strbuf.toString();
    }
    else {
        xString = this.valueForm.format(x);
    }
    if (!Double.isNaN(z)) {
        return "X: " + xString
               + ", Y: " + this.valueForm.format(y)
               + ", Z: " + this.valueForm.format(z);
    }
    else {
        return "X: " + xString
             + ", Y: " + this.valueForm.format(y)
             + ", Z: no data";
    }

}
 
Example 7
Source File: StandardContourToolTipGenerator.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Generates a tooltip text item for a particular item within a series.
 *
 * @param data  the dataset.
 * @param item  the item index (zero-based).
 *
 * @return The tooltip text.
 */
@Override
public String generateToolTip(ContourDataset data, int item) {

    double x = data.getXValue(0, item);
    double y = data.getYValue(0, item);
    double z = data.getZValue(0, item);
    String xString;

    if (data.isDateAxis(0)) {
        SimpleDateFormat formatter
            = new java.text.SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        StringBuffer strbuf = new StringBuffer();
        strbuf = formatter.format(
            new Date((long) x), strbuf, new java.text.FieldPosition(0)
        );
        xString = strbuf.toString();
    }
    else {
        xString = this.valueForm.format(x);
    }
    if (!Double.isNaN(z)) {
        return "X: " + xString
               + ", Y: " + this.valueForm.format(y)
               + ", Z: " + this.valueForm.format(z);
    }
    else {
        return "X: " + xString
             + ", Y: " + this.valueForm.format(y)
             + ", Z: no data";
    }

}