Revision 5106

View differences:

org.gvsig.report/tags/org.gvsig.report-1.0.89/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/ResourcesRepositoryService.java
1
package org.gvsig.report.lib.impl;
2

  
3
import java.io.ByteArrayInputStream;
4
import java.io.IOException;
5
import java.io.InputStream;
6
import java.io.OutputStream;
7
import java.net.URL;
8
import net.sf.jasperreports.engine.JRRuntimeException;
9
import net.sf.jasperreports.engine.util.JRLoader;
10
import net.sf.jasperreports.repo.InputStreamResource;
11
import net.sf.jasperreports.repo.ObjectResource;
12
import net.sf.jasperreports.repo.Resource;
13
import net.sf.jasperreports.repo.StreamRepositoryService;
14
import org.gvsig.report.lib.impl.commands.GetImage;
15
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
16

  
17
/**
18
 *
19
 * @author jjdelcerro
20
 */
21
@SuppressWarnings("UseSpecificCatch")
22
public class ResourcesRepositoryService implements StreamRepositoryService {
23

  
24
    private final ResourcesStorage resources;
25
    private final GetImage fetchFromField;
26

  
27
    private class GVResourceToJRInputStreamResourceAdapter extends InputStreamResource {
28
        private final ResourcesStorage.Resource resource;
29
        
30
        public GVResourceToJRInputStreamResourceAdapter(ResourcesStorage.Resource resource) {
31
            this.resource = resource;
32
        }
33

  
34
        @Override
35
        public InputStream getValue() {
36
            try {
37
                return this.resource.asInputStream();
38
            } catch (IOException ex) {
39
                return null;
40
            }
41
        }
42
    }
43
    
44
    private class URLToJRInputStreamResourceAdapter extends InputStreamResource {
45
        private final URL url;
46
        
47
        public URLToJRInputStreamResourceAdapter(URL url) {
48
            this.url = url;
49
        }
50

  
51
        @Override
52
        public InputStream getValue() {
53
            try {
54
                return this.url.openStream();
55
            } catch (IOException ex) {
56
                return null;
57
            }
58
        }
59
    }
60

  
61
    private class ByteArrayToJRInputStreamResourceAdapter extends InputStreamResource {
62
        private final byte[] data;
63
        
64
        public ByteArrayToJRInputStreamResourceAdapter(byte[] data) {
65
            this.data = data;
66
        }
67

  
68
        @Override
69
        public InputStream getValue() {
70
          ByteArrayInputStream is = new ByteArrayInputStream(this.data);
71
          return is;
72
        }
73
    }
74

  
75
    
76
    public ResourcesRepositoryService(ResourcesStorage resources) {
77
        this.resources = resources;
78
        this.fetchFromField = new GetImage();
79
    }
80

  
81
    @Override
82
    public InputStream getInputStream(String uri) {
83
        try {
84
            InputStream is;
85
            ResourcesStorage.Resource resource = this.resources.getResource(uri);
86
            if (resource != null) {
87
                is = resource.asInputStream();
88
            } else {
89
                URL url = new URL(uri);
90
                if( this.fetchFromField.canUse(url) ) {
91
                  byte[] image = this.fetchFromField.fetch(url);
92
                  is = new ByteArrayInputStream(image);
93
                } else {
94
                  is = url.openStream();
95
                }
96
            }
97
            return is;
98
        } catch (Exception ex) {
99
            throw new JRRuntimeException(ex);
100
        }
101
    }
102

  
103
    @Override
104
    public OutputStream getOutputStream(String uri) {
105
        return null;
106
    }
107

  
108
    @Override
109
    public Resource getResource(String uri) {
110
        try {
111
            Resource r;
112
            ResourcesStorage.Resource resource = this.resources.getResource(uri);
113
            if (resource != null) {
114
                r = new GVResourceToJRInputStreamResourceAdapter(resource);
115
                return r;
116
            } else {
117
                URL url = new URL(uri);
118
                if( this.fetchFromField.canUse(url) ) {
119
                  byte[] image = this.fetchFromField.fetch(url);
120
                  r = new ByteArrayToJRInputStreamResourceAdapter(image);
121
                } else {
122
                  r = new URLToJRInputStreamResourceAdapter(url);
123
                }
124
            }
125
            return r;
126
        } catch (Exception ex) {
127
            throw new JRRuntimeException(ex);
128
        }
129
    }
130

  
131
    @Override
132
    public void saveResource(String uri, Resource resource) {
133
        
134
    }
135

  
136
    @Override
137
    public <K extends Resource> K getResource(String uri, Class<K> resourceType) {
138
        try {
139
            ObjectResource r = (ObjectResource) resourceType.newInstance();
140
            r.setName(uri);
141
            ResourcesStorage.Resource resource = this.resources.getResource(uri);
142
            if (resource != null) {
143
                InputStream is = resource.asInputStream();
144
                if (is!=null) {
145
                    Object v = JRLoader.loadObject(is);
146
                    r.setValue(v);
147
                    return (K) r;
148
                }
149
            }
150
            URL url = new URL(uri);
151
            if (this.fetchFromField.canUse(url)) {
152
                byte[] image = this.fetchFromField.fetch(url);
153
                ByteArrayInputStream is = new ByteArrayInputStream(image);
154
                r.setValue(is);
155
            } else {
156
                r.setValue(url.openStream());
157
            }
158
            
159
            return (K) r;
160
        } catch (Throwable th) {
161
            return null;
162
        }
163
    }
164
}
org.gvsig.report/tags/org.gvsig.report-1.0.89/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/DefaultReportServerConfig.java
1
package org.gvsig.report.lib.impl;
2

  
3
import java.beans.PropertyChangeEvent;
4
import java.beans.PropertyChangeListener;
5
import java.beans.PropertyChangeSupport;
6
import java.util.List;
7
import org.apache.commons.lang3.StringUtils;
8
import org.gvsig.fmap.dal.DALLocator;
9
import org.gvsig.fmap.dal.DataManager;
10
import org.gvsig.fmap.dal.DataStore;
11
import org.gvsig.fmap.dal.feature.FeatureStore;
12
import org.json.JSONArray;
13
import org.json.JSONObject;
14
import org.gvsig.report.lib.api.ReportDataSet;
15
import org.gvsig.report.lib.api.ReportDataSets;
16
import org.gvsig.report.lib.api.ReportManager;
17
import org.gvsig.report.lib.api.ReportServerConfig;
18
import org.gvsig.report.lib.api.ReportServices;
19
import org.gvsig.report.lib.api.ReportViewCapture;
20

  
21
/**
22
 *
23
 * @author jjdelcerro
24
 */
