當前位置: 首頁>>代碼示例>>Java>>正文


Java CategoryDataset.getRowKey方法代碼示例

本文整理匯總了Java中org.jfree.data.category.CategoryDataset.getRowKey方法的典型用法代碼示例。如果您正苦於以下問題:Java CategoryDataset.getRowKey方法的具體用法?Java CategoryDataset.getRowKey怎麽用?Java CategoryDataset.getRowKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.data.category.CategoryDataset的用法示例。


在下文中一共展示了CategoryDataset.getRowKey方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: generateURL

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
     * Generates a URL for a particular item within a series.
     *
     * @param dataset  the dataset.
     * @param series  the series index (zero-based).
     * @param category  the category index (zero-based).
     *
     * @return The generated URL.
     */
    public String generateURL(CategoryDataset dataset, int series, int category) {
        String url = this.prefix;
        Comparable seriesKey = dataset.getRowKey(series);
        Comparable categoryKey = dataset.getColumnKey(category);
        boolean firstParameter = url.indexOf("?") == -1;
        url += firstParameter ? "?" : "&";
//        try {
            url += this.seriesParameterName + "=" 
                + URLEncoder.encode(seriesKey.toString());
                // + URLEncoder.encode(seriesKey.toString(), "UTF-8");  Not supported in JDK 1.2.2
//        }
//        catch (UnsupportedEncodingException uee) {
//            url += this.seriesParameterName + "=" + seriesKey.toString();
//        }
//        try {
            url += "&" + this.categoryParameterName + "=" 
                + URLEncoder.encode(categoryKey.toString());
                //+ URLEncoder.encode(categoryKey.toString(), "UTF-8");  not supported in JDK 1.2.2
//        }
//        catch (UnsupportedEncodingException uee) {
//            url += "&" + this.categoryParameterName + "=" + categoryKey.toString();
//        }
        return url;
    }
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:34,代碼來源:StandardCategoryURLGenerator.java

示例2: createItemArray

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Creates the array of items that can be passed to the {@link MessageFormat} class
 * for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return the items (never <code>null</code>).
 */
protected Object[] createItemArray(CategoryDataset dataset, int series, int item) {
    Object[] result = new Object[8];
    result[0] = dataset.getRowKey(series);
    Number y = dataset.getValue(series, item);
    NumberFormat formatter = getNumberFormat();
    result[1] = formatter.format(y);
    if (dataset instanceof BoxAndWhiskerCategoryDataset) {
        BoxAndWhiskerCategoryDataset d = (BoxAndWhiskerCategoryDataset) dataset;
        result[2] = formatter.format(d.getMeanValue(series, item));
        result[3] = formatter.format(d.getMedianValue(series, item));
        result[4] = formatter.format(d.getMinRegularValue(series, item));
        result[5] = formatter.format(d.getMaxRegularValue(series, item));
        result[6] = formatter.format(d.getQ1Value(series, item));
        result[7] = formatter.format(d.getQ3Value(series, item));
    }
    return result;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:28,代碼來源:BoxAndWhiskerToolTipGenerator.java

示例3: createItemArray

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Creates the array of items that can be passed to the 
 * {@link MessageFormat} class for creating labels.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param series  the series (zero-based index).
 * @param item  the item (zero-based index).
 *
 * @return The items (never <code>null</code>).
 */
protected Object[] createItemArray(CategoryDataset dataset, int series, 
                                   int item) {
    Object[] result = new Object[8];
    result[0] = dataset.getRowKey(series);
    Number y = dataset.getValue(series, item);
    NumberFormat formatter = getNumberFormat();
    result[1] = formatter.format(y);
    if (dataset instanceof BoxAndWhiskerCategoryDataset) {
        BoxAndWhiskerCategoryDataset d 
            = (BoxAndWhiskerCategoryDataset) dataset;
        result[2] = formatter.format(d.getMeanValue(series, item));
        result[3] = formatter.format(d.getMedianValue(series, item));
        result[4] = formatter.format(d.getMinRegularValue(series, item));
        result[5] = formatter.format(d.getMaxRegularValue(series, item));
        result[6] = formatter.format(d.getQ1Value(series, item));
        result[7] = formatter.format(d.getQ3Value(series, item));
    }
    return result;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:30,代碼來源:BoxAndWhiskerToolTipGenerator.java

示例4: createPieDatasetForColumn

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Creates a pie dataset from a {@link CategoryDataset} by taking all the values
 * for a single column.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param column  the column (zero-based index).
 *
 * @return A pie dataset.
 */
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset, 
                                                   int column) {

    DefaultPieDataset result = new DefaultPieDataset();
    int rowCount = dataset.getRowCount();
    for (int i = 0; i < rowCount; i++) {
        Comparable rowKey = dataset.getRowKey(i);
        result.setValue(rowKey, dataset.getValue(i, column));
    }
    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:22,代碼來源:DatasetUtilities.java

示例5: generateURL

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
     * Generates a URL for a particular item within a series.
     *
     * @param dataset  the dataset.
     * @param series  the series index (zero-based).
     * @param category  the category index (zero-based).
     *
     * @return The generated URL.
     */
    public String generateURL(CategoryDataset dataset, int series, 
                              int category) {
        String url = this.prefix;
        Comparable seriesKey = dataset.getRowKey(series);
        Comparable categoryKey = dataset.getColumnKey(category);
        boolean firstParameter = url.indexOf("?") == -1;
        url += firstParameter ? "?" : "&amp;";
//        try {
            url += this.seriesParameterName + "=" 
                + URLEncoder.encode(seriesKey.toString());
                // + URLEncoder.encode(seriesKey.toString(), "UTF-8");  
                // Not supported in JDK 1.2.2
//        }
//        catch (UnsupportedEncodingException uee) {
//            url += this.seriesParameterName + "=" + seriesKey.toString();
//        }
//        try {
            url += "&amp;" + this.categoryParameterName + "=" 
                + URLEncoder.encode(categoryKey.toString());
                //+ URLEncoder.encode(categoryKey.toString(), "UTF-8");  
                // not supported in JDK 1.2.2
//        }
//        catch (UnsupportedEncodingException uee) {
//            url += "&" + this.categoryParameterName + "=" 
            // + categoryKey.toString();
//        }
        return url;
    }
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:38,代碼來源:StandardCategoryURLGenerator.java

示例6: createPieDatasetForColumn

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Creates a pie dataset from a {@link CategoryDataset} by taking all the 
 * values for a single column.
 *
 * @param dataset  the dataset (<code>null</code> not permitted).
 * @param column  the column (zero-based index).
 *
 * @return A pie dataset.
 */
public static PieDataset createPieDatasetForColumn(CategoryDataset dataset, 
                                                   int column) {
    DefaultPieDataset result = new DefaultPieDataset();
    int rowCount = dataset.getRowCount();
    for (int i = 0; i < rowCount; i++) {
        Comparable rowKey = dataset.getRowKey(i);
        result.setValue(rowKey, dataset.getValue(i, column));
    }
    return result;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:20,代碼來源:DatasetUtilities.java


注:本文中的org.jfree.data.category.CategoryDataset.getRowKey方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。