Java 类net.sf.jasperreports.engine.type.ScaleImageEnum 实例源码

项目:jasperreports    文件:ChartConverter.java   
@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;
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
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;
}
项目:jasperreports    文件:JRFillImage.java   
@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;
}
项目:jasperreports    文件:BarcodeFillComponent.java   
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;
}
项目:jasperreports    文件:BarbecueFillComponent.java   
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;
}
项目:PDFReporter-Studio    文件:ChartConverter.java   
/**
 *
 */
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;
}
项目:PDFReporter-Studio    文件:MapDesignConverter.java   
/**
 *
 */
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;
}
项目:dynamicreports-jasper    文件:Image1Test.java   
@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());
    }
}
项目:jasperreports    文件:FlyingSaucerHtmlPrintElement.java   
@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;
}
项目:jasperreports    文件:DefaultHtmlPrintElement.java   
@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;
}
项目:jasperreports    文件:HtmlComponentDigester.java   
@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());
}
项目:jasperreports    文件:HtmlComponent.java   
/**
 * @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);
}
项目:jasperreports    文件:JRBaseStyle.java   
@Override
public void setScaleImage(ScaleImageEnum scaleImageValue)
{
    Object old = this.scaleImageValue;
    this.scaleImageValue = scaleImageValue;
    getEventSupport().firePropertyChange(PROPERTY_SCALE_IMAGE, old, this.scaleImageValue);
}
项目:jasperreports    文件:JRBaseImage.java   
@Override
public void setScaleImage(ScaleImageEnum scaleImageValue)
{
    Object old = this.scaleImageValue;
    this.scaleImageValue = scaleImageValue;
    getEventSupport().firePropertyChange(JRBaseStyle.PROPERTY_SCALE_IMAGE, old, this.scaleImageValue);
}
项目:jasperreports    文件:JRBaseImage.java   
@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;
    }
}
项目:jasperreports    文件:ElementIconConverter.java   
@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;
}
项目:jasperreports    文件:StyleResolver.java   
/**
 *
 */