25
public class DefaultReportServerConfig implements ReportServerConfig {
26

  
27
    private int port;
28
    private int timeout;
29
    private String serverInfo;
30
    private ReportDataSets datasets;
31
    private boolean locked;
32
    private DefaultReportViewCaptures viewCaptures;
33
    private final PropertyChangeSupport propertyChangeSupport;
34
    private final ReportServices services;
35
    private final ReportManager manager;
36
    private boolean autostart;
37

  
38
    public DefaultReportServerConfig(ReportManager manager, ReportServices services) {
39
        this.services = services;
40
        this.manager = manager;
41

  
42
        this.port = 9876;
43
        this.timeout = 15000;
44
        this.serverInfo = "Test/1.1";
45
        this.locked = false;
46
        this.autostart = false;
47
        this.propertyChangeSupport = new PropertyChangeSupport(this);
48

  
49
        this.viewCaptures = new DefaultReportViewCaptures();
50
        this.viewCaptures.addPropertyChangeListener(new PropertyChangeListener() {
51
            @Override
52
            public void propertyChange(PropertyChangeEvent evt) {
53
                propertyChangeSupport.firePropertyChange("viewCaptures", null, null);
54
            }
55
        });
56
                
57
        this.datasets = new DefaultReportDataSets(manager, services);
58
        this.datasets.addPropertyChangeListener(new PropertyChangeListener() {
59
            @Override
60
            public void propertyChange(PropertyChangeEvent evt) {
61
                propertyChangeSupport.firePropertyChange("datasets", null, null);
62
            }
63
        });
64
    }
65

  
66
    @Override
67
    public ReportServices getServices() {
68
        return this.services;
69
    }
70

  
71
    public boolean isLocked() {
72
        return locked;
73
    }
74

  
75
    public void setLocked(boolean locked) {
76
        this.locked = locked;
77
    }
78

  
79
    @Override
80
    public int getPort() {
81
        return this.port;
82
    }
83

  
84
    @Override
85
    public ReportServerConfig setPort(int port) {
86
        int oldValue = this.port;
87
        this.port = port;
88
        this.propertyChangeSupport.firePropertyChange("port", oldValue, port);
89
        return this;
90
    }
91

  
92
    @Override
93
    public int getTimeout() {
94
        return this.timeout;
95
    }
96

  
97
    @Override
98
    public ReportServerConfig setTimeout(int timeout) {
99
        int oldValue = this.timeout;
100
        this.timeout = timeout;
101
        this.propertyChangeSupport.firePropertyChange("timeout", oldValue, timeout);
102
        return this;
103
    }
104

  
105
    @Override
106
    public String getServerInfo() {
107
        return this.serverInfo;
108
    }
109

  
110
    @Override
111
    public ReportServerConfig setServerInfo(String serverInfo) {
112
        String oldValue = this.serverInfo;
113
        this.serverInfo = serverInfo;
114
        this.propertyChangeSupport.firePropertyChange("serverInfo", oldValue, serverInfo);
115
        return this;
116
    }
117

  
118
    @Override
119
    public ReportDataSets getDatasets() {
120
        return this.datasets;
121
    }
122

  
123
    @Override
124
    public ReportDataSet getDataset(String name) {
125
        ReportDataSet dataset = this.datasets.get(name);
126
        if( dataset == null ) {
127
          DataManager dataManager = DALLocator.getDataManager();
128
          DataStore store = dataManager.getStoresRepository().getStore(name);
129
          if( store == null || !(store instanceof FeatureStore)) {
130
            return null;
131
          }
132
          dataset = new DefaultReportDataSet(services, name, (FeatureStore) store, null);
133
        }
134
        return dataset;
135
    }
136

  
137
    @Override
138
    public String toJSON() {
139
        JSONObject jsonconfig = new JSONObject();
140

  
141
        jsonconfig.put("port", this.port);
142
        jsonconfig.put("timeout", this.timeout);
143
        jsonconfig.put("serverInfo", this.serverInfo);
144
        jsonconfig.put("autostart", this.autostart);
145
        
146
        JSONArray jsondatasets = new JSONArray();
147
        jsonconfig.put("datasets", jsondatasets);
148
        for (ReportDataSet dataset : this.datasets) {
149
            jsondatasets.put(((DefaultReportDataSet) dataset).toJSON());
150
        }
151

  
152
        JSONArray jsonviewcaptures = new JSONArray();
153
        jsonconfig.put("viewcaptures", jsonviewcaptures);
154
        for (ReportViewCapture viewcapture : this.viewCaptures) {
155
            jsonviewcaptures.put(((DefaultReportViewCapture) viewcapture).toJSON());
156
        }
157
        return jsonconfig.toString();
158
    }
159

  
160
    public void fromJSON(JSONObject jsonConfig) {
161
        DefaultReportDataSets theDatasets = new DefaultReportDataSets(manager, services);
162
        DefaultReportViewCaptures theViewCaptures = new DefaultReportViewCaptures();
163
        
164
        if (jsonConfig.has("port")) {
165
            this.port = jsonConfig.getInt("port");
166
        }
167
        if (jsonConfig.has("timeout")) {
168
            this.timeout = jsonConfig.getInt("timeout");
169
        }
170
        if (jsonConfig.has("serverInfo")) {
171
            this.serverInfo = jsonConfig.getString("serverInfo");
172
        }
173
        if (jsonConfig.has("autostart")) {
174
            this.autostart = jsonConfig.getBoolean("autostart");
175
        }
176
        if (jsonConfig.has("datasets")) {
177
            JSONArray jsonDatasets = jsonConfig.getJSONArray("datasets");
178
            for (Object jsonDataset : jsonDatasets) {
179
                if( !(jsonDataset instanceof JSONObject) ) {
180
                    jsonDataset = new JSONObject(jsonDataset.toString());
181
                }
182
                ReportDataSet dataset = new DefaultReportDataSet(
183
                        this.getServices(),
184
                        (JSONObject) jsonDataset
185
                );
186
                theDatasets.add(dataset);
187
            }
188
        }
189
        theDatasets.addPropertyChangeListener(new PropertyChangeListener() {
190
            @Override
191
            public void propertyChange(PropertyChangeEvent evt) {
192
                propertyChangeSupport.firePropertyChange("datasets", null, null);
193
            }
194
        });
195
        this.datasets = theDatasets;
196

  
197
        if (jsonConfig.has("viewcaptures")) {
198
            JSONArray jsonViewCaptures = jsonConfig.getJSONArray("viewcaptures");
199
            for (Object jsonViewCapture : jsonViewCaptures) {
200
                if( !(jsonViewCapture instanceof JSONObject) ) {
201
                    jsonViewCapture = new JSONObject(jsonViewCapture.toString());
202
                }
203
                ReportViewCapture viewCapture = new DefaultReportViewCapture(
204
                        this,
205
                        (JSONObject) jsonViewCapture
206
                );
207
                theViewCaptures.add(viewCapture);
208
            }
209
        }
210
        theViewCaptures.addPropertyChangeListener(new PropertyChangeListener() {
211
            @Override
212
            public void propertyChange(PropertyChangeEvent evt) {
213
                propertyChangeSupport.firePropertyChange("viewcaptures", null, null);
214
            }
215
        });
216
        this.viewCaptures = theViewCaptures;
217
        
218
    }
219

  
220
    @Override
221
    public List<ReportViewCapture> getViewCaptures() {
222
        return this.viewCaptures;
223
    }
224

  
225
    @Override
226
    public ReportViewCapture getViewCapture(String name) {
227
        for (ReportViewCapture viewCapture : viewCaptures) {
228
            if( StringUtils.equalsIgnoreCase(name, viewCapture.getName()) ) {
229
                return viewCapture;
230
            }
231
        }
232
        return null;
233
    }
234
    
235
    @Override
236
    public void addPropertyChangeListener(PropertyChangeListener listener) {
237
        this.propertyChangeSupport.addPropertyChangeListener(listener);
238
    }
239

  
240
    @Override
241
    public void removePropertyChangeListener(PropertyChangeListener listener) {
242
        this.propertyChangeSupport.removePropertyChangeListener(listener);
243
    }
244

  
245
    @Override
246
    public boolean getAutostart() {
247
        return this.autostart;
248
    }
249

  
250
    @Override
251
    public void setAutostart(boolean autostart) {
252
        boolean oldValue = this.autostart;
253
        this.autostart = autostart;
254
        this.propertyChangeSupport.firePropertyChange("autostart", oldValue, this.autostart);
255
    }
256

  
257
}
org.gvsig.report/tags/org.gvsig.report-1.0.89/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/DefaultReportViewCapture.java
1
package org.gvsig.report.lib.impl;
2

  
3
import java.awt.Dimension;
4
import java.beans.PropertyChangeEvent;
5
import java.beans.PropertyChangeListener;
6
import java.beans.PropertyChangeSupport;
7
import java.io.UnsupportedEncodingException;
8
import java.net.URLEncoder;
9
import org.apache.commons.lang3.StringUtils;
10
import org.gvsig.expressionevaluator.Expression;
11
import org.gvsig.expressionevaluator.ExpressionUtils;
12
import org.gvsig.expressionevaluator.Formatter;
13
import org.gvsig.report.lib.api.ReportDataSet;
14
import org.gvsig.report.lib.api.ReportServerConfig;
15
import org.gvsig.report.lib.api.ReportViewCapture;
16
import org.json.JSONObject;
17

  
18
/**
19
 *
20
 * @author jjdelcerro
21
 */
