本文整理汇总了Java中net.sf.jasperreports.engine.type.ScaleImageEnum类的典型用法代码示例。如果您正苦于以下问题:Java ScaleImageEnum类的具体用法?Java ScaleImageEnum怎么用?Java ScaleImageEnum使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScaleImageEnum类属于net.sf.jasperreports.engine.type包,在下文中一共展示了ScaleImageEnum类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: convert
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public JRPrintElement convert(ReportConverter reportConverter, JRElement element)
{
JRBasePrintImage printImage = new JRBasePrintImage(reportConverter.getDefaultStyleProvider());
JRChart chart = (JRChart)element;
copyElement(reportConverter, chart, printImage);
printImage.copyBox(chart.getLineBox());
printImage.setAnchorName(JRExpressionUtil.getExpressionText(chart.getAnchorNameExpression()));
printImage.setBookmarkLevel(chart.getBookmarkLevel());
printImage.setLinkType(chart.getLinkType());
printImage.setOnErrorType(OnErrorTypeEnum.ICON);
printImage.setRenderer(getRenderer(reportConverter, chart));
printImage.setScaleImage(ScaleImageEnum.CLIP);
return printImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:ChartConverter.java
示例2: getScaleImageValue
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
/**
*
*/
public ScaleImageEnum getScaleImageValue(JRCommonImage image)
{
ScaleImageEnum ownScaleImage = image.getOwnScaleImageValue();
if (ownScaleImage != null)
{
return ownScaleImage;
}
JRStyle baseStyle = getBaseStyle(image);
if (baseStyle != null)
{
ScaleImageEnum scaleImage = baseStyle.getScaleImageValue();
if (scaleImage != null)
{
return scaleImage;
}
}
return ScaleImageEnum.RETAIN_SHAPE;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:22,代码来源:StyleResolver.java
示例3: createElementTemplate
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
protected JRTemplateElement createElementTemplate()
{
JRTemplateImage template =
new JRTemplateImage(
getElementOrigin(),
filler.getJasperPrint().getDefaultStyleProvider(),
this
);
if (getScaleImageValue() == ScaleImageEnum.REAL_HEIGHT
|| getScaleImageValue() == ScaleImageEnum.REAL_SIZE)
{
template.setScaleImage(ScaleImageEnum.RETAIN_SHAPE);
}
return template;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:JRFillImage.java
示例4: getTemplateImage
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
protected JRTemplateImage getTemplateImage()
{
JRStyle elementStyle = fillContext.getElementStyle();
JRTemplateImage templateImage = printTemplates.get(elementStyle);
if (templateImage == null)
{
templateImage = new JRTemplateImage(
fillContext.getElementOrigin(),
fillContext.getDefaultStyleProvider());
templateImage.setElement(fillContext.getComponentElement());
templateImage.setStyle(elementStyle);//already set by setElement, but keeping for safety
templateImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE);
templateImage.setUsingCache(false);
templateImage = deduplicate(templateImage);
printTemplates.put(elementStyle, templateImage);
}
return templateImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:BarcodeFillComponent.java
示例5: getTemplateImage
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
protected JRTemplateImage getTemplateImage()
{
JRStyle elementStyle = fillContext.getElementStyle();
JRTemplateImage templateImage = printTemplates.get(elementStyle);
if (templateImage == null)
{
templateImage = new JRTemplateImage(
fillContext.getElementOrigin(),
fillContext.getDefaultStyleProvider());
templateImage.setStyle(elementStyle);
templateImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE);
templateImage.setUsingCache(false);
templateImage = deduplicate(templateImage);
printTemplates.put(elementStyle, templateImage);
}
return templateImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:BarbecueFillComponent.java
示例6: convert
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
/**
*
*/
public JRPrintElement convert(ReportConverter reportConverter, JRElement element) {
JRBasePrintImage printImage = new JRBasePrintImage(reportConverter.getDefaultStyleProvider());
JRChart chart = (JRChart) element;
copyElement(reportConverter, chart, printImage);
printImage.copyBox(chart.getLineBox());
printImage.setAnchorName(JRExpressionUtil.getExpressionText(chart.getAnchorNameExpression()));
printImage.setBookmarkLevel(chart.getBookmarkLevel());
printImage.setLinkType(chart.getLinkType());
printImage.setOnErrorType(OnErrorTypeEnum.ICON);
printImage.setRenderable(getRenderer(reportConverter, chart));
printImage.setScaleImage(ScaleImageEnum.CLIP);
return printImage;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:ChartConverter.java
示例7: convert
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
/**
*
*/
public JRPrintElement convert(final ReportConverter reportConverter, final JRComponentElement element) {
MapComponent map = (MapComponent) element.getComponent();
JRBasePrintImage printImage = new JRBasePrintImage(element.getDefaultStyleProvider());
Renderable cacheRenderer = getRenderable(reportConverter, element, map, printImage);
printImage.setUUID(element.getUUID());
printImage.setX(element.getX());
printImage.setY(element.getY());
printImage.setWidth(element.getWidth());
printImage.setHeight(element.getHeight());
printImage.setStyle(element.getStyle());
printImage.setMode(element.getModeValue());
printImage.setBackcolor(element.getBackcolor());
printImage.setForecolor(element.getForecolor());
printImage.setLazy(false);
// FIXMEMAP there are no scale image, alignment and onError attributes
// defined for the map element
printImage.setScaleImage(ScaleImageEnum.CLIP);
printImage.setHorizontalAlignment(HorizontalAlignEnum.LEFT);
printImage.setVerticalAlignment(VerticalAlignEnum.TOP);
printImage.setRenderable(cacheRenderer);
return printImage;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:MapDesignConverter.java
示例8: test
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public void test() {
super.test();
numberOfPagesTest(1);
try {
byte[] imageData = JRImageLoader.getInstance(DefaultJasperReportsContext.getInstance()).loadBytesFromAwtImage(image, ImageTypeEnum.JPEG);
JRPrintImage jrImage = (JRPrintImage) getElementAt("title.image1", 0);
Assert.assertTrue("image data", Arrays.equals(imageData, jrImage.getRenderable().getImageData(DefaultJasperReportsContext.getInstance())));
Assert.assertEquals("scale image", ScaleImageEnum.CLIP, jrImage.getScaleImageValue());
} catch (JRException e) {
e.printStackTrace();
Assert.fail(e.getMessage());
}
}
开发者ID:svn2github,项目名称:dynamicreports-jasper,代码行数:17,代码来源:Image1Test.java
示例9: createImageFromElement
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public JRPrintImage createImageFromElement(JRGenericPrintElement element) throws JRException {
String htmlContent = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_HTML_CONTENT);
String scaleType = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_SCALE_TYPE);
String horizontalAlignment = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_HORIZONTAL_ALIGN);
String verticalAlignment = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_VERTICAL_ALIGN);
Boolean hasOverflowed = (Boolean) element.getParameterValue(HtmlPrintElement.BUILTIN_PARAMETER_HAS_OVERFLOWED);
Boolean clipOnOverflow = (Boolean) element.getParameterValue(HtmlPrintElement.PARAMETER_CLIP_ON_OVERFLOW);
JRBasePrintImage printImage = new JRBasePrintImage(element.getDefaultStyleProvider());
printImage.setStyle(element.getStyle());
printImage.setMode(element.getModeValue());
printImage.setBackcolor(element.getBackcolor());
printImage.setForecolor(element.getForecolor());
printImage.setX(element.getX());
printImage.setY(element.getY());
printImage.setWidth(element.getWidth());
printImage.setScaleImage(ScaleImageEnum.getByName(scaleType));
printImage.setHorizontalImageAlign(HorizontalImageAlignEnum.getByName(horizontalAlignment));
printImage.setVerticalImageAlign(VerticalImageAlignEnum.getByName(verticalAlignment));
FlyingSaucerXhtmlToImageRenderer renderer = new FlyingSaucerXhtmlToImageRenderer(getHtmlDocument(htmlContent), element.getWidth(), element.getHeight());
if (printImage.getScaleImageValue() == ScaleImageEnum.REAL_HEIGHT || printImage.getScaleImageValue() == ScaleImageEnum.REAL_SIZE) {
boolean canClip = hasOverflowed != null ? hasOverflowed : false;
if (canClip) {
printImage.setHeight(element.getHeight());
if (clipOnOverflow) {
printImage.setScaleImage(ScaleImageEnum.CLIP);
}
} else {
printImage.setHeight(renderer.getComputedSize().height);
}
} else {
printImage.setHeight(element.getHeight());
}
printImage.setRenderer(renderer);
return printImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:41,代码来源:FlyingSaucerHtmlPrintElement.java
示例10: createImageFromElement
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public JRPrintImage createImageFromElement(JRGenericPrintElement element) {
String htmlContent = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_HTML_CONTENT);
String scaleType = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_SCALE_TYPE);
String horizontalAlignment = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_HORIZONTAL_ALIGN);
String verticalAlignment = (String) element.getParameterValue(HtmlPrintElement.PARAMETER_VERTICAL_ALIGN);
JEditorPane editorPane = new JEditorPane();
editorPane.setEditorKitForContentType("text/html", new SynchronousImageLoaderKit());
editorPane.setContentType("text/html");
editorPane.setText(htmlContent);
editorPane.setBorder(null);
editorPane.setSize(editorPane.getPreferredSize());
JRBasePrintImage printImage = new JRBasePrintImage(element.getDefaultStyleProvider());
printImage.setX(element.getX());
printImage.setY(element.getY());
printImage.setWidth(element.getWidth());
printImage.setHeight(element.getHeight());
printImage.setScaleImage(ScaleImageEnum.getByName(scaleType));
printImage.setHorizontalImageAlign(HorizontalImageAlignEnum.getByName(horizontalAlignment));
printImage.setVerticalImageAlign(VerticalImageAlignEnum.getByName(verticalAlignment));
printImage.setStyle(element.getStyle());
printImage.setMode(element.getModeValue());
printImage.setBackcolor(element.getBackcolor());
printImage.setForecolor(element.getForecolor());
printImage.setRenderer(new AwtComponentRendererImpl(editorPane));
return printImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:32,代码来源:DefaultHtmlPrintElement.java
示例11: setHtmlComponentRules
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@SuppressWarnings("deprecation")
protected void setHtmlComponentRules(Digester digester)
{
String htmlComponentPattern = "*/componentElement/html";
digester.addObjectCreate(htmlComponentPattern, HtmlComponent.class.getName());
digester.addSetProperties(htmlComponentPattern, new String[] {
HtmlComponent.PROPERTY_SCALE_TYPE,
HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
HtmlComponent.PROPERTY_VERTICAL_ALIGN,
HtmlComponent.PROPERTY_EVALUATION_TIME },
new String[0]);
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_SCALE_TYPE,
ScaleImageEnum.values()));
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_HORIZONTAL_ALIGN,
"horizontalImageAlign",
HorizontalImageAlignEnum.values()));
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_VERTICAL_ALIGN,
"verticalImageAlign",
VerticalImageAlignEnum.values()));
digester.addRule(htmlComponentPattern,
new XmlConstantPropertyRule(
HtmlComponent.PROPERTY_EVALUATION_TIME,
EvaluationTimeEnum.values()));
String htmlContentPattern = htmlComponentPattern + "/htmlContentExpression";
digester.addFactoryCreate(htmlContentPattern, JRExpressionFactory.StringExpressionFactory.class.getName());
digester.addCallMethod(htmlContentPattern, "setText", 0);
digester.addSetNext(htmlContentPattern, "setHtmlContentExpression", JRExpression.class.getName());
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:38,代码来源:HtmlComponentDigester.java
示例12: setScaleType
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
/**
* @param scaleType the scaleType to set
*/
public void setScaleType(ScaleImageEnum scaleType) {
Object old = this.scaleType;
this.scaleType = scaleType;
getEventSupport().firePropertyChange(PROPERTY_SCALE_TYPE,
old, this.scaleType);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:10,代码来源:HtmlComponent.java
示例13: setScaleImage
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public void setScaleImage(ScaleImageEnum scaleImageValue)
{
Object old = this.scaleImageValue;
this.scaleImageValue = scaleImageValue;
getEventSupport().firePropertyChange(PROPERTY_SCALE_IMAGE, old, this.scaleImageValue);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRBaseStyle.java
示例14: setScaleImage
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public void setScaleImage(ScaleImageEnum scaleImageValue)
{
Object old = this.scaleImageValue;
this.scaleImageValue = scaleImageValue;
getEventSupport().firePropertyChange(JRBaseStyle.PROPERTY_SCALE_IMAGE, old, this.scaleImageValue);
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:8,代码来源:JRBaseImage.java
示例15: readObject
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的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)
{
horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment);
verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment);
scaleImageValue = ScaleImageEnum.getByValue(scaleImage);
onErrorTypeValue = OnErrorTypeEnum.getByValue(onErrorType);
evaluationTimeValue = EvaluationTimeEnum.getByValue(evaluationTime);
horizontalAlignment = null;
verticalAlignment = null;
scaleImage = null;
}
if (linkType == null)
{
linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType));
}
if (linkTarget == null)
{
linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget));
}
if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2)
{
horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue);
verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue);
horizontalAlignmentValue = null;
verticalAlignmentValue = null;
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:38,代码来源:JRBaseImage.java
示例16: convert
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public JRPrintElement convert(ReportConverter reportConverter, JRElement element)
{
JRBasePrintImage printImage = new JRBasePrintImage(
reportConverter.getDefaultStyleProvider());
copyElement(reportConverter, element, printImage);
printImage.getLineBox().setPadding(3);
printImage.setScaleImage(ScaleImageEnum.CLIP);
printImage.setRenderer(ResourceRenderer.getInstance(iconLocation, false));
return printImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:ElementIconConverter.java
示例17: readObject
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的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)
{
horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment);
verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment);
scaleImageValue = ScaleImageEnum.getByValue(scaleImage);
onErrorTypeValue = OnErrorTypeEnum.getByValue(onErrorType);
horizontalAlignment = null;
verticalAlignment = null;
scaleImage = null;
}
if (linkType == null)
{
linkType = JRHyperlinkHelper.getLinkType(HyperlinkTypeEnum.getByValue(hyperlinkType));
}
if (linkTarget == null)
{
linkTarget = JRHyperlinkHelper.getLinkTarget(HyperlinkTargetEnum.getByValue(hyperlinkTarget));
}
if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2)
{
horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue);
verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue);
horizontalAlignmentValue = null;
verticalAlignmentValue = null;
}
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:37,代码来源:JRTemplateImage.java
示例18: convert
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public JRPrintElement convert(ReportConverter reportConverter,
JRComponentElement element)
{
JRBasePrintImage printImage = new JRBasePrintImage(
reportConverter.getDefaultStyleProvider());
reportConverter.copyBaseAttributes(element, printImage);
printImage.setScaleImage(ScaleImageEnum.RETAIN_SHAPE);
Renderable barcodeImage = evaluateBarcode(reportConverter, element);
printImage.setRenderer(barcodeImage);
return printImage;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:15,代码来源:BarcodeDesignConverter.java
示例19: setPropertyValue
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
JRDesignComponentElement jrElement = (JRDesignComponentElement) getValue();
HtmlComponent htmlComp = (HtmlComponent) jrElement.getComponent();
if (id.equals(HtmlComponent.PROPERTY_EVALUATION_TIME))
htmlComp.setEvaluationTime((EvaluationTimeEnum) evaluationTimeD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_EVALUATION_GROUP))
htmlComp.setEvaluationGroup((String) value);
else if (id.equals(HtmlComponent.PROPERTY_SCALE_TYPE))
htmlComp.setScaleType((ScaleImageEnum) scaleTypeD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_HORIZONTAL_ALIGN))
htmlComp.setHorizontalAlign((HorizontalAlignEnum) hAlignD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_VERTICAL_ALIGN))
htmlComp.setVerticalAlign((VerticalAlignEnum) vAlignD
.getEnumValue(value));
else if (id.equals(HtmlComponent.PROPERTY_HTMLCONTENT_EXPRESSION))
htmlComp.setHtmlContentExpression(ExprUtil.setValues(
htmlComp.getHtmlContentExpression(), value));
else if (id.equals(HtmlComponent.PROPERTY_CLIP_ON_OVERFLOW))
htmlComp.setClipOnOverflow((Boolean) value);
else
super.setPropertyValue(id, value);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:28,代码来源:MHtml.java
示例20: getRenderableNoImage
import net.sf.jasperreports.engine.type.ScaleImageEnum; //导入依赖的package包/类
private Renderable getRenderableNoImage(JasperReportsContext jasperReportsContext, JRImage imageElement,
JRPrintImage printImage) {
try {
printImage.setScaleImage(ScaleImageEnum.CLIP);
if (noImage == null)
noImage = RenderableUtil.getInstance(jasperReportsContext).getRenderable(JRImageLoader.NO_IMAGE_RESOURCE,
imageElement.getOnErrorTypeValue(), false);
} catch (Exception e) {
if (log.isDebugEnabled())
log.debug("Creating icon renderer for converted image failed.", e);
}
return noImage;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:ImageConverter.java
注:本文中的net.sf.jasperreports.engine.type.ScaleImageEnum类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论