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


Java FillPatternType类代码示例

本文整理汇总了Java中org.apache.poi.ss.usermodel.FillPatternType的典型用法代码示例。如果您正苦于以下问题:Java FillPatternType类的具体用法?Java FillPatternType怎么用?Java FillPatternType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createIndentationCellStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
public CellStyle createIndentationCellStyle(Workbook workbook, int s) {
	CellStyle dataStyle1 = this.createBorderCellStyle(workbook, true);
	Font dataFont = workbook.createFont();
	dataFont.setColor((short) 12);
	dataFont.setFontHeightInPoints((short) 10);
	dataStyle1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	dataStyle1.setFillForegroundColor((short) 11);
	dataStyle1.setFont(dataFont);
	dataStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
	dataStyle1.setAlignment(HorizontalAlignment.LEFT);
	dataStyle1.setIndention(Short.valueOf(String.valueOf((s))));
	return dataStyle1;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:14,代码来源:GridStyleBuilder.java

示例2: createHSSFCellStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
private HSSFCellStyle createHSSFCellStyle(Workbook wb, int[] bgColor, int[] fontColor, int fontSize) {
	HSSFWorkbook workbook = (HSSFWorkbook) wb;
	HSSFPalette palette = workbook.getCustomPalette();
	
	palette.setColorAtIndex((short) 9, (byte) fontColor[0], (byte) fontColor[1], (byte) fontColor[2]);
	palette.setColorAtIndex((short) 10, (byte) bgColor[0], (byte) bgColor[1], (byte) bgColor[2]);

	HSSFFont titleFont = workbook.createFont();
	titleFont.setCharSet(HSSFFont.DEFAULT_CHARSET);
	titleFont.setFontName("宋体");
	titleFont.setColor((short) 9);
	titleFont.setBold(true); 
	titleFont.setFontHeightInPoints((short) fontSize);

	HSSFCellStyle titleStyle = (HSSFCellStyle) createBorderCellStyle(workbook, true);
	titleStyle.setFont(titleFont);
	titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	titleStyle.setFillForegroundColor((short) 10);
	titleStyle.setAlignment(HorizontalAlignment.CENTER);
	titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);

	return titleStyle;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:24,代码来源:TitleStyleBuilder.java

示例3: initReport

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
@Override
protected void initReport()
{
	super.initReport();

	XlsReportConfiguration configuration = getCurrentItemConfiguration();
	
	if (!configuration.isWhitePageBackground())
	{
		backgroundMode = FillPatternType.NO_FILL;
	}

	nature = 
		new JRXlsExporterNature(
			jasperReportsContext, 
			filter, 
			configuration.isIgnoreGraphics(), 
			configuration.isIgnorePageMargins()
			);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRXlsExporter.java

示例4: getLoadedCellStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
protected HSSFCellStyle getLoadedCellStyle(
	FillPatternType mode,
	short backcolor,
	HorizontalAlignment horizontalAlignment,
	VerticalAlignment verticalAlignment,
	short rotation,
	HSSFFont font,
	BoxStyle box,
	boolean isWrapText,
	boolean isCellLocked,
	boolean isCellHidden,
	boolean isShrinkToFit
	)
{
	StyleInfo style = new StyleInfo(mode, backcolor, horizontalAlignment, verticalAlignment, rotation, font, box, isWrapText, isCellLocked, isCellHidden, isShrinkToFit);
	return getLoadedCellStyle(style);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:JRXlsExporter.java

示例5: defaultHeaderCellStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
/**
 * Returns the default header style. Obtained from:
 * http://svn.apache.org/repos/asf/poi
 * /trunk/src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java
 *
 * @param wb the wb
 * @return the cell style
 */
protected CellStyle defaultHeaderCellStyle(final Workbook wb) {
    CellStyle style;
    final Font monthFont = wb.createFont();
    monthFont.setFontHeightInPoints((short) 11);
    monthFont.setColor(IndexedColors.WHITE.getIndex());
    style = wb.createCellStyle();
    style.setAlignment(HorizontalAlignment.CENTER);
    style.setVerticalAlignment(VerticalAlignment.CENTER);
    style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());
    style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    style.setFont(monthFont);
    style.setWrapText(true);
    return style;
}
 
开发者ID:TFyre,项目名称:vaadin-gridexport,代码行数:23,代码来源:ExcelExport.java

示例6: StyleInfo

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
public StyleInfo(
	FillPatternType mode,
	short backcolor,
	HorizontalAlignment horizontalAlignment,
	VerticalAlignment verticalAlignment,
	short rotation,
	HSSFFont font,
	JRExporterGridCell gridCell,
	boolean wrapText,
	boolean cellLocked,
	boolean cellHidden,
	boolean shrinkToFit
	)
{
	this(mode, 
		backcolor, 
		horizontalAlignment, 
		verticalAlignment, 
		rotation, 
		font, 
		(gridCell == null ? null : new BoxStyle(gridCell)), 
		wrapText, 
		cellLocked, 
		cellHidden, 
		shrinkToFit);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:JRXlsExporter.java

示例7: initReport

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
@Override
protected void initReport() 
{
	super.initReport();

	XlsReportConfiguration configuration = getCurrentItemConfiguration();
	
	if (!configuration.isWhitePageBackground())
	{
		backgroundMode = FillPatternType.NO_FILL;
	}

	nature = 
		new JRXlsMetadataExporterNature(
			jasperReportsContext, 
			filter, 
			configuration.isIgnoreGraphics(), 
			configuration.isIgnorePageMargins()
			);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:JRXlsMetadataExporter.java

示例8: createCellStyleForColumnHeading

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
public static HSSFCellStyle createCellStyleForColumnHeading(HSSFWorkbook workBook) {
	HSSFCellStyle cellStyle = workBook.createCellStyle();
	HSSFFont fontObj = workBook.createFont();
	cellStyle.setBorderBottom(BorderStyle.THIN);
	cellStyle.setBorderTop(BorderStyle.THIN);
	cellStyle.setBorderLeft(BorderStyle.THIN);
	cellStyle.setBorderRight(BorderStyle.THIN);
	cellStyle.setWrapText(true);
	cellStyle.setAlignment(HorizontalAlignment.CENTER);
	cellStyle.setFillBackgroundColor(Short.valueOf("22").shortValue());
	cellStyle.setFillPattern(FillPatternType.BIG_SPOTS);
	cellStyle.setFillForegroundColor(Short.valueOf("22").shortValue());
	cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	fontObj.setFontName("Calibri");
	fontObj.setFontHeightInPoints(Short.valueOf("12").shortValue());
	fontObj.setBold(true);
	fontObj.setColor(Short.valueOf("8").shortValue());
	cellStyle.setFont(fontObj);
	return cellStyle;
}
 
开发者ID:siteadmin,项目名称:CCDA-Score-CARD,代码行数:21,代码来源:ScorecardExcelGenerator.java

示例9: addBackgroundColourToStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
@Override
public void addBackgroundColourToStyle(Workbook workbook, CellStyle style, String colour) {
	if(colour == null) {
		return ;
	}
	if(IStyle.TRANSPARENT_VALUE.equals(colour)) {
		return ;
	}
	if(style instanceof XSSFCellStyle) {
		XSSFCellStyle cellStyle = (XSSFCellStyle)style;
		XSSFColor xColour = getXColour(colour);
		if(xColour != null) {
			cellStyle.setFillForegroundColor(xColour);
			cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:StyleManagerXUtils.java

示例10: XLSXTranslatorOutputFormat

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
/**
 * Public constructor.
 * @param os output stream
 */
public XLSXTranslatorOutputFormat(final OutputStream os) {

  if (os == null) {
    throw new NullPointerException("The output stream is null");
  }

  this.os = os;

  // Temporary files will be compressed
  this.wb.setCompressTempFiles(true);

  // Define default style
  Font defaultFont = this.wb.createFont();
  defaultFont.setFontName("Arial");
  defaultFont.setFontHeightInPoints((short) 10);
  this.defaultStyle = this.wb.createCellStyle();
  this.defaultStyle.setFont(defaultFont);

  // Define header style
  Font headerFont = this.wb.createFont();
  headerFont.setFontName(defaultFont.getFontName());
  headerFont.setFontHeightInPoints(defaultFont.getFontHeightInPoints());
  headerFont.setItalic(true);
  this.headerStyle = this.wb.createCellStyle();
  this.headerStyle.setFillForegroundColor(IndexedColors.ORANGE.getIndex());
  this.headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
  this.headerStyle.setFont(headerFont);

  // Define link style
  Font linkfont = this.wb.createFont();
  linkfont.setFontName(defaultFont.getFontName());
  linkfont.setFontHeightInPoints(defaultFont.getFontHeightInPoints());
  linkfont.setUnderline(XSSFFont.U_SINGLE);
  linkfont.setColor(IndexedColors.BLUE.getIndex());
  this.linkStyle = this.wb.createCellStyle();
  this.linkStyle.setFont(linkfont);
}
 
开发者ID:GenomicParisCentre,项目名称:eoulsan,代码行数:42,代码来源:XLSXTranslatorOutputFormat.java

示例11: addBlankCell

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
@Override
protected void addBlankCell(JRExporterGridCell gridCell, int colIndex, int rowIndex)
{
	cell = row.createCell(colIndex);

	FillPatternType mode = backgroundMode;
	short backcolor = whiteIndex;
	
	if (!Boolean.TRUE.equals(sheetInfo.ignoreCellBackground) && gridCell.getCellBackcolor() != null)
	{
		mode = FillPatternType.SOLID_FOREGROUND;
		backcolor = getWorkbookColor(gridCell.getCellBackcolor()).getIndex();
	}

	short forecolor = blackIndex;
	if (gridCell.getForecolor() != null)
	{
		forecolor = getWorkbookColor(gridCell.getForecolor()).getIndex();
	}

	HSSFCellStyle cellStyle =
		getLoadedCellStyle(
			mode,
			backcolor,
			HorizontalAlignment.LEFT,
			VerticalAlignment.TOP,
			(short)0,
			getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
			gridCell,
			true, 
			true, 
			false, 
			false
			);

	cell.setCellStyle(cellStyle);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:38,代码来源:JRXlsExporter.java

示例12: createHeaderStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
public static CellStyle createHeaderStyle(Workbook workbook) {
    XSSFCellStyle headerStyle = createCellStyle(workbook);
    XSSFColor header = new XSSFColor(new byte[]{(byte) 79, (byte) 129, (byte) 189});
    headerStyle.setFillForegroundColor(header);
    headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    headerStyle.getFont().setColor(IndexedColors.WHITE.index);
    return headerStyle;
}
 
开发者ID:Adobe-Consulting-Services,项目名称:aem-epic-tool,代码行数:9,代码来源:ReportUtil.java

示例13: exportExcelTemplate

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void exportExcelTemplate(HttpServletRequest req, HttpServletResponse resp) throws Exception {
	List<VariableCategory> variableCategories=(List<VariableCategory>)httpSessionKnowledgeCache.get(req, VCS_KEY);
	if(variableCategories==null){
		KnowledgeBase knowledgeBase=buildKnowledgeBase(req);
		variableCategories=knowledgeBase.getResourceLibrary().getVariableCategories();
	}
	SXSSFWorkbook wb = new SXSSFWorkbook();
	XSSFCellStyle style=(XSSFCellStyle)wb.createCellStyle();
	Color c=new Color(147,208,15);
	XSSFColor xssfColor=new XSSFColor(c);
	style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
	style.setFillForegroundColor(xssfColor);
	for(VariableCategory vc:variableCategories){
		buildSheet(wb, vc,style);
	}
	resp.setContentType("application/x-xls");
	resp.setHeader("Content-Disposition","attachment; filename=urule-batch-test-template.xlsx");
	OutputStream outputStream=resp.getOutputStream();
	wb.write(outputStream);;
	outputStream.flush();
	outputStream.close();
}
 
开发者ID:youseries,项目名称:urule,代码行数:24,代码来源:PackageServletHandler.java

示例14: defaultTotalsDoubleCellStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
/**
 * Returns the default totals row style for Double data. Obtained from:
 * http://svn.apache.org/repos/asf/poi
 * /trunk/src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java
 *
 * @param wb the wb
 * @return the cell style
 */
protected CellStyle defaultTotalsDoubleCellStyle(final Workbook wb) {
    CellStyle style;
    style = wb.createCellStyle();
    style.setAlignment(HorizontalAlignment.CENTER);
    style.setVerticalAlignment(VerticalAlignment.CENTER);
    style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
    style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    style.setDataFormat(doubleDataFormat);
    return style;
}
 
开发者ID:TFyre,项目名称:vaadin-gridexport,代码行数:19,代码来源:ExcelExport.java

示例15: defaultTotalsIntegerCellStyle

import org.apache.poi.ss.usermodel.FillPatternType; //导入依赖的package包/类
/**
 * Returns the default totals row style for Integer data. Obtained from:
 * http://svn.apache.org/repos/asf/poi
 * /trunk/src/examples/src/org/apache/poi/ss/examples/TimesheetDemo.java
 *
 * @param wb the wb
 * @return the cell style
 */
protected CellStyle defaultTotalsIntegerCellStyle(final Workbook wb) {
    CellStyle style;
    style = wb.createCellStyle();
    style.setAlignment(HorizontalAlignment.CENTER);
    style.setVerticalAlignment(VerticalAlignment.CENTER);
    style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
    style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    style.setDataFormat(integerDataFormat);
    return style;
}
 
开发者ID:TFyre,项目名称:vaadin-gridexport,代码行数:19,代码来源:ExcelExport.java


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