22
public class DefaultReportViewCapture implements ReportViewCapture {
23

  
24
    private static int counter = 0;
25
    
26
    private class DefaultReportViewCaptureFilter implements ReportViewCaptureFilter {
27

  
28
        private Expression expression;
29
        private String datasetName;
30
        private final PropertyChangeSupport propertyChangeSupport;
31

  
32
        public DefaultReportViewCaptureFilter() {
33
            this.propertyChangeSupport = new PropertyChangeSupport(this);
34
        }
35

  
36
        public DefaultReportViewCaptureFilter(JSONObject json) {
37
            this();
38
            if( json.has("expression") ) {
39
                this.expression = ExpressionUtils.createExpressionFromJSON(
40
                        json.getString("expression")
41
                );
42
            }
43
            if( json.has("datasetName") ) {
44
                this.datasetName = json.getString("datasetName");
45
            }
46
        }
47

  
48
        public JSONObject toJSON() {
49
            JSONObject me = new JSONObject();
50

  
51
            if( this.expression!=null ) {
52
                me.put("expression", this.expression.toJSON());
53
            }
54
            me.put("datasetName", StringUtils.defaultIfEmpty(this.datasetName,null));
55

  
56
            return me;
57
        }
58

  
59
        public String getURLPart() {
60
            if( StringUtils.isBlank(reportDataSetName) ) {
61
                return null;
62
            }
63
            ReportDataSet dataset = config.getDataset(reportDataSetName);
64
            if( dataset == null ) {
65
                return null;
66
            }
67
            Formatter reportformatter = new ReportExpressionCodeFormatter(
68
                    dataset.getFeatureType()
69
            );
70
            String s = expression.getCode().toString(reportformatter);
71
            s = s.replace(" ","+");
72
            return s;
73
        }
74
        
75
        @Override
76
        public String getDataSet() {
77
            return this.datasetName;
78
        }
79

  
80
        @Override
81
        public Expression getExpression() {
82
            return this.expression;
83
        }
84

  
85
        @Override
86
        public void setDataSet(String dataset) {
87
            this.datasetName = dataset;
88
            this.propertyChangeSupport.firePropertyChange("dataset", null, null);
89
        }
90

  
91
        @Override
92
        public void setDataSet(ReportDataSet dataset) {
93
            if( dataset == null ) {
94
                this.datasetName = null;
95
            } else {
96
                this.datasetName = dataset.getName();
97
            }
98
            this.propertyChangeSupport.firePropertyChange("dataset", null, null);
99
        }
100

  
101
        @Override
102
        public void setExpression(Expression expression) {
103
            this.expression = expression;
104
            this.propertyChangeSupport.firePropertyChange("expression", null, null);
105
        }
106

  
107
        @Override
108
        public boolean isEmpty() {
109
            return StringUtils.isEmpty(this.datasetName) || 
110
                    ExpressionUtils.isPhraseEmpty(this.expression);
111
        }
112

  
113
        public void addPropertyChangeListener(PropertyChangeListener listener) {
114
            this.propertyChangeSupport.addPropertyChangeListener(listener);
115
        }
116

  
117
        public void removePropertyChangeListener(PropertyChangeListener listener) {
118
            this.propertyChangeSupport.removePropertyChangeListener(listener);
119
        }
120

  
121
    }
122

  
123
    private DefaultReportViewCaptureFilter zoomFilter;
124
    private DefaultReportViewCaptureFilter centerFilter;
125
    private DefaultReportViewCaptureFilter selectFilter;
126
    private String name;
127
    private String viewName;
128
    private String reportDataSetName;
129
    private int margins;
130
    private boolean clearSelection;
131
    private Dimension dimensions;
132
    private int resolution;
133
    private final PropertyChangeSupport propertyChangeSupport;
134
    private final ReportServerConfig config;
135

  
136
    public DefaultReportViewCapture(ReportServerConfig config) {
137
        this.config = config;
138
        this.centerFilter = new DefaultReportViewCaptureFilter();
139
        this.centerFilter.addPropertyChangeListener(new PropertyChangeListener() {
140
            @Override
141
            public void propertyChange(PropertyChangeEvent evt) {
142
                propertyChangeSupport.firePropertyChange("centerFilter", null, null);
143
            }
144
        });
145
        this.zoomFilter = new DefaultReportViewCaptureFilter();
146
        this.zoomFilter.addPropertyChangeListener(new PropertyChangeListener() {
147
            @Override
148
            public void propertyChange(PropertyChangeEvent evt) {
149
                propertyChangeSupport.firePropertyChange("zoomFilter", null, null);
150
            }
151
        });
152
        this.selectFilter = new DefaultReportViewCaptureFilter();
153
        this.selectFilter.addPropertyChangeListener(new PropertyChangeListener() {
154
            @Override
155
            public void propertyChange(PropertyChangeEvent evt) {
156
                propertyChangeSupport.firePropertyChange("selectFilter", null, null);
157
            }
158
        });
159
        this.resolution = 72;
160
        this.clearSelection = false;
161
        this.name = "capture"+counter++;
162
        this.viewName = null;
163
        this.margins = 0;
164
        this.dimensions = new Dimension();
165
        this.propertyChangeSupport = new PropertyChangeSupport(this);
166
    }
167

  
168
    public DefaultReportViewCapture(ReportServerConfig config, JSONObject json) {
169
        this(config);
170
        this.fromJSON(json);
171
    }
172

  
173
    @Override
174
    public boolean isEmpty() {
175
        return StringUtils.isBlank(this.viewName);
176
    }
177

  
178
    @Override
179
    public String getReportDataSet() {
180
        return reportDataSetName;
181
    }
182
    
183
    @Override
184
    public void setReportDataSet(String reportDataSet) {
185
        this.reportDataSetName = reportDataSet;
186
    }
187
    
188
    @Override
189
    public String toString() {
190
        return this.getName();
191
    }
192

  
193
    @Override
194
    public String getName() {
195
        return this.name;
196
    }
197

  
198
    @Override
199
    public void setName(String name) {
200
        this.name = name;
201
        this.propertyChangeSupport.firePropertyChange("name", null, null);
202
    }
203

  
204
    @Override
205
    public String getView() {
206
        return this.viewName;
207
    }
208

  
209
    @Override
210
    public void setView(String view) {
211
        this.viewName = view;
212
        this.propertyChangeSupport.firePropertyChange("view", null, null);
213
    }
214
   
215
    private static String encodeForURL(String s) {
216
        try {
217
            return URLEncoder.encode(s, "UTF8");
218
        } catch (UnsupportedEncodingException ex) {
219
            return s;
220
        }
221
    }
222
    
223
    @Override
224
    public String getFullURLPath() {
225
        StringBuilder builder = new StringBuilder();
226
        builder.append("/captureview/captureName/");
227
        builder.append(encodeForURL(this.name));
228
        builder.append("/viewName/");
229
        builder.append(encodeForURL(this.viewName));
230
        if( this.getResolution()>0 ) {
231
            builder.append("/DPI/");
232
            builder.append(this.getResolution());
233
        }
234
        if (!this.centerFilter.isEmpty()) {
235
            builder.append("/center/");
236
            builder.append(this.centerFilter.getDataSet());
237
            builder.append("/");
238
            builder.append(this.centerFilter.getURLPart());
239
        }
240
        if (!this.zoomFilter.isEmpty()) {
241
            builder.append("/zoom/");
242
            builder.append(this.zoomFilter.getDataSet());
243
            builder.append("/");
244
            builder.append(this.zoomFilter.getURLPart());
245
        }
246
        if (!this.selectFilter.isEmpty()) {
247
            builder.append("/select/");
248
            builder.append(this.selectFilter.getDataSet());
249
            builder.append("/");
250
            builder.append(this.selectFilter.getURLPart());
251
        }
252
        if (this.margins > 0) {
253
            builder.append("/margins/");
254
            builder.append(this.margins);
255
        }
256
        if (this.clearSelection) {
257
            builder.append("/clearselection");
258
        }
259
        if (this.hasDimensions()) {
260
            builder.append("/width/");
261
            builder.append(this.dimensions.width);
262
            builder.append("/height/");
263
            builder.append(this.dimensions.height);
264
        }
265
        return builder.toString();
266
    }
267
    
268
    @Override
269
    public boolean hasDimensions() {
270
        return this.dimensions.height > 0 || this.dimensions.width > 0;
271
    }
272

  
273
    @Override
274
    public Dimension getDimensions() {
275
        return this.dimensions;
276
    }
277

  
278
    @Override
279
    public ReportViewCaptureFilter getZoomFilter() {
280
        return this.zoomFilter;
281
    }
282

  
283
    @Override
284
    public ReportViewCaptureFilter getCenterFilter() {
285
        return this.centerFilter;
286
    }
287

  
288
    @Override
289
    public ReportViewCaptureFilter getSelectionFilter() {
290
        return this.selectFilter;
291
    }
292

  
293
    @Override
294
    public int getMargins() {
295
        return this.margins;
296
    }
297

  
298
    @Override
299
    public void setMargins(int margins) {
300
        this.margins = margins;
301
        this.propertyChangeSupport.firePropertyChange("margins", null, null);
302
    }
303

  
304
    @Override
305
    public boolean getClearSelection() {
306
        return this.clearSelection;
307
    }
308

  
309
    @Override
310
    public void setClearSelection(boolean clearSelection) {
311
        this.clearSelection = clearSelection;
312
        this.propertyChangeSupport.firePropertyChange("clearSelection", null, null);
313
    }
314

  
315
    public void addPropertyChangeListener(PropertyChangeListener listener) {
316
        this.propertyChangeSupport.addPropertyChangeListener(listener);
317
    }
318

  
319
    public void removePropertyChangeListener(PropertyChangeListener listener) {
320
        this.propertyChangeSupport.removePropertyChangeListener(listener);
321
    }
322

  
323
    public JSONObject toJSON() {
324
        JSONObject me = new JSONObject();
325

  
326
        me.put("zoomFilter", this.zoomFilter.toJSON());
327
        me.put("centerFilter", this.centerFilter.toJSON());
328
        me.put("selectFilter", this.selectFilter.toJSON());
329
        me.put("viewName", this.viewName);
330
        me.put("reportDataSetName", this.reportDataSetName);
331
        me.put("clearSelection", this.clearSelection);
332
        me.put("dimension.width", this.dimensions.width);
333
        me.put("dimension.height", this.dimensions.height);
334

  
335
        return me;
336
    }
337

  
338
    public void fromJSON(JSONObject json) {
339
        this.zoomFilter = new DefaultReportViewCaptureFilter(json.getJSONObject("zoomFilter"));
340
        this.centerFilter = new DefaultReportViewCaptureFilter(json.getJSONObject("centerFilter"));
341
        this.selectFilter = new DefaultReportViewCaptureFilter(json.getJSONObject("selectFilter"));
342
        if( json.has("viewName") ) {
343
            this.viewName = json.getString("viewName");
344
        }
345
        if( json.has("reportDataSetName") ) {
346
            this.reportDataSetName = json.getString("reportDataSetName");
347
        }
348
        if( json.has("clearSelection") ) {
349
            this.clearSelection = json.getBoolean("clearSelection");
350
        }
351
        int width = 0;
352
        int height = 0;
353
        if( json.has("dimension.width") ) {
354
            width = json.getInt("dimension.width");
355
        }
356
        if( json.has("dimension.height") ) {
357
            height = json.getInt("dimension.height");
358
        }
359
        this.dimensions = new Dimension(width, height);
360
    }
361
    @Override
362
    public int getResolution() {
363
        return this.resolution;
364
    }
365

  
366
    @Override
367
    public void setResolution(int resolution) {
368
        this.resolution = resolution;
369
    }
370

  
371
}
org.gvsig.report/tags/org.gvsig.report-1.0.89/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/reportbuilder/DefaultBorderBuilder.java
1
package org.gvsig.report.lib.impl.reportbuilder;
2

  
3
import ar.com.fdvs.dj.domain.constants.Border;
4
import java.awt.Color;
5
import org.gvsig.report.lib.api.ReportBuilder;
6
import org.gvsig.report.lib.api.ReportBuilder.BorderBuilder;
7
import org.gvsig.tools.persistence.PersistentState;
8
import org.gvsig.tools.persistence.exception.PersistenceException;
9

  
10
/**
11
 *
12
 * @author jjdelcerro
13
 */
