當前位置: 首頁>>代碼示例>>Java>>正文


Java StyleFormatConstants類代碼示例

本文整理匯總了Java中ro.nextreports.engine.exporter.util.StyleFormatConstants的典型用法代碼示例。如果您正苦於以下問題:Java StyleFormatConstants類的具體用法?Java StyleFormatConstants怎麽用?Java StyleFormatConstants使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


StyleFormatConstants類屬於ro.nextreports.engine.exporter.util包,在下文中一共展示了StyleFormatConstants類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildCellBorder

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void buildCellBorder(Map<String, Object> format, Border border) {
    if (border.getLeft() > 0) {
        format.put(StyleFormatConstants.BORDER_LEFT, new Float(border.getLeft()));            
    }
    if (border.getRight() > 0) {
        format.put(StyleFormatConstants.BORDER_RIGHT, new Float(border.getRight()));
    }
    if (border.getTop() > 0) {
        format.put(StyleFormatConstants.BORDER_TOP, new Float(border.getTop()));
    }
    if (border.getBottom() > 0) {
        format.put(StyleFormatConstants.BORDER_BOTTOM, new Float(border.getBottom()));
    }        
    format.put(StyleFormatConstants.BORDER_LEFT_COLOR, border.getLeftColor());
    format.put(StyleFormatConstants.BORDER_RIGHT_COLOR, border.getRightColor());
    format.put(StyleFormatConstants.BORDER_TOP_COLOR, border.getTopColor());
    format.put(StyleFormatConstants.BORDER_BOTTOM_COLOR, border.getBottomColor());
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:19,代碼來源:ResultExporter.java

示例2: buildCellFont

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void buildCellFont(Map<String, Object> format, Font font) {
    format.put(StyleFormatConstants.FONT_FAMILY_KEY, font.getFamily());
    format.put(StyleFormatConstants.FONT_NAME_KEY, font.getName());
    format.put(StyleFormatConstants.FONT_SIZE, new Float(font.getSize()));
    if (Font.PLAIN == font.getStyle()) {
        format.put(StyleFormatConstants.FONT_STYLE_KEY, StyleFormatConstants.FONT_STYLE_NORMAL);
    }
    if (Font.BOLD == font.getStyle()) {
        format.put(StyleFormatConstants.FONT_STYLE_KEY, StyleFormatConstants.FONT_STYLE_BOLD);
    }
    if (Font.ITALIC == font.getStyle()) {
        format.put(StyleFormatConstants.FONT_STYLE_KEY, StyleFormatConstants.FONT_STYLE_ITALIC);
    }
    if ((Font.BOLD | Font.ITALIC) == font.getStyle()) {
        format.put(StyleFormatConstants.FONT_STYLE_KEY, StyleFormatConstants.FONT_STYLE_BOLDITALIC);
    }
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:18,代碼來源:ResultExporter.java

示例3: getCategory

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
public int getCategory(String pattern) {
    if (pattern == null) {
        return 0;
    } else {
    	if (pattern.equals(StyleFormatConstants.ROMAN_PATTERN)) {
    		return 1;
    	} else if (pattern.contains("dd") || pattern.contains("MM") || pattern.contains("yy")) {
            return 2;
        } else if (pattern.contains("HH") || pattern.contains("mm") || pattern.contains("ss")) {
            return 3;
        } else {            	
        	boolean isCurrency = false;
        	int index = pattern.indexOf("#");
        	if (index == -1) {
        		index = pattern.indexOf("0");
        	}
        	if (index != -1) {
        		String s = pattern.substring(0, index);
        		if (s.contains(" ")) {
        			isCurrency = true;
        		}
        	}
        	if (isCurrency) {
        		return 4;
        	} else if (pattern.contains("%") || pattern.contains("\u2030")) {
        		return 5;	
        	} else if (pattern.contains("E")) {
        		return 6;           
        	}
            return 0;
        }
    }
}
 
開發者ID:nextreports,項目名稱:nextreports-designer,代碼行數:34,代碼來源:FieldPatternPanel.java

示例4: renderCssCode

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private String renderCssCode(BandElement be, Object value, int gridRow, int gridColumn, int colSpan, boolean overwriteCellRenderCond) {
    Map<String, Object> style = null;
    style = buildCellStyleMap(be, value, gridRow, gridColumn, colSpan, overwriteCellRenderCond);
    
    // to see a background image all cells must not have any background!
    if (bean.getReportLayout().getBackgroundImage() != null) {
    	style.remove(StyleFormatConstants.BACKGROUND_COLOR);
    }	
    
    return HtmlUtil.getCssCode(be, style);
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:12,代碼來源:HtmlExporter.java

示例5: onOpenDocument

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
/**
 * Creates the PdfTemplate that will hold the total number of pages.        
 */
public void onOpenDocument(PdfWriter writer, Document document) {
	int size = 10;
	if (totalPageNoVbe != null) {
		Map<String, Object> style = buildCellStyleMap(totalPageNoVbe);
		size = ((Float) style.get(StyleFormatConstants.FONT_SIZE)).intValue();        		
	}        	
    total = writer.getDirectContent().createTemplate(30, size);
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:12,代碼來源:PdfExporter.java

示例6: onCloseDocument

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
/**
       * Fills out the total number of pages before the document is closed.        
       */
public void onCloseDocument(PdfWriter writer, Document document) {
	totalPageNo = writer.getPageNumber() - 1;
	if (totalPageNoVbe != null) {
		Map<String, Object> style = buildCellStyleMap(totalPageNoVbe);
		
		fontName = (String) style.get(StyleFormatConstants.FONT_NAME_KEY);
		int size = ((Float) style.get(StyleFormatConstants.FONT_SIZE)).intValue();
		Font fnt = getFont(size);
		updateFont(style, fnt);
						
		ColumnText.showTextAligned(total, Element.ALIGN_LEFT, new Phrase(String.valueOf(totalPageNo), fnt), 0, 1, 0);
	} 			
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:17,代碼來源:PdfExporter.java

示例7: setBackground

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void setBackground(Tc tableCell, Map<String, Object> style) {
	// to see a background image all cells must not have any background!
	if (bean.getReportLayout().getBackgroundImage() == null) {
		if (style.containsKey(StyleFormatConstants.BACKGROUND_COLOR)) {
			Color val = (Color) style.get(StyleFormatConstants.BACKGROUND_COLOR);
			setCellColor(tableCell, ColorUtil.getHexColor(val).substring(1));
		}
	}
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:10,代碼來源:DocxExporter.java

示例8: setVerticalAlignment

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void setVerticalAlignment(Tc tableCell, Map<String, Object> style) {
	if (style.containsKey(StyleFormatConstants.HORIZONTAL_ALIGN_KEY)) {
		if (StyleFormatConstants.VERTICAL_ALIGN_TOP.equals(style.get(StyleFormatConstants.VERTICAL_ALIGN_KEY))) {
           	setVerticalAlignment(tableCell, STVerticalJc.TOP);
           }
           if (StyleFormatConstants.VERTICAL_ALIGN_MIDDLE.equals(style.get(StyleFormatConstants.VERTICAL_ALIGN_KEY))) {
           	setVerticalAlignment(tableCell, STVerticalJc.CENTER);
           }
           if (StyleFormatConstants.VERTICAL_ALIGN_BOTTOM.equals(style.get(StyleFormatConstants.VERTICAL_ALIGN_KEY))) {
           	setVerticalAlignment(tableCell, STVerticalJc.BOTTOM);
           }
	}
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:14,代碼來源:DocxExporter.java

示例9: setHorizontalAlignment

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void setHorizontalAlignment(P paragraph, Map<String, Object> style) {
	if (style.containsKey(StyleFormatConstants.HORIZONTAL_ALIGN_KEY)) {
		if (StyleFormatConstants.HORIZONTAL_ALIGN_LEFT.equals(style.get(StyleFormatConstants.HORIZONTAL_ALIGN_KEY))) {
			setHorizontalAlignment(paragraph, JcEnumeration.LEFT);
		}
		if (StyleFormatConstants.HORIZONTAL_ALIGN_RIGHT.equals(style.get(StyleFormatConstants.HORIZONTAL_ALIGN_KEY))) {
			setHorizontalAlignment(paragraph, JcEnumeration.RIGHT);
		}
		if (StyleFormatConstants.HORIZONTAL_ALIGN_CENTER.equals(style.get(StyleFormatConstants.HORIZONTAL_ALIGN_KEY))) {
			setHorizontalAlignment(paragraph, JcEnumeration.CENTER);
		}
	}
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:14,代碼來源:DocxExporter.java

示例10: buildCellHAllign

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void buildCellHAllign(Map<String, Object> format, int hAllign) {
    if (SwingConstants.CENTER == hAllign) {
        format.put(StyleFormatConstants.HORIZONTAL_ALIGN_KEY, StyleFormatConstants.HORIZONTAL_ALIGN_CENTER);
    }
    if (SwingConstants.LEFT == hAllign) {
        format.put(StyleFormatConstants.HORIZONTAL_ALIGN_KEY, StyleFormatConstants.HORIZONTAL_ALIGN_LEFT);
    }
    if (SwingConstants.RIGHT == hAllign) {
        format.put(StyleFormatConstants.HORIZONTAL_ALIGN_KEY, StyleFormatConstants.HORIZONTAL_ALIGN_RIGHT);
    }
}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:12,代碼來源:ResultExporter.java

示例11: buildCellVAllign

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void buildCellVAllign(Map<String, Object> format, int vAllign) {
    if (SwingConstants.CENTER == vAllign) {
        format.put(StyleFormatConstants.VERTICAL_ALIGN_KEY, StyleFormatConstants.VERTICAL_ALIGN_MIDDLE);
    }
    if (SwingConstants.TOP == vAllign) {
        format.put(StyleFormatConstants.VERTICAL_ALIGN_KEY, StyleFormatConstants.VERTICAL_ALIGN_TOP);
    }
    if (SwingConstants.BOTTOM == vAllign) {
        format.put(StyleFormatConstants.VERTICAL_ALIGN_KEY, StyleFormatConstants.VERTICAL_ALIGN_BOTTOM);
    }

}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:13,代碼來源:ResultExporter.java

示例12: setCellStyle

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void setCellStyle(Item cellItem, IModel rowModel, int rowIndex) {
  	List<Map<String, Object>> styles = ((RowData)rowModel.getObject()).getStyles();    	
if (styles.size() > rowIndex) {				
	Map<String, Object> style = styles.get(rowIndex);
	boolean needed = setIframeStyleParameters(style);
	Color val = (Color) style.get(StyleFormatConstants.FONT_COLOR);
	if ((val != null) || (iframeFontSize != null)) {				
		String text = HtmlUtil.getCssCode(null, style, needed);
		cellItem.add(new AttributeAppender("style", Model.of(text)));
	}
}
  }
 
開發者ID:nextreports,項目名稱:nextreports-server,代碼行數:13,代碼來源:TableRendererPanel.java

示例13: setIframeStyleParameters

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private boolean setIframeStyleParameters(Map<String, Object> style) {
  	boolean needed = false;
if (iframeFontSize != null) {
	style.put(StyleFormatConstants.FONT_SIZE, Float.parseFloat(iframeFontSize));
	if (iframeCellPadding != null) {
		Float padding = Float.parseFloat(iframeCellPadding);					
		style.put(StyleFormatConstants.PADDING_LEFT, padding);
		style.put(StyleFormatConstants.PADDING_RIGHT, padding);
		style.put(StyleFormatConstants.PADDING_TOP, padding);
		style.put(StyleFormatConstants.PADDING_BOTTOM, padding);				
	}
	needed = true;
}	
return needed;
  }
 
開發者ID:nextreports,項目名稱:nextreports-server,代碼行數:16,代碼來源:TableRendererPanel.java

示例14: setCellStyle

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
private void setCellStyle(Item cellItem, IModel rowModel, int rowIndex) {
  	List<Map<String, Object>> styles = ((AnalysisRow)rowModel.getObject()).getStyles();
if (styles.size() > rowIndex) {
	Map<String, Object> style = styles.get(rowIndex);
	Color val = (Color) style.get(StyleFormatConstants.FONT_COLOR);
	if (val != null) {
		String text = HtmlUtil.getCssCode(null, style, false);
		cellItem.add(new AttributeAppender("style", Model.of(text)));
	}
}
  }
 
開發者ID:nextreports,項目名稱:nextreports-server,代碼行數:12,代碼來源:AnalysisTablePanel.java

示例15: exportCell

import ro.nextreports.engine.exporter.util.StyleFormatConstants; //導入依賴的package包/類
protected void exportCell(String bandName, BandElement bandElement, Object value, int gridRow, int row, int column, int cols,
		int rowSpan, int colSpan, boolean isImage) {

	int headerRows = getHeaderRows();
	int detailRows = getDetailRows();
	Map<String, Object> style = buildCellStyleMap(bandElement, value, gridRow, column, colSpan);

	if (ReportLayout.HEADER_BAND_NAME.equals(bandName)) {
		if (headerRows == 1) {
			if (row == 0) {
				switch (column) {
				case 0:
					data.setTitle(replaceParameters(getBandElementValueAsString(bandElement)));
					if (bandElement.getHorizontalAlign() == BandElement.CENTER) {
						data.setTitleAlignment(DisplayData.TITLE_ALIGNMENT_CENTER);
					} else {
						data.setTitleAlignment(DisplayData.TITLE_ALIGNMENT_VALUE);
					}
					data.setBackground(ColorUtil.getHexColor(bandElement.getBackground()));
					if (style.containsKey(StyleFormatConstants.BACKGROUND_COLOR)) {
						data.setBackground(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.BACKGROUND_COLOR)));
					}
					data.setTitleColor(ColorUtil.getHexColor(bandElement.getForeground()));
					if (style.containsKey(StyleFormatConstants.FONT_COLOR)) {
						data.setTitleColor(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.FONT_COLOR)));
					}
					break;
				case 1:
					data.setShouldRise(Boolean.parseBoolean(bandElement.getText()));
					break;
				case 2:
					data.setShadow(Boolean.parseBoolean(bandElement.getText()));
					break;
				}
			} 
		}
	} else if (ReportLayout.DETAIL_BAND_NAME.equals(bandName)) {
		if (detailRows == 1) {
			if (column == 0) {					
				data.setValueColor(ColorUtil.getHexColor(bandElement.getForeground()));
				if (style.containsKey(StyleFormatConstants.FONT_COLOR)) {
					data.setValueColor(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.FONT_COLOR)));
				}
				data.setValue(StringUtil.getValueAsString(value, ((ColumnBandElement)bandElement).getPattern()));
				for (Alert alert : alerts) {                	
					if (isAlert(alert, value)) {
						executeAlert(alert, value, "");
					} 
				}
			} else if (column == 1) {					
				data.setPreviousColor(ColorUtil.getHexColor(bandElement.getForeground()));
				if (style.containsKey(StyleFormatConstants.FONT_COLOR)) {
					data.setPreviousColor(ColorUtil.getHexColor((Color) style.get(StyleFormatConstants.FONT_COLOR)));
				}					
				data.setPrevious(StringUtil.getValueAsString(value, ((ColumnBandElement)bandElement).getPattern()));
			} else if (column == 2) {										
				data.setUp((Boolean)value);
			} else if (column == 3) {	
				String prev = getBandElementValueAsString(bandElement);
				if ((prev != null) && !prev.endsWith("%")) {
					prev = prev + "%";
				}
				data.setPrevious(prev);
			}
		}
		return;
	}

}
 
開發者ID:nextreports,項目名稱:nextreports-engine,代碼行數:70,代碼來源:DisplayExporter.java


注:本文中的ro.nextreports.engine.exporter.util.StyleFormatConstants類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。