1*1a37d047SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1a37d047SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1a37d047SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1a37d047SAndrew Rist  * distributed with this work for additional information
6*1a37d047SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1a37d047SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1a37d047SAndrew Rist  * "License"); you may not use this file except in compliance
9*1a37d047SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*1a37d047SAndrew Rist  *
11*1a37d047SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*1a37d047SAndrew Rist  *
13*1a37d047SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1a37d047SAndrew Rist  * software distributed under the License is distributed on an
15*1a37d047SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1a37d047SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1a37d047SAndrew Rist  * specific language governing permissions and limitations
18*1a37d047SAndrew Rist  * under the License.
19*1a37d047SAndrew Rist  *
20*1a37d047SAndrew Rist  *************************************************************/
21*1a37d047SAndrew Rist 
22*1a37d047SAndrew Rist 
23cdf0e10cSrcweir package com.sun.star.report.pentaho.model;
24cdf0e10cSrcweir 
25cdf0e10cSrcweir import com.sun.star.report.OfficeToken;
26cdf0e10cSrcweir import com.sun.star.report.pentaho.OfficeNamespaces;
27cdf0e10cSrcweir 
28cdf0e10cSrcweir import org.jfree.report.expressions.FormulaExpression;
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /**
31cdf0e10cSrcweir  * Todo: Document me!
32cdf0e10cSrcweir  *
33cdf0e10cSrcweir  * @author Thomas Morgner
34cdf0e10cSrcweir  * @since 02.03.2007
35cdf0e10cSrcweir  */
36cdf0e10cSrcweir public class ImageElement extends ReportElement
37cdf0e10cSrcweir {
38cdf0e10cSrcweir 
39cdf0e10cSrcweir     private FormulaExpression formula;
40cdf0e10cSrcweir 
ImageElement()41cdf0e10cSrcweir     public ImageElement()
42cdf0e10cSrcweir     {
43cdf0e10cSrcweir     }
44cdf0e10cSrcweir 
getFormula()45cdf0e10cSrcweir     public FormulaExpression getFormula()
46cdf0e10cSrcweir     {
47cdf0e10cSrcweir         return formula;
48cdf0e10cSrcweir     }
49cdf0e10cSrcweir 
setFormula(final FormulaExpression formula)50cdf0e10cSrcweir     public void setFormula(final FormulaExpression formula)
51cdf0e10cSrcweir     {
52cdf0e10cSrcweir         this.formula = formula;
53cdf0e10cSrcweir     }
54cdf0e10cSrcweir 
getScaleMode()55cdf0e10cSrcweir     public String getScaleMode()
56cdf0e10cSrcweir     {
57cdf0e10cSrcweir         String val = (String) getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE);
58cdf0e10cSrcweir         if (OfficeToken.TRUE.equals(val))
59cdf0e10cSrcweir         {
60cdf0e10cSrcweir             val = OfficeToken.ANISOTROPIC;
61cdf0e10cSrcweir         }
62cdf0e10cSrcweir         else if (OfficeToken.FALSE.equals(val) || val == null)
63cdf0e10cSrcweir         {
64cdf0e10cSrcweir             val = OfficeToken.NONE;
65cdf0e10cSrcweir         }
66cdf0e10cSrcweir         return val;
67cdf0e10cSrcweir     }
68cdf0e10cSrcweir 
isPreserveIRI()69cdf0e10cSrcweir     public boolean isPreserveIRI()
70cdf0e10cSrcweir     {
71cdf0e10cSrcweir         return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI));
72cdf0e10cSrcweir     }
73cdf0e10cSrcweir 
setPreserveIRI(final boolean preserveIRI)74cdf0e10cSrcweir     public void setPreserveIRI(final boolean preserveIRI)
75cdf0e10cSrcweir     {
76cdf0e10cSrcweir         setAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIRI));
77cdf0e10cSrcweir     }
78cdf0e10cSrcweir 
getImageData()79cdf0e10cSrcweir     public String getImageData()
80cdf0e10cSrcweir     {
81cdf0e10cSrcweir         return (String) getAttribute(OfficeNamespaces.FORM_NS, OfficeToken.IMAGE_DATA);
82cdf0e10cSrcweir     }
83cdf0e10cSrcweir }
84