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


Java DataTable.getColumnCount方法代码示例

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


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

示例1: fillWithEmptyRows

import de.erichseifert.gral.data.DataTable; //导入方法依赖的package包/类
/**
 * Utility method that fills a data table with empty rows.
 * @param data Data table that should be filled.
 * @param count Number of rows that were added.
 */
private static void fillWithEmptyRows(DataTable data, int count) {
	while (data.getRowCount() < count) {
		Double[] emptyRow = new Double[data.getColumnCount()];
		Arrays.fill(emptyRow, 0.0);
		data.add(emptyRow);
	}
}
 
开发者ID:eseifert,项目名称:gral,代码行数:13,代码来源:Resize.java

示例2: SimpleRasterPlot

import de.erichseifert.gral.data.DataTable; //导入方法依赖的package包/类
public SimpleRasterPlot() {
	setPreferredSize(new Dimension(600, 600));

	// Create example data
	DataTable raster = new DataTable(SIZE, Double.class);
	for (int rowIndex = 0; rowIndex < raster.getColumnCount(); rowIndex++) {
		Comparable<?>[] row = new Comparable<?>[raster.getColumnCount()];
		double y = ZOOM*rowIndex;
		for (int colIndex = 0; colIndex < row.length; colIndex++) {
			double x = ZOOM*colIndex;
			row[colIndex] =
				Math.cos(Math.hypot(x - ZOOM*SIZE/2.0, y - ZOOM*SIZE/2.0)) *
				Math.cos(Math.hypot(x + ZOOM*SIZE/2.0, y + ZOOM*SIZE/2.0));
		}
		raster.add(row);
	}

	// Convert raster matrix to (x, y, value)
	DataSource valuesByCoord = RasterPlot.createRasterData(raster);

	// Create new bar plot
	RasterPlot plot = new RasterPlot(valuesByCoord);

	// Format plot
	plot.setInsets(new Insets2D.Double(20.0, 60.0, 40.0, 20.0));
	plot.setColors(new LinearGradient(GraphicsUtils.deriveDarker(COLOR1), COLOR1, Color.WHITE));

	// Add plot to Swing component
	InteractivePanel panel = new InteractivePanel(plot);
	panel.setPannable(false);
	panel.setZoomable(false);
	add(panel);
}
 
开发者ID:eseifert,项目名称:gral,代码行数:34,代码来源:SimpleRasterPlot.java

示例3: SimpleRasterPlot

import de.erichseifert.gral.data.DataTable; //导入方法依赖的package包/类
public SimpleRasterPlot(int size, double zoom) {
               SimpleRasterPlot.size = size;
               SimpleRasterPlot.zoom = zoom;
	setPreferredSize(new Dimension(600, 600));

	// Create example data
	DataTable raster = new DataTable(SimpleRasterPlot.size, Double.class);
	for (int rowIndex = 0; rowIndex < raster.getColumnCount(); rowIndex++) {
		Comparable<?>[] row = new Comparable<?>[raster.getColumnCount()];
		double y = SimpleRasterPlot.zoom*rowIndex;
		for (int colIndex = 0; colIndex < row.length; colIndex++) {
			double x = SimpleRasterPlot.zoom*colIndex;
			row[colIndex] =
				Math.cos(Math.hypot(x - SimpleRasterPlot.zoom*SimpleRasterPlot.size/2.0, y - SimpleRasterPlot.zoom*SimpleRasterPlot.size/2.0)) *
				Math.cos(Math.hypot(x + SimpleRasterPlot.zoom*SimpleRasterPlot.size/2.0, y + SimpleRasterPlot.zoom*SimpleRasterPlot.size/2.0));
		}
		raster.add(row);
	}

	// Convert raster matrix to (x, y, value)
	DataSource valuesByCoord = RasterPlot.createRasterData(raster);

	// Create new bar plot
	RasterPlot plot = new RasterPlot(valuesByCoord);

	// Format plot
	plot.setInsets(new Insets2D.Double(20.0, 60.0, 40.0, 20.0));
	plot.setColors(new LinearGradient(GraphicsUtils.deriveDarker(COLOR1), COLOR1, Color.WHITE));

	// Add plot to Swing component
	InteractivePanel panel = new InteractivePanel(plot);
	panel.setPannable(false);
	panel.setZoomable(false);
	add(panel);
}
 
开发者ID:arahusky,项目名称:performance_javadoc,代码行数:36,代码来源:SimpleRasterPlot.java


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