Example usage for org.jfree.data.gantt Task getPercentComplete

List of usage examples for org.jfree.data.gantt Task getPercentComplete

Introduction

In this page you can find the example usage for org.jfree.data.gantt Task getPercentComplete.

Prototype

public Double getPercentComplete() 

Source Link

Document

Returns the percentage complete for this task.

Usage

From source file:org.jfree.data.gantt.TaskSeriesCollection.java

/**
 * Returns the percent complete for a given item.
 *
 * @param rowKey  the row key.//from  w w  w.java 2s.c  o  m
 * @param columnKey  the column key.
 *
 * @return The percent complete.
 */
@Override
public Number getPercentComplete(Comparable rowKey, Comparable columnKey) {
    Number result = null;
    int row = getRowIndex(rowKey);
    TaskSeries series = (TaskSeries) this.data.get(row);
    Task task = series.get(columnKey.toString());
    if (task != null) {
        result = task.getPercentComplete();
    }
    return result;
}

From source file:org.jfree.data.gantt.TaskSeriesCollection.java

/**
 * Returns the percentage complete value of a sub-interval for a given item.
 *
 * @param rowKey  the row key.//from  w  w w .  ja  v  a2s .c o m
 * @param columnKey  the column key.
 * @param subinterval  the sub-interval.
 *
 * @return The percent complete value (possibly <code>null</code>).
 */
@Override
public Number getPercentComplete(Comparable rowKey, Comparable columnKey, int subinterval) {
    Number result = null;
    int row = getRowIndex(rowKey);
    TaskSeries series = (TaskSeries) this.data.get(row);
    Task task = series.get(columnKey.toString());
    if (task != null) {
        Task sub = task.getSubtask(subinterval);
        if (sub != null) {
            result = sub.getPercentComplete();
        }
    }
    return result;
}