public ScaleImageEnum getScaleImageValue(JRStyle style)
{
    ScaleImageEnum ownScaleImage = style.getOwnScaleImageValue();
    if (ownScaleImage != null)
    {
        return ownScaleImage;
    }
    JRStyle baseStyle = getBaseStyle(style);
    if (baseStyle != null )
    {
        return baseStyle.getScaleImageValue();
    }
    return null;
}
项目:jasperreports    文件:JRDesignImage.java   
@Override
public void setScaleImage(ScaleImageEnum scaleImageValue)
{
    Object old = this.scaleImageValue;
    this.scaleImageValue = scaleImageValue;
    getEventSupport().firePropertyChange(JRBaseStyle.PROPERTY_SCALE_IMAGE, old, this.scaleImageValue);
}
项目:jasperreports    文件:JRDesignImage.java   
@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;
    }
}
项目:jasperreports    文件:JRTemplateImage.java   
@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;
    }
}
项目:jasperreports    文件:BarcodeDesignConverter.java   
@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;
}
项目:PDFReporter-Studio    文件:MHtml.java   
@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);
}
项目:PDFReporter-Studio    文件:ImageConverter.java   
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;
}
项目:PDFReporter-Studio    文件:MapDesignConverter.java   
private Renderable getRenderableNoImage(JasperReportsContext jasperReportsContext, MapComponent map,
        JRPrintImage printImage) {
    try {
        printImage.setScaleImage(ScaleImageEnum.CLIP);
        if (noImage == null)
            noImage = RenderableUtil.getInstance(jasperReportsContext).getRenderable(JRImageLoader.NO_IMAGE_RESOURCE,
                    map.getOnErrorType(), false);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return noImage;
}
项目:PDFReporter-Studio    文件:LazyImageConverter.java   
/**
 * Return the standard printable element when the image is not found
 * 
 * @param jasperReportsContext the context
 * @param imageElement the actual element
 * @param printImage the print image
 * @return return the not printable element
 */
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) {
        e.printStackTrace();
    }
    return noImage;
}
项目:ireport-fork    文件:ScaleTypeProperty.java   
@SuppressWarnings("unchecked")
public ScaleTypeProperty(HtmlComponent component)
{
    super(ScaleImageEnum.class,  component);
    this.component = component;

}
项目:ireport-fork    文件:ScaleTypeProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(null, "<Default>"));
    tags.add(new Tag(ScaleImageEnum.CLIP, I18n.getString("Global.Property.HtmlScaleType.Clip")));
    tags.add(new Tag(ScaleImageEnum.FILL_FRAME, I18n.getString("Global.Property.HtmlScaleType.Fill_Frame")));
    tags.add(new Tag(ScaleImageEnum.RETAIN_SHAPE, I18n.getString("Global.Property.HtmlScaleType.Retain_Shape")));
    tags.add(new Tag(ScaleImageEnum.REAL_HEIGHT, I18n.getString("Global.Property.HtmlScaleType.Real_Height")));
    tags.add(new Tag(ScaleImageEnum.REAL_SIZE, I18n.getString("Global.Property.HtmlScaleType.Real_Size")));
    return tags;
}
项目:ireport-fork    文件:ScaleImageProperty.java   
@Override
@SuppressWarnings(value = "unchecked")
public PropertyEditor getPropertyEditor() {
    if (editor == null) {
        ArrayList l = new ArrayList();
        l.add(new Tag(null, "<Default>"));
        l.add(new Tag(ScaleImageEnum.CLIP, I18n.getString("AbstractStyleNode.Property.Clip")));
        l.add(new Tag(ScaleImageEnum.FILL_FRAME, I18n.getString("AbstractStyleNode.Property.Fill_Frame")));
        l.add(new Tag(ScaleImageEnum.RETAIN_SHAPE, I18n.getString("AbstractStyleNode.Property.Retain_Shape")));
        editor = new ComboBoxPropertyEditor(false, l);
    }
    return editor;
}
项目:ireport-fork    文件:ScaleImageProperty.java   
public void setValue(Object val) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
    if (val == null || val instanceof ScaleImageEnum) {
        ScaleImageEnum oldValue = style.getOwnScaleImageValue() == null ? null : style.getOwnScaleImageValue();
        ScaleImageEnum newValue = (ScaleImageEnum) val;
        style.setScaleImage(newValue);
        ObjectPropertyUndoableEdit urob = new ObjectPropertyUndoableEdit(style, "ScaleImage", ScaleImageEnum.class, oldValue, newValue);
        IReportManager.getInstance().addUndoableEdit(urob);
    }
}
项目:ireport-fork    文件:ScaleImageProperty.java   
@Override
public List getTagList() 
{
    List tags = new java.util.ArrayList();
    tags.add(new Tag(ScaleImageEnum.CLIP, I18n.getString("Global.Property.Clip")));
    tags.add(new Tag(ScaleImageEnum.FILL_FRAME, I18n.getString("Global.Property.FillFrame")));
    tags.add(new Tag(ScaleImageEnum.RETAIN_SHAPE, I18n.getString("Global.Property.RetainShape")));
    tags.add(new Tag(ScaleImageEnum.REAL_SIZE, I18n.getString("Global.Property.RealSize")));
    tags.add(new Tag(ScaleImageEnum.REAL_HEIGHT, I18n.getString("Global.Property.RealHeight")));
    return tags;
}
项目:com.opendoorlogistics    文件:ReportBuilderUtils.java   
private static JRDesignImage createImageField(ODLTableDefinition table, int i) {
    JRDesignImage image = new JRDesignImage(null);
    setImageBorder(image);
    image.setScaleImage(ScaleImageEnum.RETAIN_SHAPE);
    String fld = "$F{" + table.getColumnName(i) + "}";
    JRDesignExpression expression = new JRDesignExpression();
    expression.setText(fld);
    image.setExpression(expression);
    image.setPrintWhenDetailOverflows(false);
    return image;
}
项目:jasperreports-wms-component    文件:WmsMapElementImageProvider.java   
public static JRPrintImage getImage(
    JasperReportsContext jasperReportsContext, JRGenericPrintElement element)
    throws JRException, IOException {

  JRBasePrintImage printImage = new JRBasePrintImage(
      element.getDefaultStyleProvider());

  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);
  printImage.setScaleImage(ScaleImageEnum.CLIP);
  printImage.setHorizontalAlignment(HorizontalAlignEnum.LEFT);
  printImage.setVerticalAlignment(VerticalAlignEnum.TOP);

  Renderable cacheRenderer = (Renderable) element
      .getParameterValue(WmsMapPrintElement.PARAMETER_CACHE_RENDERER);

  if (cacheRenderer == null) {
    cacheRenderer = getImageRenderable(jasperReportsContext, element);
    element.setParameterValue(WmsMapPrintElement.PARAMETER_CACHE_RENDERER,
        cacheRenderer);
  }

  printImage.setRenderable(cacheRenderer);

  return printImage;
}
项目:jasperreports    文件:HtmlComponent.java   
/**
 * @return the scaleType
 */
