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


Java CategoryDataset.getColumnKey方法代碼示例

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


在下文中一共展示了CategoryDataset.getColumnKey方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: addItemEntity

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Adds an entity with the specified hotspot.
 *
 * @param entities  the entity collection.
 * @param dataset  the dataset.
 * @param row  the row index.
 * @param column  the column index.
 * @param hotspot  the hotspot.
 */
protected void addItemEntity(EntityCollection entities,
                             CategoryDataset dataset, int row, int column,
                             Shape hotspot) {

    String tip = null;
    CategoryToolTipGenerator tipster = getToolTipGenerator(row, column);
    if (tipster != null) {
        tip = tipster.generateToolTip(dataset, row, column);
    }
    String url = null;
    CategoryURLGenerator urlster = getItemURLGenerator(row, column);
    if (urlster != null) {
        url = urlster.generateURL(dataset, row, column);
    }
    CategoryItemEntity entity = new CategoryItemEntity(hotspot, tip, url,
            dataset, row, dataset.getColumnKey(column), column);
    entities.add(entity);

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

示例3: getCategoriesForAxis

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Returns a list of the categories that should be displayed for the
 * specified axis.
 * 
 * @param axis  the axis (<code>null</code> not permitted)
 * 
 * @return The categories.
 * 
 * @since 1.0.3
 */
public List getCategoriesForAxis(CategoryAxis axis) {
    List result = new ArrayList();
    int axisIndex = this.domainAxes.indexOf(axis);
    List datasets = datasetsMappedToDomainAxis(axisIndex);
    Iterator iterator = datasets.iterator();
    while (iterator.hasNext()) {
        CategoryDataset dataset = (CategoryDataset) iterator.next();
        // add the unique categories from this dataset
        for (int i = 0; i < dataset.getColumnCount(); i++) {
            Comparable category = dataset.getColumnKey(i);
            if (!result.contains(category)) {
                result.add(category);
            }
        }
    }
    return result;
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:28,代碼來源:CategoryPlot.java

示例4: createPieDatasetForRow

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

    DefaultPieDataset result = new DefaultPieDataset();
    int columnCount = dataset.getColumnCount();
    for (int current = 0; current < columnCount; current++) {
        Comparable columnKey = dataset.getColumnKey(current);
        result.setValue(columnKey, dataset.getValue(row, current));
    }
    return result;

}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:21,代碼來源: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: createPieDatasetForRow

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

示例7: drawItem

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Draws the visual representation of one data item from the chart (in 
 * fact, this method does nothing until it reaches the last item for each
 * category, at which point it draws all the items for that category).
 *
 * @param g2  the graphics device.
 * @param state  the renderer state.
 * @param dataArea  the plot area.
 * @param plot  the plot.
 * @param domainAxis  the domain (category) axis.
 * @param rangeAxis  the range (value) axis.
 * @param dataset  the data.
 * @param row  the row index (zero-based).
 * @param column  the column index (zero-based).
 * @param pass  the pass index.
 */
public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass) {

    // wait till we are at the last item for the row then draw the
    // whole stack at once
    if (row < dataset.getRowCount() - 1) {
        return;
    }
    Comparable category = dataset.getColumnKey(column);
    
    List values = createStackedValueList(dataset, 
            dataset.getColumnKey(column), getBase(), 
            this.renderAsPercentages);
    
    Rectangle2D adjusted = new Rectangle2D.Double(dataArea.getX(), 
            dataArea.getY() + getYOffset(), 
            dataArea.getWidth() - getXOffset(), 
            dataArea.getHeight() - getYOffset());


    PlotOrientation orientation = plot.getOrientation();

    // handle rendering separately for the two plot orientations...
    if (orientation == PlotOrientation.HORIZONTAL) {
        drawStackHorizontal(values, category, g2, state, adjusted, plot, 
                domainAxis, rangeAxis, dataset);
    }
    else {
        drawStackVertical(values, category, g2, state, adjusted, plot, 
                domainAxis, rangeAxis, dataset);
    }

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

示例8: generateLabel

import org.jfree.data.category.CategoryDataset; //導入方法依賴的package包/類
/**
 * Generates the label for an item in a dataset. Note: in the current dataset implementation,
 * each row is a series, and each column contains values for a particular category.
 * 
 * @param dataset
 *            the dataset (<code>null</code> not permitted).
 * @param row
 *            the row index (zero-based).
 * @param column
 *            the column index (zero-based).
 * 
 * @return The label (possibly <code>null</code>).
 */
@Override
public String generateLabel(CategoryDataset dataset, int row, int column) {
	String key = (String) dataset.getColumnKey(column);
	return itemLabels.get(key);
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:19,代碼來源:ParetoChartItemLabelGenerator.java


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