本文整理汇总了Java中net.sf.jasperreports.engine.type.ModeEnum类的典型用法代码示例。如果您正苦于以下问题:Java ModeEnum类的具体用法?Java ModeEnum怎么用?Java ModeEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModeEnum类属于net.sf.jasperreports.engine.type包,在下文中一共展示了ModeEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getTextElementReplacement
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
public JRPrintText getTextElementReplacement(
JRExporterContext exporterContext,
JRGenericPrintElement element
)
{
JRBasePrintText text = new JRBasePrintText(exporterContext.getExportedReport().getDefaultStyleProvider());
text.setX(element.getX());
text.setY(element.getY());
text.setWidth(element.getWidth());
text.setHeight(element.getHeight());
text.setText("[Open Flash Chart Component]");
text.setMode(ModeEnum.OPAQUE);
text.setBackcolor(Color.lightGray);
text.setHorizontalTextAlign(HorizontalTextAlignEnum.CENTER);
text.setVerticalTextAlign(VerticalTextAlignEnum.MIDDLE);
text.getLineBox().getPen().setLineWidth(1f);
text.getLineBox().getPen().setLineColor(Color.black);
text.getLineBox().getPen().setLineStyle(LineStyleEnum.DASHED);
JRTextMeasurerUtil.getInstance(exporterContext.getJasperReportsContext()).measureTextElement(text);
return text;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:24,代码来源:BaseChartHandler.java
示例2: getHtmlFragment
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
@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,代码行数:22,代码来源:HtmlElementHtmlHandler.java
示例3: getMode
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
*
*/
public ModeEnum getMode(JRCommonElement element, ModeEnum defaultMode)
{
ModeEnum ownMode = element.getOwnModeValue();
if (ownMode != null)
{
return ownMode;
}
JRStyle style = getBaseStyle(element);
if (style != null)
{
ModeEnum mode = style.getModeValue();
if (mode != null)
{
return mode;
}
}
return defaultMode;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:StyleResolver.java
示例4: getAttributes
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
*
*/
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,代码行数:20,代码来源:PptxRunHelper.java
示例5: getAttributes
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
*
*/
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,代码行数:24,代码来源:DocxRunHelper.java
示例6: getStyledTextAttributes
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
*
*/
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,代码行数:23,代码来源:JRFillTextElement.java
示例7: setChartBackground
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
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,代码行数:40,代码来源:GenericChartTheme.java
示例8: setChartBackground
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
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,代码行数:32,代码来源:SimpleChartTheme.java
示例9: setMode
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
@Override
public void setMode(ModeEnum modeValue)
{
Object old = this.modeValue;
this.modeValue = modeValue;
getEventSupport().firePropertyChange(JRBaseStyle.PROPERTY_MODE, old, this.modeValue);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRBaseElement.java
示例10: readObject
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
in.defaultReadObject();
if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
{
modeValue = ModeEnum.getByValue(mode);
positionTypeValue = PositionTypeEnum.getByValue(positionType);
stretchTypeValue = StretchTypeEnum.getByValue(stretchType);
mode = null;
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:JRBaseElement.java
示例11: readObject
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
in.defaultReadObject();
if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
{
modeValue = ModeEnum.getByValue(mode);
mode = null;
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:JRDesignCellContents.java
示例12: readObject
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
@SuppressWarnings("deprecation")
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
in.defaultReadObject();
if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_3_7_2)
{
modeValue = ModeEnum.getByValue(mode);
mode = null;
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:JRBasePrintElement.java
示例13: setMode
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
* Sets the cell transparency mode.
*
* @param modeValue the transparency mode
* @see JRCellContents#getModeValue()
*/
public void setMode(ModeEnum modeValue)
{
Object old = this.modeValue;
this.modeValue = modeValue;
getEventSupport().firePropertyChange(JRBaseStyle.PROPERTY_MODE, old, this.modeValue);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:JRDesignCellContents.java
示例14: getStyledTextAttributes
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
@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,代码行数:14,代码来源:JRStyledTextAttributeSelector.java
示例15: getModeValue
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
*
*/
public ModeEnum getModeValue(JRStyle style)
{
ModeEnum ownMode = style.getOwnModeValue();
if (ownMode != null)
{
return ownMode;
}
JRStyle baseStyle = getBaseStyle(style);
if (baseStyle != null)
{
return baseStyle.getModeValue();
}
return null;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:18,代码来源:StyleResolver.java
示例16: resolveMode
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
public ModeEnum resolveMode(JRStyleContainer styleContainer)
{
JRStyle style = styleContainer.getStyle();
if (style != null)
{
ModeEnum styleMode = style.getOwnModeValue();
if (styleMode != null)
{
JRConditionalStyle[] conditionalStyles = style.getConditionalStyles();
if (conditionalStyles != null)
{
for (JRConditionalStyle conditionalStyle : conditionalStyles)
{
ModeEnum conditionalMode = conditionalStyle.getOwnModeValue();
if (conditionalMode != null && conditionalMode != styleMode)
{
// a conditional style overrides the style mode
return null;
}
}
}
// we have a style
return styleMode;
}
// going to the parent
return resolveMode(style);
}
if (styleContainer.getStyleNameReference() != null)
{
// we can't resolve external style references here
return null;
}
// if no style set, default
return ModeEnum.TRANSPARENT;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:40,代码来源:StyleUtil.java
示例17: resolveElementMode
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
public ModeEnum resolveElementMode(JRElement element)
{
ModeEnum elementMode = element.getOwnModeValue();
if (elementMode != null)
{
return elementMode;
}
return resolveMode(element);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:11,代码来源:StyleUtil.java
示例18: exportFrame
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
@Override
protected void exportFrame(JRPrintFrame frame, JRExporterGridCell gridCell, int x, int y)
{
FillPatternType mode = backgroundMode;
short backcolor = whiteIndex;
if (frame.getModeValue() == ModeEnum.OPAQUE)
{
mode = FillPatternType.SOLID_FOREGROUND;
backcolor = getWorkbookColor(frame.getBackcolor()).getIndex();
}
short forecolor = getWorkbookColor(frame.getForecolor()).getIndex();
HSSFCellStyle cellStyle =
getLoadedCellStyle(
mode,
backcolor,
HorizontalAlignment.LEFT,
VerticalAlignment.TOP,
(short)0,
getLoadedFont(getDefaultFont(), forecolor, null, getLocale()),
gridCell,
isWrapText(frame),
isCellLocked(frame),
isCellHidden(frame),
isShrinkToFit(frame)
);
createMergeRegion(gridCell, x, y, cellStyle);
cell = row.createCell(x);
cell.setCellStyle(cellStyle);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:34,代码来源:JRXlsExporter.java
示例19: FrameStyle
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
*
*/
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,代码行数:18,代码来源:FrameStyle.java
示例20: CellStyle
import net.sf.jasperreports.engine.type.ModeEnum; //导入依赖的package包/类
/**
*
*/
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,代码行数:41,代码来源:CellStyle.java
注:本文中的net.sf.jasperreports.engine.type.ModeEnum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论