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


Java LegendItemCollection.getItemCount方法代码示例

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


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

示例1: fetchLegendItems

import org.jfree.chart.LegendItemCollection; //导入方法依赖的package包/类
/**
 * Fetches the latest legend items.
 */
protected void fetchLegendItems() {
    this.items.clear();
    RectangleEdge p = getPosition();
    if (RectangleEdge.isTopOrBottom(p)) {
        this.items.setArrangement(this.hLayout);   
    }
    else {
        this.items.setArrangement(this.vLayout);   
    }
    for (int s = 0; s < this.sources.length; s++) {
        LegendItemCollection legendItems = this.sources[s].getLegendItems();
        if (legendItems != null) {
            for (int i = 0; i < legendItems.getItemCount(); i++) {
                LegendItem item = legendItems.get(i);
                Block block = createLegendItemBlock(item);
                this.items.add(block);
            }
        }
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:24,代码来源:LegendTitle.java

示例2: fetchLegendItems

import org.jfree.chart.LegendItemCollection; //导入方法依赖的package包/类
/**
 * Fetches the latest legend items.
 */
protected void fetchLegendItems() {
    this.items.clear();
    RectangleEdge p = getPosition();
    if (RectangleEdge.isTopOrBottom(p)) {
        this.items.setArrangement(this.hLayout);
    }
    else {
        this.items.setArrangement(this.vLayout);
    }
    for (int s = 0; s < this.sources.length; s++) {
        LegendItemCollection legendItems = this.sources[s].getLegendItems();
        if (legendItems != null) {
            for (int i = 0; i < legendItems.getItemCount(); i++) {
                LegendItem item = legendItems.get(i);
                Block block = createLegendItemBlock(item);
                this.items.add(block);
            }
        }
    }
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:24,代码来源:LegendTitle.java

示例3: styleChart

import org.jfree.chart.LegendItemCollection; //导入方法依赖的package包/类
/**
 * Changes various appearance settings that are common to all the trace
 * charts.
 * 
 * @param chart
 *            A {@link JFreeChart} for which the common trace style is to be
 *            applied.
 * @return A {@link JFreeChart} that has the common trace style.
 */
protected JFreeChart styleChart(JFreeChart chart) {
	super.styleChart(chart);

	final XYPlot plot = chart.getXYPlot();
	plot.setBackgroundPaint(Color.white);
	plot.setRangeGridlinePaint(Color.lightGray);

	renderer = new XYLineAndShapeRenderer();

	plot.setDomainGridlinesVisible(true);
	plot.setDomainGridlinePaint(Color.lightGray);
	plot.setRenderer(renderer);

	LegendItemCollection legendItems = plot.getLegendItems();
	for (int i = 0; i < legendItems.getItemCount(); i++) {
		int seriesIndex = legendItems.get(i).getSeriesIndex();
		renderer.setSeriesLinesVisible(seriesIndex, true);
		renderer.setSeriesShapesVisible(seriesIndex, true);
		Color seriesColor = (Color) renderer.lookupSeriesPaint(seriesIndex);
		colorPalette.add(seriesColor);
	}

	// Customize the domain axis
	final ValueAxis domainAxis = plot.getDomainAxis();
	domainAxis.setTickMarksVisible(true);
	domainAxis.setAxisLineVisible(true);
	domainAxis.setLowerMargin(0.0);
	
	// Customize the range axis
	final ValueAxis rangeAxis = plot.getRangeAxis();
	rangeAxis.setStandardTickUnits(rangeAxis.getStandardTickUnits());

	return chart;
}
 
开发者ID:modsim,项目名称:vizardous,代码行数:44,代码来源:TraceChart2D.java

示例4: updateColorPalette

import org.jfree.chart.LegendItemCollection; //导入方法依赖的package包/类
/**
 * Updates the {@link AbstractChart2D#colorPalette} when the
 * {@link CellsInformationTable} has changed.
 */
public void updateColorPalette() {
	colorPalette.clear();
	
	LegendItemCollection legendItems = chart.getPlot().getLegendItems();
       for(int i=0; i<legendItems.getItemCount(); i++) {
           int seriesIndex = legendItems.get(i).getSeriesIndex();
           Color seriesColor = (Color) renderer.lookupSeriesPaint(seriesIndex);
           colorPalette.add(seriesColor);
       }
}
 
开发者ID:modsim,项目名称:vizardous,代码行数:15,代码来源:CellFluorescenceChart2D.java

示例5: removeItemFromLegend

import org.jfree.chart.LegendItemCollection; //导入方法依赖的package包/类
protected void removeItemFromLegend(int itemToRemove, JFreeChart chart) {

		LegendItemCollection legendItems = chart.getPlot().getLegendItems();
		final LegendItemCollection newLegendItems = new LegendItemCollection();

		for (int i = 0; i < legendItems.getItemCount(); i++) {
			if (itemToRemove != i)
				newLegendItems.add(legendItems.get(i));
		}

		LegendItemSource source = new LegendItemSource() {

			@Override
			public LegendItemCollection getLegendItems() {
				return newLegendItems;
			}
		};

		chart.removeLegend();
		chart.addLegend(new LegendTitle(source));
	}
 
开发者ID:BrainTech,项目名称:svarog,代码行数:22,代码来源:EvokedPotentialChart.java


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