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


Java ModeEnum.OPAQUE属性代码示例

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


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

示例1: getHtmlFragment

@Override
public String getHtmlFragment(JRHtmlExporterContext exporterContext,
		JRGenericPrintElement element)
{
	StringBuilder script = new StringBuilder(128);
	String htmlContent = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_HTML_CONTENT);
	
	script.append("<div style='width:" + (element.getWidth() - 0) + "px;height:" + (element.getHeight() - 0) + "px;");
	
	if (element.getModeValue() == ModeEnum.OPAQUE)
	{
		script.append("background-color: #");
		script.append(JRColorUtil.getColorHexa(element.getBackcolor()));
		script.append("; ");
	}
	script.append("overflow:hidden;'>");
	script.append(htmlContent);
	script.append("</div>");

	return script.toString();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:21,代码来源:HtmlElementHtmlHandler.java

示例2: getAttributes

/**
 *
 */
private Map<Attribute,Object> getAttributes(JRStyle style)//FIXMEDOCX put this in util?
{
	Map<Attribute,Object> styledTextAttributes = new HashMap<Attribute,Object>(); 

	if (style != null)
	{
		JRPrintText text = new JRBasePrintText(null);
		text.setStyle(style);
		
		//JRFontUtil.getAttributes(styledTextAttributes, text, (Locale)null);//FIXMEDOCX getLocale());
		fontUtil.getAttributesWithoutAwtFont(styledTextAttributes, text);
		styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor());
		if (text.getModeValue() == ModeEnum.OPAQUE)
		{
			styledTextAttributes.put(TextAttribute.BACKGROUND, text.getBackcolor());
		}
	}

	return styledTextAttributes;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:23,代码来源:DocxRunHelper.java

示例3: getStyledTextAttributes

/**
 *
 */
