当前位置: 首页>>代码示例>>Java>>正文


Java KeyedValues.getItemCount方法代码示例

本文整理汇总了Java中org.jfree.data.KeyedValues.getItemCount方法的典型用法代码示例。如果您正苦于以下问题:Java KeyedValues.getItemCount方法的具体用法?Java KeyedValues.getItemCount怎么用?Java KeyedValues.getItemCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.data.KeyedValues的用法示例。


在下文中一共展示了KeyedValues.getItemCount方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCategoryDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a {@link CategoryDataset} by copying the data from the supplied {@link KeyedValues}
 * instance.
 *
 * @param rowKey  the row key (<code>null</code> not permitted).
 * @param rowData  the row data (<code>null</code> not permitted).
 *
 * @return A dataset.
 */
public static CategoryDataset createCategoryDataset(String rowKey, 
                                                    KeyedValues rowData) {

    if (rowKey == null) {
        throw new IllegalArgumentException("Null 'rowKey' argument.");
    }
    if (rowData == null) {
        throw new IllegalArgumentException("Null 'rowData' argument.");
    }
    DefaultCategoryDataset result = new DefaultCategoryDataset();
    for (int i = 0; i < rowData.getItemCount(); i++) {
        result.addValue(rowData.getValue(i), rowKey, rowData.getKey(i));
    }
    return result;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:DatasetUtilities.java

示例2: createCategoryDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a {@link CategoryDataset} by copying the data from the supplied 
 * {@link KeyedValues} instance.
 *
 * @param rowKey  the row key (<code>null</code> not permitted).
 * @param rowData  the row data (<code>null</code> not permitted).
 *
 * @return A dataset.
 */
public static CategoryDataset createCategoryDataset(Comparable rowKey, 
                                                    KeyedValues rowData) {

    if (rowKey == null) {
        throw new IllegalArgumentException("Null 'rowKey' argument.");
    }
    if (rowData == null) {
        throw new IllegalArgumentException("Null 'rowData' argument.");
    }
    DefaultCategoryDataset result = new DefaultCategoryDataset();
    for (int i = 0; i < rowData.getItemCount(); i++) {
        result.addValue(rowData.getValue(i), rowKey, rowData.getKey(i));
    }
    return result;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:DatasetUtilities.java

示例3: createCategoryDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a {@link CategoryDataset} by copying the data from the supplied
 * {@link KeyedValues} instance.
 *
 * @param rowKey  the row key (<code>null</code> not permitted).
 * @param rowData  the row data (<code>null</code> not permitted).
 *
 * @return A dataset.
 */
public static CategoryDataset createCategoryDataset(Comparable rowKey,
                                                    KeyedValues rowData) {

    if (rowKey == null) {
        throw new IllegalArgumentException("Null 'rowKey' argument.");
    }
    if (rowData == null) {
        throw new IllegalArgumentException("Null 'rowData' argument.");
    }
    DefaultCategoryDataset result = new DefaultCategoryDataset();
    for (int i = 0; i < rowData.getItemCount(); i++) {
        result.addValue(rowData.getValue(i), rowKey, rowData.getKey(i));
    }
    return result;

}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:26,代码来源:DatasetUtilities.java

示例4: DefaultPieDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a new dataset that uses the data from a {@link KeyedValues} instance.
 *
 * @param data  the data.
 */
public DefaultPieDataset(final KeyedValues data) {

    this.data = new DefaultKeyedValues();
    for (int i = 0; i < data.getItemCount(); i++) {
        this.data.addValue(data.getKey(i), data.getValue(i));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:13,代码来源:DefaultPieDataset.java

示例5: drawLeftLabels

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Draws the left labels.
 * 
 * @param leftKeys  the keys.
 * @param g2  the graphics device.
 * @param plotArea  the plot area.
 * @param linkArea  the link area.
 * @param maxLabelWidth  the maximum label width.
 * @param state  the state.
 */
protected void drawLeftLabels(KeyedValues leftKeys, Graphics2D g2, 
                              Rectangle2D plotArea, Rectangle2D linkArea, 
                              float maxLabelWidth, PiePlotState state) {
    
    PieLabelDistributor distributor1 = new PieLabelDistributor(
        leftKeys.getItemCount()
    );
    double lGap = plotArea.getWidth() * this.labelGap;
    double verticalLinkRadius = state.getLinkArea().getHeight() / 2.0;
    for (int i = 0; i < leftKeys.getItemCount(); i++) {   
        String label = this.labelGenerator.generateSectionLabel(
                this.dataset, leftKeys.getKey(i));
        if (label != null) {
            TextBlock block = TextUtilities.createTextBlock(label, 
                    this.labelFont, this.labelPaint, maxLabelWidth, 
                    new G2TextMeasurer(g2));
            TextBox labelBox = new TextBox(block);
            labelBox.setBackgroundPaint(this.labelBackgroundPaint);
            labelBox.setOutlinePaint(this.labelOutlinePaint);
            labelBox.setOutlineStroke(this.labelOutlineStroke);
            labelBox.setShadowPaint(this.labelShadowPaint);
            double theta = Math.toRadians(
                    leftKeys.getValue(i).doubleValue());
            double baseY = state.getPieCenterY() - Math.sin(theta) 
                           * verticalLinkRadius;
            double hh = labelBox.getHeight(g2);

            distributor1.addPieLabelRecord(new PieLabelRecord(
                    leftKeys.getKey(i), theta, baseY, labelBox, hh,
                    lGap / 2.0 + lGap / 2.0 * -Math.cos(theta), 0.9 
                    + getExplodePercent(this.dataset.getIndex(
                            leftKeys.getKey(i)))));
        }
    }
    distributor1.distributeLabels(plotArea.getMinY(), plotArea.getHeight());
    for (int i = 0; i < distributor1.getItemCount(); i++) {
        drawLeftLabel(g2, state, distributor1.getPieLabelRecord(i));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:50,代码来源:PiePlot.java

示例6: DefaultPieDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a new dataset by copying data from a {@link KeyedValues} 
 * instance.
 *
 * @param data  the data (<code>null</code> not permitted).
 */
public DefaultPieDataset(KeyedValues data) {
    if (data == null) {
        throw new IllegalArgumentException("Null 'data' argument.");   
    }
    this.data = new DefaultKeyedValues();
    for (int i = 0; i < data.getItemCount(); i++) {
        this.data.addValue(data.getKey(i), data.getValue(i));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:16,代码来源:DefaultPieDataset.java

示例7: DefaultPieDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a new dataset by copying data from a {@link KeyedValues}
 * instance.
 *
 * @param data  the data (<code>null</code> not permitted).
 */
public DefaultPieDataset(KeyedValues data) {
    ParamChecks.nullNotPermitted(data, "data");
    this.data = new DefaultKeyedValues();
    for (int i = 0; i < data.getItemCount(); i++) {
        this.data.addValue(data.getKey(i), data.getValue(i));
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:14,代码来源:DefaultPieDataset.java

示例8: createCategoryDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a {@link CategoryDataset} by copying the data from the supplied
 * {@link KeyedValues} instance.
 *
 * @param rowKey  the row key (<code>null</code> not permitted).
 * @param rowData  the row data (<code>null</code> not permitted).
 *
 * @return A dataset.
 */
public static CategoryDataset createCategoryDataset(Comparable rowKey,
        KeyedValues rowData) {

    ParamChecks.nullNotPermitted(rowKey, "rowKey");
    ParamChecks.nullNotPermitted(rowData, "rowData");
    DefaultCategoryDataset result = new DefaultCategoryDataset();
    for (int i = 0; i < rowData.getItemCount(); i++) {
        result.addValue(rowData.getValue(i), rowKey, rowData.getKey(i));
    }
    return result;

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:22,代码来源:DatasetUtilities.java

示例9: DefaultPieDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a new dataset by copying data from a {@link KeyedValues}
 * instance.
 *
 * @param data  the data ({@code null} not permitted).
 */
public DefaultPieDataset(KeyedValues data) {
    Args.nullNotPermitted(data, "data");
    this.data = new DefaultKeyedValues();
    for (int i = 0; i < data.getItemCount(); i++) {
        this.data.addValue(data.getKey(i), data.getValue(i));
    }
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:14,代码来源:DefaultPieDataset.java

示例10: createCategoryDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a {@link CategoryDataset} by copying the data from the supplied
 * {@link KeyedValues} instance.
 *
 * @param rowKey  the row key ({@code null} not permitted).
 * @param rowData  the row data ({@code null} not permitted).
 *
 * @return A dataset.
 */
public static CategoryDataset createCategoryDataset(Comparable rowKey,
        KeyedValues rowData) {

    Args.nullNotPermitted(rowKey, "rowKey");
    Args.nullNotPermitted(rowData, "rowData");
    DefaultCategoryDataset result = new DefaultCategoryDataset();
    for (int i = 0; i < rowData.getItemCount(); i++) {
        result.addValue(rowData.getValue(i), rowKey, rowData.getKey(i));
    }
    return result;

}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:22,代码来源:DatasetUtils.java

示例11: DefaultPieDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a new dataset by copying data from a {@link KeyedValues}
 * instance.
 *
 * @param data  the data (<code>null</code> not permitted).
 */
public DefaultPieDataset(KeyedValues data) {
    if (data == null) {
        throw new IllegalArgumentException("Null 'data' argument.");
    }
    this.data = new DefaultKeyedValues();
    for (int i = 0; i < data.getItemCount(); i++) {
        this.data.addValue(data.getKey(i), data.getValue(i));
    }
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:16,代码来源:DefaultPieDataset.java

示例12: DefaultPieDataset

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Creates a new dataset by copying data from a {@link KeyedValues}
 * instance.
 *
 * @param data  the data (<code>null</code> not permitted).
 */
public DefaultPieDataset(KeyedValues data) {
    if (data == null) {
        throw new IllegalArgumentException("Null 'data' argument.");
    }
    this.data = new KeyedObjects();
    for (int i = 0; i < data.getItemCount(); i++) {
        SelectableValue dataItem = new SelectableValue(data.getValue(i));
        this.data.addObject(data.getKey(i), dataItem);
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:17,代码来源:DefaultPieDataset.java

示例13: drawLeftLabels

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Draws the left labels.
 * 
 * @param leftKeys  the keys.
 * @param g2  the graphics device.
 * @param plotArea  the plot area.
 * @param linkArea  the link area.
 * @param maxLabelWidth  the maximum label width.
 * @param state  the state.
 */
protected void drawLeftLabels(KeyedValues leftKeys, Graphics2D g2, 
                              Rectangle2D plotArea, Rectangle2D linkArea, 
                              float maxLabelWidth, PiePlotState state) {
    
    PieLabelDistributor distributor1 = new PieLabelDistributor(leftKeys.getItemCount());
    double lGap = plotArea.getWidth() * this.labelGap;
    double verticalLinkRadius = state.getLinkArea().getHeight() / 2.0;
    for (int i = 0; i < leftKeys.getItemCount(); i++) {   
        String label = this.labelGenerator.generateSectionLabel(
            this.dataset, leftKeys.getKey(i)
        );
        if (label != null) {
            TextBlock block = TextUtilities.createTextBlock(
                label, 
                this.labelFont, this.labelPaint, maxLabelWidth, new G2TextMeasurer(g2)
            );
            TextBox labelBox = new TextBox(block);
            labelBox.setBackgroundPaint(this.labelBackgroundPaint);
            labelBox.setOutlinePaint(this.labelOutlinePaint);
            labelBox.setOutlineStroke(this.labelOutlineStroke);
            labelBox.setShadowPaint(this.labelShadowPaint);
            double theta = Math.toRadians(leftKeys.getValue(i).doubleValue());
            double baseY = state.getPieCenterY() - Math.sin(theta) * verticalLinkRadius;
            double hh = labelBox.getHeight(g2);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Label height = " + hh);   
            }

            distributor1.addPieLabelRecord(
                new PieLabelRecord(
                    leftKeys.getKey(i), theta, baseY, labelBox, hh,
                    lGap / 2.0 + lGap / 2.0 * -Math.cos(theta), 
                    0.9 + getExplodePercent(this.dataset.getIndex(leftKeys.getKey(i)))
                )
            );
        }
    }
    distributor1.distributeLabels(plotArea.getMinY(), plotArea.getHeight());
    for (int i = 0; i < distributor1.getItemCount(); i++) {
        drawLeftLabel(g2, state, distributor1.getPieLabelRecord(i));
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:53,代码来源:PiePlot.java

示例14: drawRightLabels

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Draws the right labels.
 * 
 * @param keys  the keys.
 * @param g2  the graphics device.
 * @param plotArea  the plot area.
 * @param linkArea  the link area.
 * @param maxLabelWidth  the maximum label width.
 * @param state  the state.
 */
protected void drawRightLabels(KeyedValues keys, Graphics2D g2, 
                               Rectangle2D plotArea, Rectangle2D linkArea, 
                               float maxLabelWidth, PiePlotState state) {

    // draw the right labels...
    PieLabelDistributor distributor2 = new PieLabelDistributor(keys.getItemCount());
    double lGap = plotArea.getWidth() * this.labelGap;
    double verticalLinkRadius = state.getLinkArea().getHeight() / 2.0;

    for (int i = 0; i < keys.getItemCount(); i++) {
        String label = this.labelGenerator.generateSectionLabel(
            this.dataset, keys.getKey(i)
        );

        if (label != null) {
            TextBlock block = TextUtilities.createTextBlock(
                label, this.labelFont, this.labelPaint, 
                maxLabelWidth, new G2TextMeasurer(g2)
            );
            TextBox labelBox = new TextBox(block);
            labelBox.setBackgroundPaint(this.labelBackgroundPaint);
            labelBox.setOutlinePaint(this.labelOutlinePaint);
            labelBox.setOutlineStroke(this.labelOutlineStroke);
            labelBox.setShadowPaint(this.labelShadowPaint);
            double theta = Math.toRadians(keys.getValue(i).doubleValue());
            double baseY = state.getPieCenterY() 
                          - Math.sin(theta) * verticalLinkRadius;
            double hh = labelBox.getHeight(g2);
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Label height = " + hh);   
            }
            distributor2.addPieLabelRecord(
                new PieLabelRecord(
                    keys.getKey(i), theta, baseY, labelBox, hh,
                    lGap / 2.0 + lGap / 2.0 * Math.cos(theta), 
                    0.9 + getExplodePercent(this.dataset.getIndex(keys.getKey(i)))
                )
            );
        }
    }
    distributor2.distributeLabels(linkArea.getMinY(), linkArea.getHeight());
    for (int i = 0; i < distributor2.getItemCount(); i++) {
        drawRightLabel(g2, state, distributor2.getPieLabelRecord(i));
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:57,代码来源:PiePlot.java

示例15: drawRightLabels

import org.jfree.data.KeyedValues; //导入方法依赖的package包/类
/**
 * Draws the right labels.
 * 
 * @param keys  the keys.
 * @param g2  the graphics device.
 * @param plotArea  the plot area.
 * @param linkArea  the link area.
 * @param maxLabelWidth  the maximum label width.
 * @param state  the state.
 */
protected void drawRightLabels(KeyedValues keys, Graphics2D g2, 
                               Rectangle2D plotArea, Rectangle2D linkArea, 
                               float maxLabelWidth, PiePlotState state) {

    // draw the right labels...
    PieLabelDistributor distributor2 
        = new PieLabelDistributor(keys.getItemCount());
    double lGap = plotArea.getWidth() * this.labelGap;
    double verticalLinkRadius = state.getLinkArea().getHeight() / 2.0;

    for (int i = 0; i < keys.getItemCount(); i++) {
        String label = this.labelGenerator.generateSectionLabel(
                this.dataset, keys.getKey(i));

        if (label != null) {
            TextBlock block = TextUtilities.createTextBlock(label, 
                    this.labelFont, this.labelPaint, maxLabelWidth, 
                    new G2TextMeasurer(g2));
            TextBox labelBox = new TextBox(block);
            labelBox.setBackgroundPaint(this.labelBackgroundPaint);
            labelBox.setOutlinePaint(this.labelOutlinePaint);
            labelBox.setOutlineStroke(this.labelOutlineStroke);
            labelBox.setShadowPaint(this.labelShadowPaint);
            double theta = Math.toRadians(keys.getValue(i).doubleValue());
            double baseY = state.getPieCenterY() 
                          - Math.sin(theta) * verticalLinkRadius;
            double hh = labelBox.getHeight(g2);
            distributor2.addPieLabelRecord(new PieLabelRecord(
                    keys.getKey(i), theta, baseY, labelBox, hh,
                    lGap / 2.0 + lGap / 2.0 * Math.cos(theta), 
                    0.9 + getExplodePercent(this.dataset.getIndex(
                            keys.getKey(i)))));
        }
    }
    distributor2.distributeLabels(plotArea.getMinY(), plotArea.getHeight());
    for (int i = 0; i < distributor2.getItemCount(); i++) {
        drawRightLabel(g2, state, distributor2.getPieLabelRecord(i));
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:51,代码来源:PiePlot.java


注:本文中的org.jfree.data.KeyedValues.getItemCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。