public ScaleImageEnum getScaleType() {
    return scaleType;
}
项目:jasperreports    文件:JRBaseStyle.java   
@Override
public ScaleImageEnum getScaleImageValue()
{
    return getStyleResolver().getScaleImageValue(this);
}
项目:jasperreports    文件:JRBaseStyle.java   
@Override
public ScaleImageEnum getOwnScaleImageValue()
{
    return this.scaleImageValue;
}
项目:jasperreports    文件:JRBaseStyle.java   
@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);
        horizontalAlignmentValue = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getByValue(horizontalAlignment);
        verticalAlignmentValue = net.sf.jasperreports.engine.type.VerticalAlignEnum.getByValue(verticalAlignment);
        rotationValue = RotationEnum.getByValue(rotation);
        lineSpacingValue = LineSpacingEnum.getByValue(lineSpacing);
        scaleImageValue = ScaleImageEnum.getByValue(scaleImage);
        fillValue = FillEnum.getByValue(fill);

        mode = null;
        horizontalAlignment = null;
        verticalAlignment = null;
        rotation = null;
        lineSpacing = null;
        scaleImage = null;
        fill = null;
    }

    if (isStyledText != null)
    {
        markup = isStyledText.booleanValue() ? JRCommonText.MARKUP_STYLED_TEXT : JRCommonText.MARKUP_NONE;
        isStyledText = null;
    }

    if (paragraph == null)
    {
        paragraph = new JRBaseParagraph(this);
        paragraph.setLineSpacing(lineSpacingValue);
        lineSpacingValue = null;
    }

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_5_5_2)
    {
        fontsize = fontSize == null ? null : fontSize.floatValue();

        fontSize = null;
    }

    if (PSEUDO_SERIAL_VERSION_UID < JRConstants.PSEUDO_SERIAL_VERSION_UID_6_0_2)
    {
        horizontalTextAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalTextAlignEnum(horizontalAlignmentValue);
        verticalTextAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalTextAlignEnum(verticalAlignmentValue);

        horizontalImageAlign = net.sf.jasperreports.engine.type.HorizontalAlignEnum.getHorizontalImageAlignEnum(horizontalAlignmentValue);
        verticalImageAlign = net.sf.jasperreports.engine.type.VerticalAlignEnum.getVerticalImageAlignEnum(verticalAlignmentValue);

        horizontalAlignmentValue = null;
        verticalAlignmentValue = null;
    }
}
项目:jasperreports    文件:JRBasePrintImage.java   
@Override
public ScaleImageEnum getScaleImageValue()
{
    return getStyleResolver().getScaleImageValue(this);
}
项目:jasperreports    文件:JRBasePrintImage.java   
@Override
public ScaleImageEnum getOwnScaleImageValue()
{
    return this.scaleImageValue;
}
项目:jasperreports    文件:JRBasePrintImage.java   
@Override
public void setScaleImage(ScaleImageEnum scaleImageValue)
{
    this.scaleImageValue = scaleImageValue;
}
项目:jasperreports    文件:JRBasePrintImage.java   
@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 (renderer != null && renderable == null)
    {
        if (renderer instanceof Renderable)
        {
            renderable = (Renderable)renderer;
        }
        else
        {
            renderable = net.sf.jasperreports.engine.RenderableUtil.getWrappingRenderable(renderer);
        }
    }

    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;
    }
}