14
public class DefaultBorderBuilder implements ReportBuilder.BorderBuilder {
15

  
16
    private Color color;
17
    private int lineStyle;
18
    private int width;
19

  
20
    public DefaultBorderBuilder() {
21
        this.color = Color.BLACK;
22
        this.width = 0;
23
        this.lineStyle = BorderBuilder.WIDTH_1POINT;
24
    }
25

  
26
    @Override
27
    public BorderBuilder clone() throws CloneNotSupportedException {
28
        DefaultBorderBuilder other = (DefaultBorderBuilder) super.clone();
29
        return other;
30
    }
31

  
32
    @Override
33
    public void copyFrom(BorderBuilder other) {
34
        this.color = other.getColor();
35
        this.width = other.getWidth();
36
        this.lineStyle = other.getLineStyle();
37
    }
38

  
39
    @Override
40
    public Color getColor() {
41
        return this.color;
42
    }
43

  
44
    @Override
45
    public ReportBuilder.BorderBuilder color(Color color) {
46
        this.color = color;
47
        return this;
48
    }
49

  
50
    @Override
51
    public int getWidth() {
52
        return this.width;
53
    }
54

  
55
    @Override
56
    public ReportBuilder.BorderBuilder width(int width) {
57
        this.width = width;
58
        return this;
59
    }
60

  
61
    @Override
62
    public int getLineStyle() {
63
        return this.lineStyle;
64
    }
65

  
66
    @Override
67
    public ReportBuilder.BorderBuilder lineStyle(int lineStyle) {
68
        this.lineStyle = lineStyle;
69
        return this;
70
    }
71

  
72
    @Override
73
    public void saveToState(PersistentState ps) throws PersistenceException {
74
        // TODO
75
    }
76

  
77
    @Override
78
    public void loadFromState(PersistentState ps) throws PersistenceException {
79
        // TODO
80
    }
81

  
82
    public static void registerPersistence() {
83
        // TODO
84
    }
85

  
86
    Border build() {
87
        float theWidth;
88
        byte theLineStyle;
89

  
90
        switch (this.width) {
91
            case STYLE_SOLID:
92
            default:
93
                theLineStyle = Border.BORDER_STYLE_SOLID;
94
                break;
95
            case STYLE_DASHED:
96
                theLineStyle = Border.BORDER_STYLE_DASHED;
97
                break;
98
            case STYLE_DOTTED:
99
                theLineStyle = Border.BORDER_STYLE_DOTTED;
100
                break;
101
            case STYLE_DOUBLE:
102
                theLineStyle = Border.BORDER_STYLE_DOUBLE;
103
                break;
104
        }
105
        switch (this.lineStyle) {
106
            case WIDTH_NONE:
107
            default:
108
                theWidth = Border.BORDER_WIDTH_NONE;
109
                break;
110
            case WIDTH_1POINT:
111
                theWidth = Border.BORDER_WIDTH_1POINT;
112
                break;
113
            case WIDTH_2POINT:
114
                theWidth = Border.BORDER_WIDTH_2POINT;
115
                break;
116
            case WIDTH_4POINT:
117
                theWidth = Border.BORDER_WIDTH_4POINT;
118
                break;
119
            case WIDTH_THIN:
120
                theWidth = Border.BORDER_WIDTH_THIN;
121
                break;
122
        }
123
        Border border = new Border(
124
                theWidth,
125
                theLineStyle,
126
                this.color
127
        );
128
        return border;
129
    }
130
}
org.gvsig.report/tags/org.gvsig.report-1.0.89/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/reportbuilder/DefaultColumnBuilder.java
1
package org.gvsig.report.lib.impl.reportbuilder;
2

  
3
import ar.com.fdvs.dj.domain.CustomExpression;
4
import ar.com.fdvs.dj.domain.entities.columns.AbstractColumn;
5
import java.util.HashMap;
6
import java.util.Map;
7
import net.sf.jasperreports.engine.fill.JRFillField;
8
import org.apache.commons.lang3.StringUtils;
9
import org.gvsig.expressionevaluator.Expression;
10
import org.gvsig.expressionevaluator.spi.AbstractSymbolTable;
11
import org.gvsig.report.lib.api.ReportBuilder;
12
import org.gvsig.tools.ToolsLocator;
13
import org.gvsig.tools.dataTypes.DataType;
14
import org.gvsig.tools.dataTypes.DataTypes;
15
import org.gvsig.tools.persistence.PersistentState;
16
import org.gvsig.tools.persistence.exception.PersistenceException;
17

  
18
/**
19
 *
20
 * @author jjdelcerro
21
 */
