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


Java XYSeries.clear方法代码示例

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


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

示例1: fillToXYSeriesPriv

import org.jfree.data.xy.XYSeries; //导入方法依赖的package包/类
protected void fillToXYSeriesPriv(XYSeries series, float[] spectrum){
	series.clear();
	/**
	 * caching decreases GC usage
	 */
	boolean useCached	= false;
	if (!useCached){
		for (int i = 0; i < spectrum.length; i++)
		{
			double freq = (freqStartHz + fftBinSizeHz * i) / 1000000;
			series.add(freq, spectrum[i]);
		}
	}
	else{
		ArrayList<XYDataItem> items	= cachedDataItems.get(cachedDataItemsIndex);
		for (int i = 0; i < spectrum.length; i++)
		{
			XYDataItem item	= items.get(i);
			item.setY(spectrum[i]);
			series.add(item);
		}
		cachedDataItemsIndex	= (cachedDataItemsIndex+1)%cachedDataItems.size();
	}
}
 
开发者ID:pavsa,项目名称:hackrf-spectrum-analyzer,代码行数:25,代码来源:DatasetSpectrum.java

示例2: exchangeSeries

import org.jfree.data.xy.XYSeries; //导入方法依赖的package包/类
@Override
public void exchangeSeries(int seriesIndex, DataSeries series) throws NoSuchSeriesException {
	
	if(seriesIndex < this.getSeriesCount()){

		XyDataSeries xyDataSeries = (XyDataSeries) series;
		XYSeries editSeries = this.getSeries(seriesIndex);
		// --- Are there configuration changes ? -------------------------- 
		if (xyDataSeries.getAutoSort()==editSeries.getAutoSort() && xyDataSeries.getAvoidDuplicateXValues()==(!editSeries.getAllowDuplicateXValues())) {
			// --- No configuration changes -------------------------------
			editSeries.clear();
			if (series.getLabel()!=null) {
				editSeries.setKey(series.getLabel());
			}
			
			List valuePairs = xyDataSeries.getXyValuePairs();
			for (int i = 0; i < valuePairs.size(); i++) {
				XyValuePair valuePair = (XyValuePair) valuePairs.get(i);
				editSeries.add(valuePair.getXValue().getFloatValue(), valuePair.getYValue().getFloatValue());	
			}
			
		} else {
			// --- Configuration has changed ------------------------------
			XYSeries newSeries = (XYSeries) this.getXYSeriesFromXyDataSeries(xyDataSeries);
			// --- Replace the edit series with the new series ------------
			Vector<XYSeries> currSerieses = new Vector<XYSeries>();
			for (int i=0; i < this.getSeriesCount(); i++) {
				currSerieses.add(this.getSeries(i));
			}
			currSerieses.set(seriesIndex, newSeries);

			this.getXySeriesCollection().removeAllSeries();
			for (int i = 0; i < currSerieses.size(); i++) {
				this.getXySeriesCollection().addSeries(currSerieses.get(i));
			}
		}
		
	}else{
		throw new NoSuchSeriesException();
	}
	
	this.setChanged();
	this.notifyObservers(ChartModel.EventType.SERIES_ADDED);
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:45,代码来源:XyChartModel.java

示例3: clear

import org.jfree.data.xy.XYSeries; //导入方法依赖的package包/类
public void clear()
{
    XYSeries.clear();
}
 
开发者ID:ZingBug,项目名称:NystagmusJava,代码行数:5,代码来源:WaveChart.java


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