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


Java WritableSheet.addImage方法代码示例

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


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

示例1: createExcelSheet

import jxl.write.WritableSheet; //导入方法依赖的package包/类
public void createExcelSheet(WritableSheet excelSheet) {
	int row, col;
	
	// Create cells
	for (row=0; row<nrows; row++)
		for (col=0; col<ncolumns[row]; col++) {
			if (sheet[row][col]==null)
				continue;
					
			try {
				if (sheet[row][col].getMerge_to_col()>=0 && sheet[row][col].getMerge_to_row()>=0)
					excelSheet.mergeCells(col, row, sheet[row][col].getMerge_to_col(), sheet[row][col].getMerge_to_row());
				
				switch (sheet[row][col].getType()) {
					case LABEL:
						excelSheet.addCell(new Label(col,row,sheet[row][col].getString(),getExcelFormat(row, col)));
						break;
					case FLOAT:
					case INTEGER:
						excelSheet.addCell(new Number(col,row,sheet[row][col].getNumber(),getExcelFormat(row, col)));
						break;
					case IMAGE:
						File f = new File(sheet[row][col].getString());
						WritableImage imgobj=new WritableImage(col, row, sheet[row][col].getWidth(), sheet[row][col].getHeight(), f);
						excelSheet.addImage(imgobj);
						break;
					case VOID:
						break;
					case FORMULA:
						excelSheet.addCell( new Formula(col, row, sheet[row][col].getString(),getExcelFormat(row, col)) );
						break;
					default:
						break;
				}
			} catch (WriteException we) {};
		}
	
	// Resize columns
	for (col=0; colSize!=null && col<colSize.length; col++)
		if (colSize[col]>0)
			excelSheet.setColumnView(col, colSize[col]);
}
 
开发者ID:vagfed,项目名称:hmcScanner,代码行数:43,代码来源:DataSheet.java

示例2: createHeader

import jxl.write.WritableSheet; //导入方法依赖的package包/类
private void createHeader(WritableSheet sheet) throws RowsExceededException, WriteException {
	int row;
		
	row = 0;
	
	addLabel(sheet,0,row,"Manager Name",formatLabel(BOLD|B_ALL_MED));
	addLabel(sheet,1,row,scannerParams.getVarValues("HMC")[0],formatLabel(B_ALL_LOW));
	row++;
	
	addLabel(sheet,0,row,"Manager Type",formatLabel(BOLD|B_ALL_MED));
	switch (managerType) {
		case M_FSM: 	addLabel(sheet,1,row,"FSM",formatLabel(B_ALL_LOW)); break;
		case M_HMC: 	addLabel(sheet,1,row,"HMC",formatLabel(B_ALL_LOW)); break;
		case M_SDMC: 	addLabel(sheet,1,row,"SDMC",formatLabel(B_ALL_LOW)); break;
		case M_IVM: 	addLabel(sheet,1,row,"IVM",formatLabel(B_ALL_LOW)); break;
		default:		break;
	}
	row++;
	
	addLabel(sheet,0,row,"User",formatLabel(BOLD|B_ALL_MED));
	addLabel(sheet,1,row,scannerParams.getVarValues("user")[0],formatLabel(B_ALL_LOW));
	row++;
	
	addLabel(sheet,0,row,"Generation Date",formatLabel(BOLD|B_ALL_MED));
	addLabel(sheet,1,row,scannerParams.getVarValues("date")[0],formatLabel(B_ALL_LOW));
	row++;
	
	addLabel(sheet,0,row,"Generation Time",formatLabel(BOLD|B_ALL_MED));
	addLabel(sheet,1,row,scannerParams.getVarValues("time")[0],formatLabel(B_ALL_LOW));
	row++;
	
	addLabel(sheet,0,row,"Manager Date",formatLabel(BOLD|B_ALL_MED));
	addLabel(sheet,1,row,scannerParams.getVarValues("HMCdate")[0],formatLabel(B_ALL_LOW));
	row++;
	
	addLabel(sheet,0,row,"Manager Time",formatLabel(BOLD|B_ALL_MED));
	addLabel(sheet,1,row,scannerParams.getVarValues("HMCtime")[0],formatLabel(B_ALL_LOW));
	row++;
	
	addLabel(sheet,0,row,"HMC Scanner Version",formatLabel(BOLD|B_ALL_MED));
	addLabel(sheet,1,row,version,formatLabel(B_ALL_LOW));
	row++;
	
	
	row++;
	addLabel(sheet,0,row,"Latest HMC Scanner is available at http://tinyurl.com/HMCscanner",formatLabel(NONE));
	row++;
	addLabel(sheet,0,row,"For issues send a mail to [email protected]",formatLabel(NONE));
	row++;
	
	
	File f = new File(System.getProperty("user.dir")+File.separatorChar+hmcScannerPic);
	if (f.exists()) {
		WritableImage imgobj=new WritableImage(3, 2, 5, 15, f);
		sheet.addImage(imgobj);
	}
	
	
	
	sheet.setColumnView(0, 21);
	sheet.setColumnView(1, 36);
	
}
 
开发者ID:vagfed,项目名称:hmcScanner,代码行数:64,代码来源:Loader.java

示例3: writeImage

import jxl.write.WritableSheet; //导入方法依赖的package包/类
public static void writeImage(WritableSheet sheet, int iRow, int iCol, byte[] pngImage) throws WriteException, RowsExceededException
{
  WritableImage writableImage = new WritableImage(iCol, iRow, 1, 1, pngImage);
  sheet.addImage(writableImage);
}
 
开发者ID:hmsiccbl,项目名称:screensaver,代码行数:6,代码来源:Workbook2Utils.java


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