22
public class DefaultColumnBuilder implements ReportBuilder.ColumnBuilder {
23

  
24
    private String title;
25
    private ReportBuilder.StyleBuilder titleStyle;
26
    private String field;
27
    private ReportBuilder.StyleBuilder fieldStyle;
28
    private Expression expression;
29
    private ReportBuilder.StyleBuilder expressionStyle;
30
    private DataType dataType;
31
    private int width;
32
    private boolean fixedWidth;
33
    private String pattern;
34
    private String truncateSuffix;
35
    private boolean groupByField;
36
    private int groupByOperation;
37
    private String columnName;
38

  
39
    public DefaultColumnBuilder() {
40
        this.expressionStyle = new DefaultStyleBuilder();
41
        this.fieldStyle = new DefaultStyleBuilder();
42
        this.titleStyle = new DefaultStyleBuilder();
43
        this.truncateSuffix = "...";
44
        this.expression = null;
45
        this.pattern = null;
46
        this.width = 10;
47
        this.dataType = ToolsLocator.getDataTypesManager().get(DataTypes.STRING);
48
        this.groupByField = false;
49
        this.groupByOperation = 7;
50
        this.columnName = "";
51
    }
52

  
53
    @Override
54
    public ReportBuilder.ColumnBuilder clone() throws CloneNotSupportedException {
55
        DefaultColumnBuilder other = (DefaultColumnBuilder) super.clone();
56
        other.expressionStyle = this.expressionStyle.clone();
57
        other.fieldStyle = this.fieldStyle.clone();
58
        other.titleStyle = this.titleStyle.clone();
59
        if (this.expression != null) {
60
            other.expression = this.expression.clone();
61
        }
62
        // TODO: Usar aqui el metodo clone de DataType
63
        other.dataType = ToolsLocator.getDataTypesManager().get(this.dataType.getType());
64
        return other;
65
    }
66

  
67
    @Override
68
    public void copyFrom(ReportBuilder.ColumnBuilder other) {
69
        try {
70
            this.columnName = other.getColumnName();
71
            this.title = other.getTitle();
72

  
73
            this.width = other.getWidth();
74
            this.fixedWidth = other.getFixedWidth();
75
            this.pattern = other.getPattern();
76
            this.truncateSuffix = other.getTruncateSuffix();
77

  
78
            this.titleStyle = other.titleStyle().clone();
79
            if (other.getExpression() != null) { //TODO FIX PHARSE GETTERS
80
                this.expression = other.getExpression().clone();
81
                this.field = "";
82
                this.expressionStyle = other.expressionStyle().clone();
83
            } else {
84
                this.expression = null;
85
                this.field = other.getField();
86
                this.fieldStyle = other.fieldStyle().clone();
87
            }
88
            this.dataType = other.getDataType().clone();
89
            this.groupByField = other.showGroupByField();
90
            this.groupByOperation = other.getGroupByOperation();
91
        } catch (CloneNotSupportedException ex) {
92
            throw new RuntimeException("Can't copy ColumnBuilder", ex);
93
        }
94
    }
95

  
96
    @Override
97
    public String getColumnName() {
98
        return this.columnName;
99
    }
100

  
101
    @Override
102
    public ReportBuilder.ColumnBuilder columnName(String columnName) {
103
        this.columnName = columnName;
104
        return this;
105
    }
106

  
107
    @Override
108
    public String getTitle() {
109
        return this.title;
110
    }
111

  
112
    @Override
113
    public ReportBuilder.StyleBuilder titleStyle() {
114
        return this.titleStyle;
115
    }
116

  
117
    @Override
118
    public ReportBuilder.ColumnBuilder title(String title) {
119
        this.title = title;
120
        return this;
121
    }
122

  
123
    @Override
124
    public String getField() {
125
        return this.field;
126
    }
127

  
128
    @Override
129
    public ReportBuilder.StyleBuilder fieldStyle() {
130
        return this.fieldStyle;
131
    }
132

  
133
    @Override
134
    public ReportBuilder.ColumnBuilder field(String field) {
135
        this.field = field;
136
        return this;
137
    }
138

  
139
    @Override
140
    public Expression getExpression() {
141
        return this.expression;
142
    }
143

  
144
    @Override
145
    public ReportBuilder.StyleBuilder expressionStyle() {
146
        return this.expressionStyle;
147
    }
148

  
149
    @Override
150
    public ReportBuilder.ColumnBuilder expression(Expression expression) {
151
        this.expression = expression;
152
        return this;
153
    }
154

  
155
    @Override
156
    public DataType getDataType() {
157
        return this.dataType;
158
    }
159

  
160
    @Override
161
    public ReportBuilder.ColumnBuilder dataType(DataType dataType) {
162
        this.dataType = dataType;
163
        return this;
164
    }
165

  
166
    @Override
167
    public int getWidth() {
168
        return this.width;
169
    }
170

  
171
    @Override
172
    public ReportBuilder.ColumnBuilder width(int width) {
173
        this.width = width;
174
        return this;
175
    }
176

  
177
    @Override
178
    public boolean getFixedWidth() {
179
        return this.fixedWidth;
180
    }
181

  
182
    @Override
183
    public ReportBuilder.ColumnBuilder fixedWidth(boolean fixedWidth) {
184
        this.fixedWidth = fixedWidth;
185
        return this;
186
    }
187

  
188
    @Override
189
    public String getPattern() {
190
        return this.pattern;
191
    }
192

  
193
    @Override
194
    public ReportBuilder.ColumnBuilder pattern(String pattern) {
195
        this.pattern = pattern;
196
        return this;
197
    }
198

  
199
    @Override
200
    public String getTruncateSuffix() {
201
        return this.truncateSuffix;
202
    }
203

  
204
    @Override
205
    public ReportBuilder.ColumnBuilder truncateSuffix(String truncateSuffix) {
206
        this.truncateSuffix = truncateSuffix;
207
        return this;
208
    }
209

  
210
    @Override
211
    public void saveToState(PersistentState ps) throws PersistenceException {
212
        // TODO
213
    }
214

  
215
    @Override
216
    public void loadFromState(PersistentState ps) throws PersistenceException {
217
        // TODO
218
    }
219

  
220
    public static void registerPersistence() {
221
        // TODO
222
    }
223

  
224
    @Override
225
    public boolean showGroupByField() {
226
        return this.groupByField;
227
    }
228

  
229
    @Override
230
    public void groupByField(boolean groupByField) {
231
        this.groupByField = groupByField;
232
    }
233

  
234
    @Override
235
    public int getGroupByOperation() {
236
        return this.groupByOperation;
237
    }
238

  
239
    @Override
240
    public void groupByOperation(int groupByOperation) {
241
        this.groupByOperation = groupByOperation;
242
    }
243

  
244
    private static class MapSymbolTable extends AbstractSymbolTable {
245

  
246
        public MapSymbolTable() {
247

  
248
        }
249

  
250
        public void setVars(Map<String, Object> vars) {
251
            Map<String, Object> map1 = getVars();
252
            for (Map.Entry<String, Object> var : vars.entrySet()) {
253
                JRFillField value = (JRFillField) var.getValue();
254
                map1.put(var.getKey(), value.getValue());
255
            }
256
        }
257
    }
258

  
259
    public AbstractColumn build() {
260
        ar.com.fdvs.dj.domain.builders.ColumnBuilder colBuilder = ar.com.fdvs.dj.domain.builders.ColumnBuilder.getNew();
261

  
262
        if (this.expression == null || this.expression.isPhraseEmpty()) {
263
            colBuilder.setColumnProperty(
264
                    this.field,
265
                    this.dataType.getDefaultClass().getName()
266
            );
267
            if (this.fieldStyle != null) {
268
                colBuilder.setStyle(((DefaultStyleBuilder) this.fieldStyle).build());
269
            }
270
        } else {
271
            
272
            final Expression exp;
273
            final GvsigCustomExpression expGvsig;
274
            try {
275
                exp = this.expression.clone();
276
                expGvsig = new GvsigCustomExpression(exp, dataType);
277
            } catch (CloneNotSupportedException ex) {
278
                throw new RuntimeException("Can't clone expression.", ex);
279
            }
280

  
281
            colBuilder.setCustomExpression(expGvsig);
282
            if (this.expressionStyle != null) {
283
                colBuilder.setStyle(((DefaultStyleBuilder) this.expressionStyle).build());
284
            }
285
        }
286

  
287
        if (!StringUtils.isBlank(this.title)) {
288
            colBuilder.setTitle(this.title);
289
            if (this.titleStyle != null) {
290
                colBuilder.setHeaderStyle(((DefaultStyleBuilder) this.titleStyle).build());
291
            }
292
        }
293
        colBuilder.setWidth(this.width);
294
        colBuilder.setFixedWidth(this.fixedWidth);
295
        if (!StringUtils.isBlank(this.pattern)) {
296
            colBuilder.setPattern(this.pattern);
297
        }
298
        if (!StringUtils.isBlank(this.truncateSuffix)) {
299
            colBuilder.setTruncateSuffix(this.truncateSuffix);
300
        }
301
        AbstractColumn columnBuild = colBuilder.build();
302
        return columnBuild;
303
    }
304
}
org.gvsig.report/tags/org.gvsig.report-1.0.89/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/reportbuilder/GvsigCustomExpression.java
1
package org.gvsig.report.lib.impl.reportbuilder;
2

  
3
import ar.com.fdvs.dj.domain.CustomExpression;
4
import java.util.HashMap;
5
import java.util.Map;
6
import java.util.Set;
7
import net.sf.jasperreports.engine.fill.JRFillField;
8
import org.gvsig.expressionevaluator.Expression;
9
import org.gvsig.expressionevaluator.SymbolTable;
10
import org.gvsig.expressionevaluator.impl.DefaultSymbolTable;
11
import org.gvsig.expressionevaluator.spi.AbstractSymbolTable;
12
import org.gvsig.tools.dataTypes.DataType;
13

  
14
/**
15
 *
16
 * @author osc
17
 */