protected Map<Attribute,Object> getStyledTextAttributes()
{
	JRStyle style = getStyle();
	Map<Attribute,Object> styledTextAttributes = styledTextAttributesMap.get(style);
	if (styledTextAttributes == null)
	{
		styledTextAttributes = new HashMap<Attribute,Object>(); 
		//JRFontUtil.getAttributes(styledTextAttributes, this, filler.getLocale());
		FontUtil.getInstance(filler.getJasperReportsContext()).getAttributesWithoutAwtFont(styledTextAttributes, this);
		styledTextAttributes.put(TextAttribute.FOREGROUND, getForecolor());
		if (getModeValue() == ModeEnum.OPAQUE)
		{
			styledTextAttributes.put(TextAttribute.BACKGROUND, getBackcolor());
		}
		styledTextAttributesMap.put(style, styledTextAttributes);
	}
	
	return styledTextAttributes;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:JRFillTextElement.java

示例4: getAttributes

/**
 *
 */
private Map<Attribute,Object> getAttributes(JRStyle style)//FIXMEDOCX put this in util?
{
	JRPrintText text = new JRBasePrintText(null);
	text.setStyle(style);
	
	Map<Attribute,Object> styledTextAttributes = new HashMap<Attribute,Object>(); 
	//JRFontUtil.getAttributes(styledTextAttributes, text, (Locale)null);//FIXMEDOCX getLocale());
	fontUtil.getAttributesWithoutAwtFont(styledTextAttributes, text);
	styledTextAttributes.put(TextAttribute.FOREGROUND, text.getForecolor());
	if (text.getModeValue() == ModeEnum.OPAQUE)
	{
		styledTextAttributes.put(TextAttribute.BACKGROUND, text.getBackcolor());
	}

	return styledTextAttributes;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:XlsxRunHelper.java

示例5: setChartBackground

protected void setChartBackground(JFreeChart jfreeChart)
{
	Paint defaultBackgroundPaint = (Paint)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_PAINT);
	Image defaultBackgroundImage = (Image)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_IMAGE);
	Integer defaultBackgroundImageAlignment = (Integer)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_IMAGE_ALIGNMENT);
	Float defaultBackgroundImageAlpha = (Float)getDefaultValue(defaultChartPropertiesMap, ChartThemesConstants.BACKGROUND_IMAGE_ALPHA);

	if (getChart().getOwnModeValue() != null)
	{
		if (getChart().getOwnModeValue() == ModeEnum.OPAQUE)
		{
			if (getChart().getOwnBackcolor() == null && defaultBackgroundPaint != null)
			{
				jfreeChart.setBackgroundPaint(defaultBackgroundPaint);
			}
			else
			{
				jfreeChart.setBackgroundPaint(getChart().getBackcolor());
			}
			
			setChartBackgroundImage(jfreeChart, 
					defaultBackgroundImage,
					defaultBackgroundImageAlignment,
					defaultBackgroundImageAlpha);
		}
		else
		{
			jfreeChart.setBackgroundPaint(ChartThemesConstants.TRANSPARENT_PAINT);
			setChartBackgroundImage(jfreeChart, 
					defaultBackgroundImage,
					defaultBackgroundImageAlignment,
					new Float(0f));
		}
	}
	else if (defaultBackgroundPaint != null)
	{
		jfreeChart.setBackgroundPaint(defaultBackgroundPaint);
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:39,代码来源:GenericChartTheme.java

示例6: setChartBackground

protected void setChartBackground(JFreeChart jfreeChart)
{
	Paint backgroundPaint = getChartSettings().getBackgroundPaint() == null ? null : getChartSettings().getBackgroundPaint().getPaint();

	if (getChart().getOwnModeValue() != null)
	{
		if (getChart().getOwnModeValue() == ModeEnum.OPAQUE)
		{
			if (getChart().getOwnBackcolor() != null || backgroundPaint == null)
			{
				backgroundPaint = getChart().getBackcolor();
			}
		}
		else
		{
			backgroundPaint = ChartThemesConstants.TRANSPARENT_PAINT;
		}
	}
	
	if (backgroundPaint != null)
	{
		GradientPaint gp = backgroundPaint instanceof GradientPaint ? (GradientPaint)backgroundPaint : null;
		if (gp != null)
		{
			backgroundPaint = new GradientPaint(0f, 0f, gp.getColor1(), 0f, getChart().getHeight() * 0.7f, gp.getColor2(), false);
		}
		jfreeChart.setBackgroundPaint(backgroundPaint);
	}

	setChartBackgroundImage(jfreeChart);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:31,代码来源:SimpleChartTheme.java

示例7: getStyledTextAttributes

@Override
public Map<Attribute,Object> getStyledTextAttributes(JRPrintText printText)
{
	Map<Attribute,Object> attributes = new HashMap<Attribute,Object>(); 
	//JRFontUtil.getAttributes(attributes, printText, getTextLocale(printText));
	FontUtil.getInstance(jasperReportsContext).getAttributesWithoutAwtFont(attributes, printText);
	attributes.put(TextAttribute.FOREGROUND, printText.getForecolor());
	if (printText.getModeValue() == ModeEnum.OPAQUE)
	{
		attributes.put(TextAttribute.BACKGROUND, printText.getBackcolor());
	}
	return attributes;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:JRStyledTextAttributeSelector.java

示例8: exportFrame

/**
 *
 */
protected void exportFrame(TableBuilder tableBuilder, JRPrintFrame frame, JRExporterGridCell gridCell) throws IOException, JRException
{
	tableBuilder.buildCellHeader(styleCache.getCellStyle(gridCell), gridCell.getColSpan(), gridCell.getRowSpan());

	boolean appendBackcolor =
		frame.getModeValue() == ModeEnum.OPAQUE
		&& (backcolor == null || frame.getBackcolor().getRGB() != backcolor.getRGB());

	if (appendBackcolor)
	{
		setBackcolor(frame.getBackcolor());
	}

	try
	{
		JRGridLayout layout = ((ElementGridCell) gridCell).getLayout();
		JRPrintElementIndex frameIndex =
			new JRPrintElementIndex(
					reportIndex,
					pageIndex,
					gridCell.getElementAddress()
					);
		exportGrid(layout, frameIndex);
	}
	finally
	{
		if (appendBackcolor)
		{
			restoreBackcolor();
		}
	}

	tableBuilder.buildCellFooter();
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:37,代码来源:JROdtExporter.java

示例9: FrameStyle

/**
 *
 */
public FrameStyle(WriterHelper styleWriter, JRPrintElement element)
{
	super(styleWriter);
	
	if (element.getModeValue() == ModeEnum.OPAQUE)
	{
		fill = "solid";
		backcolor = JRColorUtil.getColorHexa(element.getBackcolor());
	}
	else
	{
		fill = "none";
	}
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:17,代码来源:FrameStyle.java

示例10: CellStyle

/**
 *
 */
public CellStyle(WriterHelper styleWriter, JRExporterGridCell gridCell, boolean shrinkToFit, boolean wrapText)
{
	super(styleWriter);

	JRPrintElement element = gridCell.getElement();
	
	if (element != null && element.getModeValue() == ModeEnum.OPAQUE)
	{
		//fill = "solid";
		backcolor = JRColorUtil.getColorHexa(element.getBackcolor());
	}
	else
	{
		//fill = "none";
		if (gridCell.getBackcolor() != null)
		{
			backcolor = JRColorUtil.getColorHexa(gridCell.getBackcolor());
		}
	}

	RotationEnum rotation = element instanceof JRPrintText ? ((JRPrintText)element).getRotationValue() : RotationEnum.NONE;
	VerticalTextAlignEnum vAlign = VerticalTextAlignEnum.TOP;
	HorizontalTextAlignEnum hAlign = HorizontalTextAlignEnum.LEFT;

	JRTextAlignment alignment = element instanceof JRTextAlignment ? (JRTextAlignment)element : null;
	if (alignment != null)
	{
		vAlign = alignment.getVerticalTextAlign();
		hAlign = alignment.getHorizontalTextAlign();
	}
	
	horizontalAlignment = ParagraphStyle.getHorizontalAlignment(hAlign, vAlign, rotation);
	verticalAlignment = ParagraphStyle.getVerticalAlignment(hAlign, vAlign, rotation);
	this.shrinkToFit = shrinkToFit;
	this.wrapText = wrapText;
	setBox(gridCell.getBox());
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:40,代码来源:CellStyle.java

示例11: getStyledText

@Override
protected JRStyledText getStyledText(JRPrintText textElement)
{
	JRStyledTextAttributeSelector selector = textElement.getModeValue() == ModeEnum.OPAQUE 
			? allSelector 
			: noBackcolorSelector;
	return textElement.getFullStyledText(selector);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRXlsAbstractExporter.java

示例12: getElementBackcolor

protected Color getElementBackcolor(BaseElementCell cell)
{
	if (cell == null)
	{
		return null;
	}
	
	JRPrintElement element = getCellElement(cell);
	if (element.getModeValue() == ModeEnum.OPAQUE)
	{
		return element.getBackcolor();
	}
	
	return getElementBackcolor(cell.getParent());
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:Tabulator.java

示例13: getCellBackcolor

public Color getCellBackcolor()
{
	Color color;
	JRPrintElement element = getElement();
	if (element != null && element.getModeValue() == ModeEnum.OPAQUE)
	{
		color = element.getBackcolor();
	}
	else
	{
		color = getBackcolor();
	}
	return color;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:14,代码来源:JRExporterGridCell.java

示例14: exportFrame

/**
	 * In deep grids, this is called only for empty frames.
	 */
	protected void exportFrame(DocxTableHelper tableHelper, JRPrintFrame frame, JRExporterGridCell gridCell) throws JRException
	{
		tableHelper.getCellHelper().exportHeader(frame, gridCell);
//		tableHelper.getCellHelper().exportProps(gridCell);

		boolean appendBackcolor =
			frame.getModeValue() == ModeEnum.OPAQUE
			&& (backcolor == null || frame.getBackcolor().getRGB() != backcolor.getRGB());

		if (appendBackcolor)
		{
			setBackcolor(frame.getBackcolor());
		}

		try
		{
			JRGridLayout layout = ((ElementGridCell) gridCell).getLayout();
			JRPrintElementIndex frameIndex =
				new JRPrintElementIndex(
						reportIndex,
						pageIndex,
						gridCell.getElementAddress()
						);
			exportGrid(layout, frameIndex);
		}
		finally
		{
			if (appendBackcolor)
			{
				restoreBackcolor();
			}
		}
		
		tableHelper.getParagraphHelper().exportEmptyParagraph();
		tableHelper.getCellHelper().exportFooter();
	}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:39,代码来源:JRDocxExporter.java

示例15: startElement

/**
 *
 */
private void startElement(JRPrintElement element) throws IOException 
{
	contentWriter.write("{\\shp\\shpbxpage\\shpbypage\\shpwr5\\shpfhdr0\\shpfblwtxt0\\shpz");
	contentWriter.write(String.valueOf(zorder++));
	contentWriter.write("\\shpleft");
	contentWriter.write(String.valueOf(LengthUtil.twip(element.getX() + getOffsetX())));
	contentWriter.write("\\shpright");
	contentWriter.write(String.valueOf(LengthUtil.twip(element.getX() + getOffsetX() + element.getWidth())));
	contentWriter.write("\\shptop");
	contentWriter.write(String.valueOf(LengthUtil.twip(element.getY() + getOffsetY())));
	contentWriter.write("\\shpbottom");
	contentWriter.write(String.valueOf(LengthUtil.twip(element.getY() + getOffsetY() + element.getHeight())));

	Color bgcolor = element.getBackcolor();

	if (element.getModeValue() == ModeEnum.OPAQUE)
	{
		contentWriter.write("{\\sp{\\sn fFilled}{\\sv 1}}");
		contentWriter.write("{\\sp{\\sn fillColor}{\\sv ");
		contentWriter.write(String.valueOf(getColorRGB(bgcolor)));
		contentWriter.write("}}");
	}
	else
	{
		contentWriter.write("{\\sp{\\sn fFilled}{\\sv 0}}");
	}
	
	contentWriter.write("{\\shpinst");
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:32,代码来源:JRRtfExporter.java


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