18
public class GvsigCustomExpression implements CustomExpression {
19

  
20
    public final Expression expression;
21
    private final DataType dataType;
22

  
23
    GvsigCustomExpression(Expression exp, DataType dataType) {
24
        this.expression = exp;
25
        this.dataType = dataType;
26
    }
27

  
28
    @Override
29
    public Object evaluate(Map fields, Map variables, Map parameters) {
30
        
31
        DefaultSymbolTable symbolTable = (DefaultSymbolTable) this.expression.getSymbolTable();
32
        Map<String, Object> fieldsVars = (Map<String, Object>) fields;
33
        for (Map.Entry<String, Object> var : fieldsVars.entrySet()) {
34
            JRFillField value = (JRFillField) var.getValue();
35
            symbolTable.setVar(var.getKey(), value.getValue());
36
        }
37
        return expression.execute(symbolTable);
38
    }
39

  
40
    @Override
41
    public String getClassName() {
42
        return dataType.getDefaultClass().getName();
43
    }
44
}
org.gvsig.report/tags/org.gvsig.report-1.0.89/org.gvsig.report.lib/org.gvsig.report.lib.impl/src/main/java/org/gvsig/report/lib/impl/reportbuilder/DefaultStyleBuilder.java
1
package org.gvsig.report.lib.impl.reportbuilder;
2

  
3
import ar.com.fdvs.dj.domain.Style;
4
import ar.com.fdvs.dj.domain.constants.Font;
5
import ar.com.fdvs.dj.domain.constants.HorizontalAlign;
6
import ar.com.fdvs.dj.domain.constants.Rotation;
7
import ar.com.fdvs.dj.domain.constants.Stretching;
8
import ar.com.fdvs.dj.domain.constants.Transparency;
9
import ar.com.fdvs.dj.domain.constants.VerticalAlign;
10
import java.awt.Color;
11
import org.gvsig.report.lib.api.ReportBuilder;
12
import org.gvsig.report.lib.api.ReportBuilder.StyleBuilder;
13
import org.gvsig.tools.persistence.PersistentState;
14
import org.gvsig.tools.persistence.exception.PersistenceException;
15

  
16
/**
17
 *
18
 * @author jjdelcerro
19
 */
20
public class DefaultStyleBuilder implements ReportBuilder.StyleBuilder {
21

  
22
    private Color textColor;
23
    private Color backgroundColor;
24
    private int rotation;
25
    private int stretching;
26
    private boolean stretchingWithOverflow;
27
    private boolean transparent;
28
    private int verticalAlign;
29
    private int horizontalAlign;
30
    private ReportBuilder.BorderBuilder borderTop;
31
    private ReportBuilder.BorderBuilder borderBottom;
32
    private ReportBuilder.BorderBuilder borderLeft;
33
    private ReportBuilder.BorderBuilder borderRight;
34
    private int paddingTop;
35
    private int paddingBottom;
36
    private int paddingLeft;
37
    private int paddingRight;
38
    private int font;
39
    private int fontSize;
40
    private int transparency;
41

  
42
    public DefaultStyleBuilder() {
43
        this.borderTop = new DefaultBorderBuilder();
44
        this.borderBottom = new DefaultBorderBuilder();
45
        this.borderLeft = new DefaultBorderBuilder();
46
        this.borderRight = new DefaultBorderBuilder();
47
        this.textColor = Color.BLACK;
48
        this.backgroundColor = Color.WHITE;
49
        this.transparency = StyleBuilder.TRANSPARENCY_OPAQUE;
50
        this.transparent = false;
51
        this.font = StyleBuilder.FONT_ARIAL;
52
        this.fontSize = 10;
53
        this.paddingBottom = 2;
54
        this.paddingLeft = 2;
55
        this.paddingRight = 2;
56
        this.paddingTop = 2;
57
        this.stretching = StyleBuilder.STRETCHING_RELATIVE_TO_TALLEST_OBJECT;
58
        this.stretchingWithOverflow = true;
59
    }
60

  
61
    @Override
62
    public ReportBuilder.StyleBuilder clone() throws CloneNotSupportedException {
63
        DefaultStyleBuilder other = (DefaultStyleBuilder) super.clone();
64
        other.borderTop = this.borderTop.clone();
65
        other.borderBottom = this.borderBottom.clone();
66
        other.borderLeft = this.borderLeft.clone();
67
        other.borderRight = this.borderRight.clone();
68
        return other;
69
    }
70

  
71
    @Override
72
    public void copyFrom(ReportBuilder.StyleBuilder other) {
73
        try {
74
            this.font = other.getFont();
75
            this.fontSize = other.getFontSize();
76
            this.textColor = other.getTextColor();
77
            this.backgroundColor = other.getBackgroundColor();
78
            this.rotation = other.getRotation();
79
            this.stretching = other.getStretching();
80
            this.stretchingWithOverflow = other.getStretchingWithOverflow();
81
            this.transparency = other.getTransparency();
82
            this.transparent = other.getTransparent();
83
            this.verticalAlign = other.getVerticalAlign();
84
            this.horizontalAlign = other.getHorizontalAlign();
85
            this.paddingTop = other.getPaddingTop();
86
            this.paddingBottom = other.getPaddingBottom();
87
            this.paddingLeft = other.getPaddingLeft();
88
            this.paddingRight = other.getPaddingRight();
89

  
90
            this.borderTop = other.getBorderTop().clone();
91
            this.borderBottom = other.getBorderBottom().clone();
92
            this.borderLeft = other.getBorderLeft().clone();
93
            this.borderRight = other.getBorderRight().clone();
94
        } catch (CloneNotSupportedException ex) {
95
            throw new RuntimeException("Can't copy Style", ex);
96
        }
97
    }
98

  
99
    @Override
100
    public Color getTextColor() {
101
        return this.textColor;
102
    }
103

  
104
    @Override
105
    public ReportBuilder.StyleBuilder textColor(Color textColor) {
106
        this.textColor = textColor;
107
        return this;
108
    }
109

  
110
    @Override
111
    public Color getBackgroundColor() {
112
        return this.backgroundColor;
113
    }
114

  
115
    @Override
116
    public ReportBuilder.StyleBuilder backgroundColor(Color backgroundColor) {
117
        this.backgroundColor = backgroundColor;
118
        return this;
119
    }
120

  
121
    @Override
122
    public int getRotation() {
123
        return this.rotation;
124
    }
125

  
126
    @Override
127
    public ReportBuilder.StyleBuilder rotation(int rotation) {
128
        this.rotation = rotation;
129
        return this;
130
    }
131

  
132
    @Override
133
    public int getStretching() {
134
        return this.stretching;
135
    }
136

  
137
    @Override
138
    public ReportBuilder.StyleBuilder stretching(int stretching) {
139
        this.stretching = stretching;
140
        return this;
141
    }
142

  
143
    @Override
144
    public boolean getStretchingWithOverflow() {
145
        return this.stretchingWithOverflow;
146
    }
147

  
148
    @Override
149
    public ReportBuilder.StyleBuilder stretchingWithOverflow(boolean stretchingWithOverflow) {
150
        this.stretchingWithOverflow = stretchingWithOverflow;
151
        return this;
152
    }
153

  
154
    @Override
155
    public boolean getTransparent() {
156
        return this.transparent;
157
    }
158

  
159
    @Override
160
    public ReportBuilder.StyleBuilder transparent(boolean transparent) {
161
        this.transparent = transparent;
162
        return this;
163
    }
164

  
165
    @Override
166
    public int getTransparency() {
167
        return this.transparency;
168
    }
169

  
170
    @Override
171
    public ReportBuilder.StyleBuilder transparency(int transparency) {
172
        this.transparency = transparency;
173
        return this;
174
    }
175

  
176
    @Override
177
    public int getVerticalAlign() {
178
        return this.verticalAlign;
179
    }
180

  
181
    @Override
182
    public ReportBuilder.StyleBuilder verticalAlign(int verticalAlign) {
183
        this.verticalAlign = verticalAlign;
184
        return this;
185
    }
186

  
187
    @Override
188
    public int getHorizontalAlign() {
189
        return this.horizontalAlign;
190
    }
191

  
192
    @Override
193
    public ReportBuilder.StyleBuilder horizontalAlign(int horizontalAlign) {
194
        this.horizontalAlign = horizontalAlign;
195
        return this;
196
    }
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff