Revision 9011
org.gvsig.report/tags/org.gvsig.report-1.0.166/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.desktop</artifactId> |
|
6 |
<version>2.0.434</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.report</artifactId> |
|
9 |
<version>1.0.166</version> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<name>${project.artifactId}</name> |
|
12 |
<properties> |
|
13 |
<org.gvsig.pdf.version>1.0.141</org.gvsig.pdf.version> |
|
14 |
</properties> |
|
15 |
<url>https://redmine.gvsig.net/redmine/projects/gvsig-projects-pool</url> |
|
16 |
|
|
17 |
<repositories> |
|
18 |
<repository> |
|
19 |
<id>gvsig-public-http-repository</id> |
|
20 |
<name>gvSIG maven public HTTP repository</name> |
|
21 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
22 |
<releases> |
|
23 |
<enabled>true</enabled> |
|
24 |
<updatePolicy>daily</updatePolicy> |
|
25 |
<checksumPolicy>warn</checksumPolicy> |
|
26 |
</releases> |
|
27 |
<snapshots> |
|
28 |
<enabled>true</enabled> |
|
29 |
<updatePolicy>daily</updatePolicy> |
|
30 |
<checksumPolicy>warn</checksumPolicy> |
|
31 |
</snapshots> |
|
32 |
</repository> |
|
33 |
</repositories> |
|
34 |
<distributionManagement> |
|
35 |
<site> |
|
36 |
<id>gvsig-repository</id> |
|
37 |
<url>dav:https://devel.gvsig.org/download/projects/gvsig-report/pool/${project.artifactId}/${project.version}</url> |
|
38 |
</site> |
|
39 |
</distributionManagement> |
|
40 |
<scm> |
|
41 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.report/tags/org.gvsig.report-1.0.166</connection> |
|
42 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-projects-pool/org.gvsig.report/tags/org.gvsig.report-1.0.166</developerConnection> |
|
43 |
<url>https://redmine.gvsig.net/redmine/projects/gvsig-projects-pool/repository/show/org.gvsig.report/tags/org.gvsig.report-1.0.166</url> |
|
44 |
</scm> |
|
45 |
|
|
46 |
<build> |
|
47 |
<plugins> |
|
48 |
<plugin> |
|
49 |
<groupId>org.apache.maven.plugins</groupId> |
|
50 |
<artifactId>maven-release-plugin</artifactId> |
|
51 |
<configuration> |
|
52 |
<tagBase>https://devel.gvsig.org/svn/gvsig-projects-pool/${project.artifactId}/tags</tagBase> |
|
53 |
<goal>deploy</goal> |
|
54 |
</configuration> |
|
55 |
</plugin> |
|
56 |
</plugins> |
|
57 |
</build> |
|
58 |
|
|
59 |
|
|
60 |
<dependencyManagement> |
|
61 |
<dependencies> |
|
62 |
<dependency> |
|
63 |
<groupId>org.gvsig</groupId> |
|
64 |
<artifactId>org.gvsig.report.app.mainplugin</artifactId> |
|
65 |
<version>1.0.166</version> |
|
66 |
</dependency> |
|
67 |
<dependency> |
|
68 |
<groupId>org.gvsig</groupId> |
|
69 |
<artifactId>org.gvsig.report.lib.api</artifactId> |
|
70 |
<version>1.0.166</version> |
|
71 |
</dependency> |
|
72 |
<dependency> |
|
73 |
<groupId>org.gvsig</groupId> |
|
74 |
<artifactId>org.gvsig.report.lib.impl</artifactId> |
|
75 |
<version>1.0.166</version> |
|
76 |
</dependency> |
|
77 |
<dependency> |
|
78 |
<groupId>org.gvsig</groupId> |
|
79 |
<artifactId>org.gvsig.report.swing.api</artifactId> |
|
80 |
<version>1.0.166</version> |
|
81 |
</dependency> |
|
82 |
<dependency> |
|
83 |
<groupId>org.gvsig</groupId> |
|
84 |
<artifactId>org.gvsig.report.swing.impl</artifactId> |
|
85 |
<version>1.0.166</version> |
|
86 |
</dependency> |
|
87 |
|
|
88 |
<dependency> |
|
89 |
<groupId>org.apache.httpcomponents</groupId> |
|
90 |
<artifactId>httpcore-nio</artifactId> |
|
91 |
<version>4.4.4</version> |
|
92 |
</dependency> |
|
93 |
<dependency> |
|
94 |
<groupId>org.apache.httpcomponents</groupId> |
|
95 |
<artifactId>httpcore</artifactId> |
|
96 |
<version>4.4.4</version> |
|
97 |
</dependency> |
|
98 |
|
|
99 |
<dependency> |
|
100 |
<groupId>ar.com.fdvs</groupId> |
|
101 |
<artifactId>DynamicJasper</artifactId> |
|
102 |
<version>5.3.2</version> |
|
103 |
</dependency> |
|
104 |
<dependency> |
|
105 |
<groupId>ar.com.fdvs</groupId> |
|
106 |
<artifactId>DynamicJasper-core-fonts</artifactId> |
|
107 |
<version>2.0</version> |
|
108 |
</dependency> |
|
109 |
<dependency> |
|
110 |
<groupId>net.sf.jasperreports</groupId> |
|
111 |
<artifactId>jasperreports</artifactId> |
|
112 |
<version>6.17.0</version> |
|
113 |
</dependency> |
|
114 |
<dependency> |
|
115 |
<groupId>net.sf.jasperreports</groupId> |
|
116 |
<artifactId>jasperreports-metadata</artifactId> |
|
117 |
<version>6.17.0</version> |
|
118 |
</dependency> |
|
119 |
<dependency> |
|
120 |
<groupId>net.sf.jasperreports</groupId> |
|
121 |
<artifactId>jasperreports-fonts</artifactId> |
|
122 |
<version>6.17.0</version> |
|
123 |
</dependency> |
|
124 |
<dependency> |
|
125 |
<groupId>com.mpobjects.jasperreports.font</groupId> |
|
126 |
<artifactId>jasperreports-fonts-liberation</artifactId> |
|
127 |
<version>2.1.2</version> |
|
128 |
</dependency> |
|
129 |
<dependency> |
|
130 |
<groupId>net.sf.jasperreports</groupId> |
|
131 |
<artifactId>jasperreports-functions</artifactId> |
|
132 |
<version>6.17.0</version> |
|
133 |
</dependency> |
|
134 |
<dependency> |
|
135 |
<groupId>net.sf.jasperreports</groupId> |
|
136 |
<artifactId>jasperreports-custom-visualization</artifactId> |
|
137 |
<version>6.17.0</version> |
|
138 |
</dependency> |
|
139 |
<dependency> |
|
140 |
<groupId>net.sf.jasperreports</groupId> |
|
141 |
<artifactId>jasperreports-chart-themes</artifactId> |
|
142 |
<version>6.17.0</version> |
|
143 |
</dependency> |
|
144 |
<dependency> |
|
145 |
<groupId>net.sf.jasperreports</groupId> |
|
146 |
<artifactId>jasperreports-chart-customizers</artifactId> |
|
147 |
<version>6.17.0</version> |
|
148 |
</dependency> |
|
149 |
<dependency> |
|
150 |
<groupId>net.sf.jasperreports</groupId> |
|
151 |
<artifactId>jasperreports-annotation-processors</artifactId> |
|
152 |
<version>6.17.0</version> |
|
153 |
</dependency> |
|
154 |
|
|
155 |
<dependency> |
|
156 |
<groupId>org.apache.poi</groupId> |
|
157 |
<artifactId>poi</artifactId> |
|
158 |
<version>4.1.2</version> |
|
159 |
</dependency> |
|
160 |
<dependency> |
|
161 |
<groupId>org.apache.poi</groupId> |
|
162 |
<artifactId>poi-ooxml</artifactId> |
|
163 |
<version>4.1.2</version> |
|
164 |
</dependency> |
|
165 |
<dependency> |
|
166 |
<groupId>org.apache.poi</groupId> |
|
167 |
<artifactId>poi-ooxml-schemas</artifactId> |
|
168 |
<version>4.1.2</version> |
|
169 |
</dependency> |
|
170 |
<dependency> |
|
171 |
<groupId>com.zaxxer</groupId> |
|
172 |
<artifactId>SparseBitSet</artifactId> |
|
173 |
<version>1.2</version> |
|
174 |
</dependency> |
|
175 |
<dependency> |
|
176 |
<groupId>org.apache.xmlbeans</groupId> |
|
177 |
<artifactId>xmlbeans</artifactId> |
|
178 |
<version>3.1.0</version> |
|
179 |
</dependency> |
|
180 |
<dependency> |
|
181 |
<groupId>com.github.virtuald</groupId> |
|
182 |
<artifactId>curvesapi</artifactId> |
|
183 |
<version>1.06</version> |
|
184 |
</dependency> |
|
185 |
<dependency> |
|
186 |
<groupId>org.apache.commons</groupId> |
|
187 |
<artifactId>commons-math3</artifactId> |
|
188 |
<version>3.6.1</version> |
|
189 |
</dependency> |
|
190 |
|
|
191 |
<dependency> |
|
192 |
<groupId>org.springframework</groupId> |
|
193 |
<artifactId>spring-context</artifactId> |
|
194 |
<version>3.0.6.RELEASE</version> |
|
195 |
</dependency> |
|
196 |
<dependency> |
|
197 |
<groupId>org.springframework</groupId> |
|
198 |
<artifactId>spring-aop</artifactId> |
|
199 |
<version>3.0.6.RELEASE</version> |
|
200 |
</dependency> |
|
201 |
<dependency> |
|
202 |
<groupId>org.springframework</groupId> |
|
203 |
<artifactId>spring-beans</artifactId> |
|
204 |
<version>3.0.6.RELEASE</version> |
|
205 |
</dependency> |
|
206 |
<dependency> |
|
207 |
<groupId>org.springframework</groupId> |
|
208 |
<artifactId>spring-core</artifactId> |
|
209 |
<version>3.0.6.RELEASE</version> |
|
210 |
</dependency> |
|
211 |
<dependency> |
|
212 |
<groupId>org.springframework</groupId> |
|
213 |
<artifactId>spring-expression</artifactId> |
|
214 |
<version>3.0.6.RELEASE</version> |
|
215 |
</dependency> |
|
216 |
<dependency> |
|
217 |
<groupId>org.springframework</groupId> |
|
218 |
<artifactId>spring-asm</artifactId> |
|
219 |
<version>3.0.6.RELEASE</version> |
|
220 |
</dependency> |
|
221 |
|
|
222 |
<dependency> |
|
223 |
<groupId>commons-digester</groupId> |
|
224 |
<artifactId>commons-digester</artifactId> |
|
225 |
<version>2.1</version> |
|
226 |
</dependency> |
|
227 |
<dependency> |
|
228 |
<groupId>commons-logging</groupId> |
|
229 |
<artifactId>commons-logging</artifactId> |
|
230 |
<version>1.1.1</version> |
|
231 |
</dependency> |
|
232 |
<dependency> |
|
233 |
<groupId>com.lowagie</groupId> |
|
234 |
<artifactId>itext</artifactId> |
|
235 |
<version>2.1.7</version> |
|
236 |
</dependency> |
|
237 |
<dependency> |
|
238 |
<groupId>bouncycastle</groupId> |
|
239 |
<artifactId>bcmail-jdk14</artifactId> |
|
240 |
<version>138</version> |
|
241 |
</dependency> |
|
242 |
<dependency> |
|
243 |
<groupId>bouncycastle</groupId> |
|
244 |
<artifactId>bcprov-jdk14</artifactId> |
|
245 |
<version>138</version> |
|
246 |
</dependency> |
|
247 |
<dependency> |
|
248 |
<groupId>org.bouncycastle</groupId> |
|
249 |
<artifactId>bctsp-jdk14</artifactId> |
|
250 |
<version>1.38</version> |
|
251 |
</dependency> |
|
252 |
<dependency> |
|
253 |
<groupId>org.bouncycastle</groupId> |
|
254 |
<artifactId>bcprov-jdk14</artifactId> |
|
255 |
<version>1.38</version> |
|
256 |
</dependency> |
|
257 |
<dependency> |
|
258 |
<groupId>org.bouncycastle</groupId> |
|
259 |
<artifactId>bcmail-jdk14</artifactId> |
|
260 |
<version>1.38</version> |
|
261 |
</dependency> |
|
262 |
<dependency> |
|
263 |
<groupId>org.jfree</groupId> |
|
264 |
<artifactId>jcommon</artifactId> |
|
265 |
<version>1.0.23</version> |
|
266 |
</dependency> |
|
267 |
<dependency> |
|
268 |
<groupId>org.jfree</groupId> |
|
269 |
<artifactId>jfreechart</artifactId> |
|
270 |
<version>1.0.14</version> |
|
271 |
</dependency> |
|
272 |
<dependency> |
|
273 |
<groupId>org.eclipse.jdt.core.compiler</groupId> |
|
274 |
<artifactId>ecj</artifactId> |
|
275 |
<version>4.4.2</version> |
|
276 |
</dependency> |
|
277 |
<dependency> |
|
278 |
<groupId>org.codehaus.castor</groupId> |
|
279 |
<artifactId>castor-xml</artifactId> |
|
280 |
<version>1.3.3</version> |
|
281 |
</dependency> |
|
282 |
<dependency> |
|
283 |
<groupId>org.codehaus.castor</groupId> |
|
284 |
<artifactId>castor-core</artifactId> |
|
285 |
<version>1.3.3</version> |
|
286 |
</dependency> |
|
287 |
<dependency> |
|
288 |
<groupId>commons-lang</groupId> |
|
289 |
<artifactId>commons-lang</artifactId> |
|
290 |
<version>2.6</version> |
|
291 |
</dependency> |
|
292 |
<dependency> |
|
293 |
<groupId>javax.inject</groupId> |
|
294 |
<artifactId>javax.inject</artifactId> |
|
295 |
<version>1</version> |
|
296 |
</dependency> |
|
297 |
<dependency> |
|
298 |
<groupId>stax</groupId> |
|
299 |
<artifactId>stax</artifactId> |
|
300 |
<version>1.2.0</version> |
|
301 |
</dependency> |
|
302 |
<dependency> |
|
303 |
<groupId>stax</groupId> |
|
304 |
<artifactId>stax-api</artifactId> |
|
305 |
<version>1.0.1</version> |
|
306 |
</dependency> |
|
307 |
<dependency> |
|
308 |
<groupId>javax.xml.stream</groupId> |
|
309 |
<artifactId>stax-api</artifactId> |
|
310 |
<version>1.0-2</version> |
|
311 |
</dependency> |
|
312 |
<dependency> |
|
313 |
<groupId>com.fasterxml.jackson.core</groupId> |
|
314 |
<artifactId>jackson-core</artifactId> |
|
315 |
<version>2.9.5</version> |
|
316 |
</dependency> |
|
317 |
<dependency> |
|
318 |
<groupId>com.fasterxml.jackson.core</groupId> |
|
319 |
<artifactId>jackson-databind</artifactId> |
|
320 |
<version>2.9.5</version> |
|
321 |
</dependency> |
|
322 |
<dependency> |
|
323 |
<groupId>com.fasterxml.jackson.core</groupId> |
|
324 |
<artifactId>jackson-annotations</artifactId> |
|
325 |
<version>2.9.5</version> |
|
326 |
</dependency> |
|
327 |
<dependency> |
|
328 |
<groupId>com.ibm.icu</groupId> |
|
329 |
<artifactId>icu4j</artifactId> |
|
330 |
<version>57.1</version> |
|
331 |
</dependency> |
|
332 |
|
|
333 |
<dependency> |
|
334 |
<groupId>org.gvsig</groupId> |
|
335 |
<artifactId>org.gvsig.pdf.lib.api</artifactId> |
|
336 |
<version>${org.gvsig.pdf.version}</version> |
|
337 |
<scope>compile</scope> |
|
338 |
</dependency> |
|
339 |
<dependency> |
|
340 |
<groupId>org.gvsig</groupId> |
|
341 |
<artifactId>org.gvsig.pdf.swing.api</artifactId> |
|
342 |
<version>${org.gvsig.pdf.version}</version> |
|
343 |
<scope>compile</scope> |
|
344 |
</dependency> |
|
345 |
|
|
346 |
</dependencies> |
|
347 |
</dependencyManagement> |
|
348 |
|
|
349 |
<modules> |
|
350 |
<module>${project.artifactId}.lib</module> |
|
351 |
<module>${project.artifactId}.swing</module> |
|
352 |
<module>${project.artifactId}.app</module> |
|
353 |
</modules> |
|
354 |
|
|
355 |
</project> |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/pom.xml | ||
---|---|---|
1 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
2 |
<modelVersion>4.0.0</modelVersion> |
|
3 |
<parent> |
|
4 |
<groupId>org.gvsig</groupId> |
|
5 |
<artifactId>org.gvsig.report</artifactId> |
|
6 |
<version>1.0.166</version> |
|
7 |
</parent> |
|
8 |
<artifactId>org.gvsig.report.app</artifactId> |
|
9 |
<packaging>pom</packaging> |
|
10 |
<name>${project.artifactId}</name> |
|
11 |
<modules> |
|
12 |
<module>${project.artifactId}.mainplugin</module> |
|
13 |
</modules> |
|
14 |
</project> |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/ReportDocumentsManager.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.report.app.mainplugin.document; |
|
25 |
|
|
26 |
import java.awt.event.ActionEvent; |
|
27 |
import java.awt.event.ActionListener; |
|
28 |
import java.util.ArrayList; |
|
29 |
import java.util.Collections; |
|
30 |
import java.util.Iterator; |
|
31 |
import java.util.List; |
|
32 |
import org.gvsig.report.app.mainplugin.document.gui.properties.ReportPropertiesPanel; |
|
33 |
import javax.swing.ImageIcon; |
|
34 |
import javax.swing.event.ChangeEvent; |
|
35 |
|
|
36 |
import org.gvsig.andami.IconThemeHelper; |
|
37 |
import org.gvsig.andami.PluginServices; |
|
38 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
|
39 |
import org.gvsig.app.project.ProjectManager; |
|
40 |
import org.gvsig.app.project.documents.AbstractDocument; |
|
41 |
import org.gvsig.app.project.documents.AbstractDocumentManager; |
|
42 |
import org.gvsig.app.project.documents.Document; |
|
43 |
import org.gvsig.app.project.documents.actions.CopyDocumentAction; |
|
44 |
import org.gvsig.app.project.documents.actions.CutDocumentAction; |
|
45 |
import org.gvsig.app.project.documents.actions.PasteDocumentAction; |
|
46 |
import org.gvsig.app.project.documents.gui.IDocumentWindow; |
|
47 |
import org.gvsig.app.project.documents.gui.WindowLayout; |
|
48 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
|
49 |
import org.gvsig.propertypage.PropertiesPageManager; |
|
50 |
import org.gvsig.report.app.mainplugin.ReportState; |
|
51 |
import org.gvsig.report.app.mainplugin.document.gui.ReportDocumentPanel; |
|
52 |
import org.gvsig.report.app.mainplugin.document.gui.CreateReportPanel; |
|
53 |
import org.gvsig.report.app.mainplugin.document.gui.properties.GeneralDocumentPropertiesPageFactory; |
|
54 |
import org.gvsig.report.app.mainplugin.document.gui.properties.LocationReportPropertiesPageFactory; |
|
55 |
import org.gvsig.report.lib.api.ReportConfig; |
|
56 |
import org.gvsig.report.lib.api.ReportLocator; |
|
57 |
import org.gvsig.report.lib.api.ReportServer; |
|
58 |
import org.gvsig.report.swing.api.ReportSwingLocator; |
|
59 |
import org.gvsig.report.swing.api.ReportSwingManager; |
|
60 |
import org.gvsig.tools.ToolsLocator; |
|
61 |
import org.gvsig.tools.dynobject.DynStruct; |
|
62 |
import org.gvsig.tools.i18n.I18nManager; |
|
63 |
import org.gvsig.tools.persistence.PersistenceManager; |
|
64 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
65 |
import org.gvsig.tools.swing.api.windowmanager.Dialog; |
|
66 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
67 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
|
68 |
import org.gvsig.tools.util.Invocable; |
|
69 |
import org.slf4j.Logger; |
|
70 |
import org.slf4j.LoggerFactory; |
|
71 |
|
|
72 |
public class ReportDocumentsManager extends AbstractDocumentManager { |
|
73 |
|
|
74 |
private static final Logger LOGGER = LoggerFactory.getLogger(ReportDocumentsManager.class); |
|
75 |
|
|
76 |
private static final String PERSISTENCE_REPORT_DOCUMENT_DEFINITION_NAME |
|
77 |
= "DefaultReportDocument"; |
|
78 |
public static String TYPENAME = "project.document.report"; |
|
79 |
private DynStruct persistenceDefinition; |
|
80 |
|
|
81 |
public ReportDocumentsManager() { |
|
82 |
// Do nothing |
|
83 |
} |
|
84 |
|
|
85 |
@Override |
|
86 |
public int getPriority() { |
|
87 |
return 100; |
|
88 |
} |
|
89 |
|
|
90 |
@Override |
|
91 |
public ImageIcon getIcon() { |
|
92 |
return PluginServices.getIconTheme().get("document-report-icon"); |
|
93 |
} |
|
94 |
|
|
95 |
@Override |
|
96 |
public ImageIcon getIconSelected() { |
|
97 |
return PluginServices.getIconTheme().get("document-report-icon-sel"); |
|
98 |
} |
|
99 |
|
|
100 |
@Override |
|
101 |
public String getTitle() { |
|
102 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
103 |
return i18n.getTranslation("_Report"); |
|
104 |
} |
|
105 |
|
|
106 |
@Override |
|
107 |
public String getTypeName() { |
|
108 |
return TYPENAME; |
|
109 |
} |
|
110 |
|
|
111 |
@Override |
|
112 |
public Class getMainWindowClass() { |
|
113 |
return ReportDocumentPanel.class; |
|
114 |
} |
|
115 |
|
|
116 |
|
|
117 |
private ReportServer getServer() { |
|
118 |
return ReportState.get().getServer(); |
|
119 |
} |
|
120 |
|
|
121 |
@Override |
|
122 |
public AbstractDocument createDocument() { |
|
123 |
org.gvsig.report.lib.api.ReportManager reportManager = ReportLocator.getReportManager(); |
|
124 |
ReportConfig reportConfig = reportManager.createReportConfig(); |
|
125 |
AbstractDocument doc = new ReportDocumentImpl(this, reportConfig); |
|
126 |
|
|
127 |
if (this.notifyObservers(NOTIFY_AFTER_CREATEDOCUMENT, doc).isCanceled()) { |
|
128 |
return null; |
|
129 |
} |
|
130 |
return doc; |
|
131 |
|
|
132 |
} |
|
133 |
|
|
134 |
@Override |
|
135 |
public AbstractDocument createDocumentByUser() { |
|
136 |
return (AbstractDocument) createDocumentsByUser().next(); |
|
137 |
} |
|
138 |
|
|
139 |
@Override |
|
140 |
public Iterator<? extends Document> createDocumentsByUser() { |
|
141 |
return this.createDocumentsByUser(null); |
|
142 |
} |
|
143 |
|
|
144 |
@Override |
|
145 |
public Iterator<? extends Document> createDocumentsByUser(Invocable whenDocumentsLoaded) { |
|
146 |
final I18nManager i18n = ToolsLocator.getI18nManager(); |
|
147 |
final WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
|
148 |
// final ReportSwingManager reportSwingManager = ReportSwingLocator.getReportSwingManager(); |
|
149 |
|
|
150 |
final CreateReportPanel panel = new CreateReportPanel(this.getServer()); |
|
151 |
final Dialog dialog = winManager.createDialog( |
|
152 |
panel.asJComponent(), |
|
153 |
i18n.getTranslation("_Create_report_document"), |
|
154 |
null, |
|
155 |
WindowManager_v2.BUTTONS_OK_CANCEL |
|
156 |
); |
|
157 |
dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
|
158 |
panel.addChangeListener((ChangeEvent e) -> { |
|
159 |
if (panel.isOkAvailable()) { |
|
160 |
dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, true); |
|
161 |
} else { |
|
162 |
dialog.setButtonEnabled(WindowManager_v2.BUTTON_OK, false); |
|
163 |
} |
|
164 |
}); |
|
165 |
dialog.show(WindowManager.MODE.DIALOG); |
|
166 |
if (dialog.getAction() != WindowManager_v2.BUTTON_OK) { |
|
167 |
return Collections.EMPTY_LIST.iterator(); |
|
168 |
} |
|
169 |
|
|
170 |
ReportConfig report = panel.getReportConfig(); |
|
171 |
ReportDocumentImpl doc = new ReportDocumentImpl(this, report); |
|
172 |
doc.setOpenWhenTheUserCreates(panel.getOpenDocument()); |
|
173 |
|
|
174 |
List<ReportDocument> r = new ArrayList<>(); |
|
175 |
r.add(doc); |
|
176 |
|
|
177 |
return r.iterator(); |
|
178 |
} |
|
179 |
|
|
180 |
@Override |
|
181 |
public IWindow getMainWindow(Document doc, WindowLayout layout) { |
|
182 |
IDocumentWindow win = (IDocumentWindow) super.getMainWindow(doc, layout); |
|
183 |
if (win == null) { |
|
184 |
win = this.createDocumentWindow(doc); |
|
185 |
if (layout != null && win != null) { |
|
186 |
win.setWindowLayout(layout); |
|
187 |
} |
|
188 |
if (this.notifyObservers(NOTIFY_AFTER_CREATEMAINWINDOW, win).isCanceled()) { |
|
189 |
return null; |
|
190 |
} |
|
191 |
} |
|
192 |
if (this.notifyObservers(NOTIFY_AFTER_GETMAINWINDOW, win).isCanceled()) { |
|
193 |
return null; |
|
194 |
} |
|
195 |
((AbstractDocument) doc).raiseEventCreateWindow(win); |
|
196 |
return win; |
|
197 |
} |
|
198 |
|
|
199 |
@Override |
|
200 |
public IWindow getPropertiesWindow(Document doc) { |
|
201 |
IWindow win = super.getPropertiesWindow(doc); |
|
202 |
if (win == null) { |
|
203 |
win = new ReportPropertiesPanel((ReportDocument) doc); |
|
204 |
if (this.notifyObservers(NOTIFY_AFTER_CREATEPROPERTIESWINDOW, win).isCanceled()) { |
|
205 |
return null; |
|
206 |
} |
|
207 |
} |
|
208 |
if (this.notifyObservers(NOTIFY_AFTER_GETPROPERTIESWINDOW, win).isCanceled()) { |
|
209 |
return null; |
|
210 |
} |
|
211 |
return win; |
|
212 |
} |
|
213 |
|
|
214 |
public void selfRegister() { |
|
215 |
if (this.persistenceDefinition != null) { |
|
216 |
return; |
|
217 |
} |
|
218 |
ProjectManager projectManager = ProjectManager.getInstance(); |
|
219 |
|
|
220 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
|
221 |
this.persistenceDefinition = persistenceManager.addDefinition( |
|
222 |
ReportDocument.class, |
|
223 |
PERSISTENCE_REPORT_DOCUMENT_DEFINITION_NAME, |
|
224 |
"Default report document persistence definition", |
|
225 |
null, |
|
226 |
null |
|
227 |
); |
|
228 |
this.persistenceDefinition.extend(persistenceManager.getDefinition(AbstractDocument.PERSISTENCE_DEFINITION_NAME)); |
|
229 |
|
|
230 |
this.persistenceDefinition.addDynFieldString("report_datasetName").setMandatory(true); |
|
231 |
this.persistenceDefinition.addDynFieldFile("report_file").setMandatory(true); |
|
232 |
|
|
233 |
persistenceManager.registerFactory(this); |
|
234 |
|
|
235 |
IconThemeHelper.registerIcon("document", "document-report-icon", ReportDocumentsManager.class); |
|
236 |
IconThemeHelper.registerIcon("document", "document-report-icon-sel", ReportDocumentsManager.class); |
|
237 |
|
|
238 |
projectManager.registerDocumentFactory(this); |
|
239 |
projectManager.registerDocumentAction(TYPENAME, new CopyDocumentAction()); |
|
240 |
projectManager.registerDocumentAction(TYPENAME, new CutDocumentAction()); |
|
241 |
projectManager.registerDocumentAction(TYPENAME, new PasteDocumentAction()); |
|
242 |
|
|
243 |
PropertiesPageManager propertiesPageManager = MapControlLocator.getPropertiesPageManager(); |
|
244 |
propertiesPageManager.registerFactory(new GeneralDocumentPropertiesPageFactory( |
|
245 |
ReportDocument.REPORT_PROPERTIES_PAGE_GROUP, |
|
246 |
"General" |
|
247 |
) |
|
248 |
); |
|
249 |
|
|
250 |
propertiesPageManager.registerFactory(new LocationReportPropertiesPageFactory()); |
|
251 |
} |
|
252 |
|
|
253 |
@SuppressWarnings("rawtypes") |
|
254 |
@Override |
|
255 |
public DynStruct getDefinition(String className) { |
|
256 |
|
|
257 |
if (this.persistenceDefinition.getName().equalsIgnoreCase(className)) { |
|
258 |
return this.persistenceDefinition; |
|
259 |
} |
|
260 |
if (this.persistenceDefinition.getFullName().equalsIgnoreCase(className)) { |
|
261 |
return this.persistenceDefinition; |
|
262 |
} |
|
263 |
if (this.getDocumentClass().getName().equals(className)) { |
|
264 |
return this.persistenceDefinition; |
|
265 |
} |
|
266 |
|
|
267 |
return null; |
|
268 |
} |
|
269 |
|
|
270 |
@SuppressWarnings("rawtypes") |
|
271 |
@Override |
|
272 |
protected Class getDocumentClass() { |
|
273 |
return ReportDocumentImpl.class; |
|
274 |
} |
|
275 |
|
|
276 |
@Override |
|
277 |
public boolean manages(Object object) { |
|
278 |
return object instanceof ReportDocument; |
|
279 |
} |
|
280 |
} |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/ReportDocument.java | ||
---|---|---|
1 |
/** |
|
2 |
* gvSIG. Desktop Geographic Information System. |
|
3 |
* |
|
4 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
5 |
* |
|
6 |
* This program is free software; you can redistribute it and/or |
|
7 |
* modify it under the terms of the GNU General Public License |
|
8 |
* as published by the Free Software Foundation; either version 3 |
|
9 |
* of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, |
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 |
* GNU General Public License for more details. |
|
15 |
* |
|
16 |
* You should have received a copy of the GNU General Public License |
|
17 |
* along with this program; if not, write to the Free Software |
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19 |
* MA 02110-1301, USA. |
|
20 |
* |
|
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
23 |
*/ |
|
24 |
package org.gvsig.report.app.mainplugin.document; |
|
25 |
|
|
26 |
import java.beans.PropertyChangeListener; |
|
27 |
|
|
28 |
import org.gvsig.app.project.Project; |
|
29 |
import org.gvsig.app.project.documents.Document; |
|
30 |
import org.gvsig.report.lib.api.Report; |
|
31 |
import org.gvsig.report.lib.api.ReportConfig; |
|
32 |
import org.gvsig.tools.util.PropertiesSupport; |
|
33 |
|
|
34 |
public interface ReportDocument extends Document, PropertiesSupport { |
|
35 |
|
|
36 |
public static final String REPORT_PROPERTIES_PAGE_GROUP = "ReportDocument"; |
|
37 |
|
|
38 |
public Report getReport(); |
|
39 |
|
|
40 |
public ReportConfig getReportConfig(); |
|
41 |
|
|
42 |
@Override |
|
43 |
public String getName(); |
|
44 |
|
|
45 |
@Override |
|
46 |
public Project getProject(); |
|
47 |
|
|
48 |
@Override |
|
49 |
public void addPropertyChangeListener(PropertyChangeListener listener); |
|
50 |
|
|
51 |
} |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/ReportDocumentImpl.java | ||
---|---|---|
1 |
package org.gvsig.report.app.mainplugin.document; |
|
2 |
|
|
3 |
import java.io.ByteArrayInputStream; |
|
4 |
import java.util.Map; |
|
5 |
import javax.json.Json; |
|
6 |
import javax.json.JsonReader; |
|
7 |
import org.gvsig.app.project.documents.AbstractDocument; |
|
8 |
import org.gvsig.report.lib.api.Report; |
|
9 |
import org.gvsig.report.lib.api.ReportConfig; |
|
10 |
import org.gvsig.report.lib.api.ReportLocator; |
|
11 |
import org.gvsig.tools.persistence.PersistentState; |
|
12 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
13 |
import org.gvsig.tools.util.PropertiesSupport; |
|
14 |
|
|
15 |
/** |
|
16 |
* |
|
17 |
* @author jjdelcerro |
|
18 |
*/ |
|
19 |
public class ReportDocumentImpl |
|
20 |
extends AbstractDocument |
|
21 |
implements ReportDocument { |
|
22 |
|
|
23 |
private PropertiesSupport propertiesSupport; |
|
24 |
private ReportConfig reportConfig; |
|
25 |
private boolean openWhenTheUserCreates; |
|
26 |
|
|
27 |
public ReportDocumentImpl() { |
|
28 |
} |
|
29 |
|
|
30 |
public ReportDocumentImpl(ReportDocumentsManager reportManager, ReportConfig reportConfig) { |
|
31 |
super(reportManager); |
|
32 |
this.reportConfig = reportConfig; |
|
33 |
this.setName(reportConfig.getName()); |
|
34 |
} |
|
35 |
|
|
36 |
@Override |
|
37 |
public ReportConfig getReportConfig() { |
|
38 |
return this.reportConfig; |
|
39 |
} |
|
40 |
|
|
41 |
@Override |
|
42 |
public Report getReport() { |
|
43 |
return this.reportConfig.createReport(); |
|
44 |
} |
|
45 |
|
|
46 |
@Override |
|
47 |
public Object getProperty(String string) { |
|
48 |
return this.propertiesSupport.getProperty(string); |
|
49 |
} |
|
50 |
|
|
51 |
@Override |
|
52 |
public void setProperty(String string, Object o) { |
|
53 |
this.propertiesSupport.setProperty(string, o); |
|
54 |
} |
|
55 |
|
|
56 |
@Override |
|
57 |
public Map<String, Object> getProperties() { |
|
58 |
return this.propertiesSupport.getProperties(); |
|
59 |
} |
|
60 |
|
|
61 |
@Override |
|
62 |
public void saveToState(PersistentState state) throws PersistenceException { |
|
63 |
state.set("report_config", this.reportConfig.toJSON().toString()); |
|
64 |
} |
|
65 |
|
|
66 |
@Override |
|
67 |
public void loadFromState(PersistentState state) throws PersistenceException { |
|
68 |
|
|
69 |
String config_json = state.getString("report_config"); |
|
70 |
|
|
71 |
try (JsonReader reader = Json.createReader(new ByteArrayInputStream(config_json.getBytes()))) { |
|
72 |
org.gvsig.report.lib.api.ReportManager manager = ReportLocator.getReportManager(); |
|
73 |
this.reportConfig = manager.createReportConfig(); |
|
74 |
this.reportConfig.fromJSON(reader.readObject()); |
|
75 |
} |
|
76 |
} |
|
77 |
|
|
78 |
void setOpenWhenTheUserCreates(boolean openDocument) { |
|
79 |
this.openWhenTheUserCreates = openDocument; |
|
80 |
} |
|
81 |
|
|
82 |
@Override |
|
83 |
public boolean getOpenWhenTheUserCreates() { |
|
84 |
return this.openWhenTheUserCreates; |
|
85 |
} |
|
86 |
|
|
87 |
} |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/gui/CreateReportPanel.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.report.app.mainplugin.document.gui; |
|
3 |
|
|
4 |
import java.awt.Dimension; |
|
5 |
import java.awt.event.ItemEvent; |
|
6 |
import java.awt.event.ItemListener; |
|
7 |
import java.io.File; |
|
8 |
import javax.swing.DefaultComboBoxModel; |
|
9 |
import javax.swing.JComponent; |
|
10 |
import javax.swing.event.ChangeListener; |
|
11 |
import javax.swing.event.DocumentEvent; |
|
12 |
import javax.swing.event.DocumentListener; |
|
13 |
import javax.swing.filechooser.FileFilter; |
|
14 |
import org.apache.commons.lang3.StringUtils; |
|
15 |
import org.gvsig.report.lib.api.ReportConfig; |
|
16 |
import org.gvsig.report.lib.api.ReportDataSet; |
|
17 |
import org.gvsig.report.lib.api.ReportLocator; |
|
18 |
import org.gvsig.report.lib.api.ReportManager; |
|
19 |
import org.gvsig.report.lib.api.ReportServer; |
|
20 |
import org.gvsig.report.lib.api.ReportServerConfig; |
|
21 |
import org.gvsig.tools.resourcesstorage.FilesResourcesStorage; |
|
22 |
import org.gvsig.tools.swing.api.ChangeListenerHelper; |
|
23 |
import org.gvsig.tools.swing.api.ChangeListenerSupport; |
|
24 |
import org.gvsig.tools.swing.api.Component; |
|
25 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
26 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
27 |
import org.gvsig.tools.swing.api.pickercontroller.FilePickerController; |
|
28 |
|
|
29 |
/** |
|
30 |
* |
|
31 |
* @author jjdelcerro |
|
32 |
*/ |
|
33 |
public class CreateReportPanel extends CreateReportPanelView implements Component, ChangeListenerSupport { |
|
34 |
|
|
35 |
private final FilePickerController reportFileController; |
|
36 |
private final ReportServer server; |
|
37 |
private ChangeListenerHelper changeListenerHelper; |
|
38 |
|
|
39 |
public CreateReportPanel(ReportServer server) { |
|
40 |
this.reportFileController = ToolsSwingLocator.getToolsSwingManager().createFilePickerController( |
|
41 |
txtReportFile, |
|
42 |
btnReportFile |
|
43 |
); |
|
44 |
this.server = server; |
|
45 |
|
|
46 |
this.initComponents(); |
|
47 |
} |
|
48 |
|
|
49 |
public boolean isOkAvailable() { |
|
50 |
if(!StringUtils.isBlank(this.txtReportFile.getText()) |
|
51 |
&& this.cboDataSet.getModel().getSelectedItem()!=null) { |
|
52 |
return true; |
|
53 |
} |
|
54 |
return false; |
|
55 |
} |
|
56 |
|
|
57 |
private void initComponents() { |
|
58 |
ReportServerConfig config = this.server.getConfig(); |
|
59 |
ToolsSwingManager swingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
60 |
this.changeListenerHelper = swingManager.createChangeListenerHelper(); |
|
61 |
|
|
62 |
DefaultComboBoxModel model1 = new DefaultComboBoxModel(); |
|
63 |
if (config.getDatasets() != null) { |
|
64 |
for (ReportDataSet dataset : config.getDatasets()) { |
|
65 |
model1.addElement(dataset.getName()); |
|
66 |
} |
|
67 |
} |
|
68 |
this.cboDataSet.setModel(model1); |
|
69 |
|
|
70 |
FileFilter filter = new FileFilter() { |
|
71 |
@Override |
|
72 |
public boolean accept(File f) { |
|
73 |
if (f.getName().toLowerCase().endsWith(".jrxml")) { |
|
74 |
return true; |
|
75 |
} |
|
76 |
if (f.getName().toLowerCase().endsWith(".jasper")) { |
|
77 |
return true; |
|
78 |
} |
|
79 |
return f.isDirectory(); |
|
80 |
} |
|
81 |
|
|
82 |
@Override |
|
83 |
public String getDescription() { |
|
84 |
return "Report (.jrxml|.jasper)"; |
|
85 |
} |
|
86 |
}; |
|
87 |
this.reportFileController.setFileFilter(filter); |
|
88 |
|
|
89 |
Dimension dimension = this.getPreferredSize(); |
|
90 |
// if( dimension.height<100 ) { |
|
91 |
// dimension.height = 100; |
|
92 |
// } |
|
93 |
if( dimension.width<400 ) { |
|
94 |
dimension.width = 400; |
|
95 |
} |
|
96 |
this.setPreferredSize(dimension); |
|
97 |
this.cboDataSet.addItemListener(new ItemListener() { |
|
98 |
@Override |
|
99 |
public void itemStateChanged(ItemEvent e) { |
|
100 |
doDataSetModified(); |
|
101 |
} |
|
102 |
}); |
|
103 |
this.txtReportFile.getDocument().addDocumentListener(new DocumentListener() { |
|
104 |
@Override |
|
105 |
public void insertUpdate(DocumentEvent e) { |
|
106 |
doReportFileModified(); |
|
107 |
} |
|
108 |
|
|
109 |
@Override |
|
110 |
public void removeUpdate(DocumentEvent e) { |
|
111 |
doReportFileModified(); |
|
112 |
} |
|
113 |
|
|
114 |
@Override |
|
115 |
public void changedUpdate(DocumentEvent e) { |
|
116 |
doReportFileModified(); |
|
117 |
} |
|
118 |
}); |
|
119 |
this.changeListenerHelper.fireEvent(); |
|
120 |
} |
|
121 |
|
|
122 |
private void doDataSetModified() { |
|
123 |
this.changeListenerHelper.fireEvent(); |
|
124 |
} |
|
125 |
|
|
126 |
private void doReportFileModified() { |
|
127 |
this.changeListenerHelper.fireEvent(); |
|
128 |
} |
|
129 |
|
|
130 |
public ReportConfig getReportConfig() { |
|
131 |
ReportManager manager = ReportLocator.getReportManager(); |
|
132 |
String datasetName = (String) this.cboDataSet.getSelectedItem(); |
|
133 |
if( StringUtils.isEmpty(datasetName) ) { |
|
134 |
return null; |
|
135 |
} |
|
136 |
ReportDataSet dataset = this.server.getConfig().getDataset(datasetName); |
|
137 |
if( dataset == null ) { |
|
138 |
return null; |
|
139 |
} |
|
140 |
File f = this.reportFileController.get(); |
|
141 |
ReportConfig config = manager.createReportConfig(); |
|
142 |
config.setDataSetName(datasetName); |
|
143 |
config.setReportResourcesStorage(new FilesResourcesStorage(f.getParent())); |
|
144 |
config.setReportTemplate(f.getName()); |
|
145 |
return config; |
|
146 |
} |
|
147 |
|
|
148 |
public boolean getOpenDocument() { |
|
149 |
return this.chkOpenDocument.isSelected(); |
|
150 |
} |
|
151 |
|
|
152 |
@Override |
|
153 |
public JComponent asJComponent() { |
|
154 |
return this; |
|
155 |
} |
|
156 |
|
|
157 |
@Override |
|
158 |
public void addChangeListener(ChangeListener listener) { |
|
159 |
this.changeListenerHelper.addChangeListener(listener); |
|
160 |
} |
|
161 |
|
|
162 |
@Override |
|
163 |
public ChangeListener[] getChangeListeners() { |
|
164 |
return this.changeListenerHelper.getChangeListeners(); |
|
165 |
} |
|
166 |
|
|
167 |
@Override |
|
168 |
public void removeChangeListener(ChangeListener listener) { |
|
169 |
this.changeListenerHelper.removeChangeListener(listener); |
|
170 |
} |
|
171 |
|
|
172 |
@Override |
|
173 |
public void removeAllChangeListener() { |
|
174 |
this.changeListenerHelper.removeAllChangeListener(); |
|
175 |
} |
|
176 |
|
|
177 |
@Override |
|
178 |
public boolean hasChangeListeners() { |
|
179 |
return this.changeListenerHelper.hasChangeListeners(); |
|
180 |
} |
|
181 |
} |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/gui/projectpanel/ProjectReportPanelPageFactory.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.report.app.mainplugin.document.gui.projectpanel; |
|
3 |
|
|
4 |
import org.gvsig.app.project.Project; |
|
5 |
import org.gvsig.propertypage.PropertiesPage; |
|
6 |
import org.gvsig.propertypage.PropertiesPageFactory; |
|
7 |
|
|
8 |
public class ProjectReportPanelPageFactory implements PropertiesPageFactory { |
|
9 |
|
|
10 |
@Override |
|
11 |
public String getGroupID() { |
|
12 |
return Project.PROJECT_PANEL_PAGE_GROUP; |
|
13 |
} |
|
14 |
|
|
15 |
@Override |
|
16 |
public String getName() { |
|
17 |
return "Report"; |
|
18 |
} |
|
19 |
|
|
20 |
@Override |
|
21 |
public boolean isVisible(Object obj) { |
|
22 |
// Always if enabled this page |
|
23 |
return true; |
|
24 |
} |
|
25 |
|
|
26 |
@Override |
|
27 |
public PropertiesPage create(Object container, Object data) { |
|
28 |
return new ProjectReportPanelPage(); |
|
29 |
} |
|
30 |
|
|
31 |
} |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/gui/projectpanel/ProjectReportPanelPage.java | ||
---|---|---|
1 |
package org.gvsig.report.app.mainplugin.document.gui.projectpanel; |
|
2 |
|
|
3 |
import javax.swing.JComponent; |
|
4 |
import org.gvsig.app.project.Project; |
|
5 |
import org.gvsig.app.project.documents.gui.projectpanel.ProjectPanelPage; |
|
6 |
import org.gvsig.report.app.mainplugin.ReportState; |
|
7 |
import org.gvsig.report.swing.api.JReportServer; |
|
8 |
import org.gvsig.tools.ToolsLocator; |
|
9 |
import org.gvsig.tools.i18n.I18nManager; |
|
10 |
import org.slf4j.Logger; |
|
11 |
import org.slf4j.LoggerFactory; |
|
12 |
|
|
13 |
public class ProjectReportPanelPage |
|
14 |
implements ProjectPanelPage { |
|
15 |
|
|
16 |
private final Logger LOG = LoggerFactory.getLogger(ProjectReportPanelPage.class); |
|
17 |
|
|
18 |
private Project project; |
|
19 |
private JReportServer serverPanel = null; |
|
20 |
|
|
21 |
public ProjectReportPanelPage() { |
|
22 |
this.project = null; |
|
23 |
this.initComponents(); |
|
24 |
} |
|
25 |
|
|
26 |
@Override |
|
27 |
public void setData(Object data) { |
|
28 |
|
|
29 |
} |
|
30 |
|
|
31 |
@Override |
|
32 |
public String getTitle() { |
|
33 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
34 |
return i18n.getTranslation("_Reports"); |
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
public int getPriority() { |
|
39 |
return 500; |
|
40 |
} |
|
41 |
|
|
42 |
@Override |
|
43 |
public boolean whenAccept() { |
|
44 |
return true; |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
public boolean whenApply() { |
|
49 |
return true; |
|
50 |
} |
|
51 |
|
|
52 |
@Override |
|
53 |
public boolean whenCancel() { |
|
54 |
return true; |
|
55 |
} |
|
56 |
|
|
57 |
@Override |
|
58 |
public JComponent asJComponent() { |
|
59 |
if( this.serverPanel == null ) { |
|
60 |
this.serverPanel = ReportState.get().getServerPanel(); |
|
61 |
} |
|
62 |
return this.serverPanel.asJComponent(); |
|
63 |
} |
|
64 |
|
|
65 |
private void initComponents() { |
|
66 |
|
|
67 |
} |
|
68 |
|
|
69 |
@Override |
|
70 |
public void setProject(Project project) { |
|
71 |
} |
|
72 |
|
|
73 |
} |
org.gvsig.report/tags/org.gvsig.report-1.0.166/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/gui/CreateReportPanelView.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<object classname="com.jeta.forms.store.memento.FormPackage"> |
|
4 |
<at name="fileversion"> |
|
5 |
<object classname="com.jeta.forms.store.memento.FormsVersion2"> |
|
6 |
<at name="major">2</at> |
|
7 |
<at name="minor">0</at> |
|
8 |
<at name="sub">0</at> |
|
9 |
</object> |
|
10 |
</at> |
|
11 |
<at name="form"> |
|
12 |
<object classname="com.jeta.forms.store.memento.FormMemento"> |
|
13 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
14 |
<at name="cellconstraints"> |
|
15 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
16 |
<at name="column">1</at> |
|
17 |
<at name="row">1</at> |
|
18 |
<at name="colspan">1</at> |
|
19 |
<at name="rowspan">1</at> |
|
20 |
<at name="halign">default</at> |
|
21 |
<at name="valign">default</at> |
|
22 |
<at name="insets" object="insets">0,0,0,0</at> |
|
23 |
</object> |
|
24 |
</at> |
|
25 |
<at name="componentclass">com.jeta.forms.gui.form.FormComponent</at> |
|
26 |
</super> |
|
27 |
<at name="id">/home/jjdelcerro/datos/devel/org.gvsig.report/org.gvsig.report.app/org.gvsig.report.app.mainplugin/src/main/java/org/gvsig/report/app/mainplugin/document/gui/CreateReportPanelView.xml</at> |
|
28 |
<at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE</at> |
|
29 |
<at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE</at> |
|
30 |
<at name="components"> |
|
31 |
<object classname="java.util.LinkedList"> |
|
32 |
<item > |
|
33 |
<at name="value"> |
|
34 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
35 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
36 |
<at name="cellconstraints"> |
|
37 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
38 |
<at name="column">2</at> |
|
39 |
<at name="row">2</at> |
|
40 |
<at name="colspan">1</at> |
|
41 |
<at name="rowspan">1</at> |
|
42 |
<at name="halign">default</at> |
|
43 |
<at name="valign">default</at> |
|
44 |
<at name="insets" object="insets">0,0,0,0</at> |
|
45 |
</object> |
|
46 |
</at> |
|
47 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
48 |
</super> |
|
49 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
50 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
51 |
<at name="beanproperties"> |
|
52 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
53 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
54 |
<at name="properties"> |
|
55 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
56 |
<at name="border"> |
|
57 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
58 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
59 |
<at name="name">border</at> |
|
60 |
</super> |
|
61 |
<at name="borders"> |
|
62 |
<object classname="java.util.LinkedList"> |
|
63 |
<item > |
|
64 |
<at name="value"> |
|
65 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
66 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
67 |
<at name="name">border</at> |
|
68 |
</super> |
|
69 |
</object> |
|
70 |
</at> |
|
71 |
</item> |
|
72 |
</object> |
|
73 |
</at> |
|
74 |
</object> |
|
75 |
</at> |
|
76 |
<at name="name">lblReportFile</at> |
|
77 |
<at name="width">58</at> |
|
78 |
<at name="text">Report file</at> |
|
79 |
<at name="fill"> |
|
80 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
81 |
<at name="name">fill</at> |
|
82 |
</object> |
|
83 |
</at> |
|
84 |
<at name="height">14</at> |
|
85 |
</object> |
|
86 |
</at> |
|
87 |
</object> |
|
88 |
</at> |
|
89 |
</object> |
|
90 |
</at> |
|
91 |
</item> |
|
92 |
<item > |
|
93 |
<at name="value"> |
|
94 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
95 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
96 |
<at name="cellconstraints"> |
|
97 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
98 |
<at name="column">2</at> |
|
99 |
<at name="row">4</at> |
|
100 |
<at name="colspan">1</at> |
|
101 |
<at name="rowspan">1</at> |
|
102 |
<at name="halign">default</at> |
|
103 |
<at name="valign">default</at> |
|
104 |
<at name="insets" object="insets">0,0,0,0</at> |
|
105 |
</object> |
|
106 |
</at> |
|
107 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
108 |
</super> |
|
109 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
110 |
<at name="beanclass">com.jeta.forms.components.label.JETALabel</at> |
|
111 |
<at name="beanproperties"> |
|
112 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
113 |
<at name="classname">com.jeta.forms.components.label.JETALabel</at> |
|
114 |
<at name="properties"> |
|
115 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
116 |
<at name="border"> |
|
117 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
118 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
119 |
<at name="name">border</at> |
|
120 |
</super> |
|
121 |
<at name="borders"> |
|
122 |
<object classname="java.util.LinkedList"> |
|
123 |
<item > |
|
124 |
<at name="value"> |
|
125 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
126 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
127 |
<at name="name">border</at> |
|
128 |
</super> |
|
129 |
</object> |
|
130 |
</at> |
|
131 |
</item> |
|
132 |
</object> |
|
133 |
</at> |
|
134 |
</object> |
|
135 |
</at> |
|
136 |
<at name="name">lblDataSet</at> |
|
137 |
<at name="width">58</at> |
|
138 |
<at name="text">Data set</at> |
|
139 |
<at name="fill"> |
|
140 |
<object classname="com.jeta.forms.store.properties.effects.PaintProperty"> |
|
141 |
<at name="name">fill</at> |
|
142 |
</object> |
|
143 |
</at> |
|
144 |
<at name="height">14</at> |
|
145 |
</object> |
|
146 |
</at> |
|
147 |
</object> |
|
148 |
</at> |
|
149 |
</object> |
|
150 |
</at> |
|
151 |
</item> |
|
152 |
<item > |
|
153 |
<at name="value"> |
|
154 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
155 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
156 |
<at name="cellconstraints"> |
|
157 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
158 |
<at name="column">4</at> |
|
159 |
<at name="row">2</at> |
|
160 |
<at name="colspan">1</at> |
|
161 |
<at name="rowspan">1</at> |
|
162 |
<at name="halign">default</at> |
|
163 |
<at name="valign">default</at> |
|
164 |
<at name="insets" object="insets">0,0,0,0</at> |
|
165 |
</object> |
|
166 |
</at> |
|
167 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
168 |
</super> |
|
169 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
170 |
<at name="beanclass">javax.swing.JTextField</at> |
|
171 |
<at name="beanproperties"> |
|
172 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
173 |
<at name="classname">javax.swing.JTextField</at> |
|
174 |
<at name="properties"> |
|
175 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
176 |
<at name="border"> |
|
177 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
178 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
179 |
<at name="name">border</at> |
|
180 |
</super> |
|
181 |
<at name="borders"> |
|
182 |
<object classname="java.util.LinkedList"> |
|
183 |
<item > |
|
184 |
<at name="value"> |
|
185 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
186 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
187 |
<at name="name">border</at> |
|
188 |
</super> |
|
189 |
</object> |
|
190 |
</at> |
|
191 |
</item> |
|
192 |
</object> |
|
193 |
</at> |
|
194 |
</object> |
|
195 |
</at> |
|
196 |
<at name="name">txtReportFile</at> |
|
197 |
<at name="width">673</at> |
|
198 |
<at name="height">20</at> |
|
199 |
</object> |
|
200 |
</at> |
|
201 |
</object> |
|
202 |
</at> |
|
203 |
</object> |
|
204 |
</at> |
|
205 |
</item> |
|
206 |
<item > |
|
207 |
<at name="value"> |
|
208 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
209 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
210 |
<at name="cellconstraints"> |
|
211 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
212 |
<at name="column">6</at> |
|
213 |
<at name="row">2</at> |
|
214 |
<at name="colspan">1</at> |
|
215 |
<at name="rowspan">1</at> |
|
216 |
<at name="halign">default</at> |
|
217 |
<at name="valign">default</at> |
|
218 |
<at name="insets" object="insets">0,0,0,0</at> |
|
219 |
</object> |
|
220 |
</at> |
|
221 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
222 |
</super> |
|
223 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
224 |
<at name="beanclass">javax.swing.JButton</at> |
|
225 |
<at name="beanproperties"> |
|
226 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
227 |
<at name="classname">javax.swing.JButton</at> |
|
228 |
<at name="properties"> |
|
229 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
230 |
<at name="border"> |
|
231 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
232 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
233 |
<at name="name">border</at> |
|
234 |
</super> |
|
235 |
<at name="borders"> |
|
236 |
<object classname="java.util.LinkedList"> |
|
237 |
<item > |
|
238 |
<at name="value"> |
|
239 |
<object classname="com.jeta.forms.store.properties.EmptyBorderProperty"> |
|
240 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
241 |
<at name="name">border</at> |
|
242 |
</super> |
|
243 |
<at name="top">2</at> |
|
244 |
<at name="left">2</at> |
|
245 |
<at name="bottom">2</at> |
|
246 |
<at name="right">2</at> |
|
247 |
</object> |
|
248 |
</at> |
|
249 |
</item> |
|
250 |
</object> |
|
251 |
</at> |
|
252 |
</object> |
|
253 |
</at> |
|
254 |
<at name="actionCommand">...</at> |
|
255 |
<at name="name">btnReportFile</at> |
|
256 |
<at name="width">16</at> |
|
257 |
<at name="text">...</at> |
|
258 |
<at name="height">18</at> |
|
259 |
</object> |
|
260 |
</at> |
|
261 |
</object> |
|
262 |
</at> |
|
263 |
</object> |
|
264 |
</at> |
|
265 |
</item> |
|
266 |
<item > |
|
267 |
<at name="value"> |
|
268 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
269 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
270 |
<at name="cellconstraints"> |
|
271 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
272 |
<at name="column">4</at> |
|
273 |
<at name="row">4</at> |
|
274 |
<at name="colspan">3</at> |
|
275 |
<at name="rowspan">1</at> |
|
276 |
<at name="halign">default</at> |
|
277 |
<at name="valign">default</at> |
|
278 |
<at name="insets" object="insets">0,0,0,0</at> |
|
279 |
</object> |
|
280 |
</at> |
|
281 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
282 |
</super> |
|
283 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
284 |
<at name="beanclass">javax.swing.JComboBox</at> |
|
285 |
<at name="beanproperties"> |
|
286 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
287 |
<at name="classname">javax.swing.JComboBox</at> |
|
288 |
<at name="properties"> |
|
289 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
290 |
<at name="border"> |
|
291 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
292 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
293 |
<at name="name">border</at> |
|
294 |
</super> |
|
295 |
<at name="borders"> |
|
296 |
<object classname="java.util.LinkedList"> |
|
297 |
<item > |
|
298 |
<at name="value"> |
|
299 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
300 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
301 |
<at name="name">border</at> |
|
302 |
</super> |
|
303 |
</object> |
|
304 |
</at> |
|
305 |
</item> |
|
306 |
</object> |
|
307 |
</at> |
|
308 |
</object> |
|
309 |
</at> |
|
310 |
<at name="name">cboDataSet</at> |
|
311 |
<at name="width">709</at> |
|
312 |
<at name="items"> |
|
313 |
<object classname="com.jeta.forms.store.properties.ItemsProperty"> |
|
314 |
<at name="name">items</at> |
|
315 |
</object> |
|
316 |
</at> |
|
317 |
<at name="height">20</at> |
|
318 |
</object> |
|
319 |
</at> |
|
320 |
</object> |
|
321 |
</at> |
|
322 |
</object> |
|
323 |
</at> |
|
324 |
</item> |
|
325 |
<item > |
|
326 |
<at name="value"> |
|
327 |
<object classname="com.jeta.forms.store.memento.BeanMemento"> |
|
328 |
<super classname="com.jeta.forms.store.memento.ComponentMemento"> |
|
329 |
<at name="cellconstraints"> |
|
330 |
<object classname="com.jeta.forms.store.memento.CellConstraintsMemento"> |
|
331 |
<at name="column">4</at> |
|
332 |
<at name="row">6</at> |
|
333 |
<at name="colspan">3</at> |
|
334 |
<at name="rowspan">1</at> |
|
335 |
<at name="halign">default</at> |
|
336 |
<at name="valign">default</at> |
|
337 |
<at name="insets" object="insets">0,0,0,0</at> |
|
338 |
</object> |
|
339 |
</at> |
|
340 |
<at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at> |
|
341 |
</super> |
|
342 |
<at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at> |
|
343 |
<at name="beanclass">javax.swing.JCheckBox</at> |
|
344 |
<at name="beanproperties"> |
|
345 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
346 |
<at name="classname">javax.swing.JCheckBox</at> |
|
347 |
<at name="properties"> |
|
348 |
<object classname="com.jeta.forms.store.support.PropertyMap"> |
|
349 |
<at name="border"> |
|
350 |
<object classname="com.jeta.forms.store.properties.CompoundBorderProperty"> |
|
351 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
352 |
<at name="name">border</at> |
|
353 |
</super> |
|
354 |
<at name="borders"> |
|
355 |
<object classname="java.util.LinkedList"> |
|
356 |
<item > |
|
357 |
<at name="value"> |
|
358 |
<object classname="com.jeta.forms.store.properties.DefaultBorderProperty"> |
|
359 |
<super classname="com.jeta.forms.store.properties.BorderProperty"> |
|
360 |
<at name="name">border</at> |
|
361 |
</super> |
|
362 |
</object> |
|
363 |
</at> |
|
364 |
</item> |
|
365 |
</object> |
|
366 |
</at> |
|
367 |
</object> |
|
368 |
</at> |
|
369 |
<at name="actionCommand">Open report document</at> |
|
370 |
<at name="horizontalAlignment">4</at> |
|
371 |
<at name="name">chkOpenDocument</at> |
|
372 |
<at name="width">709</at> |
|
373 |
<at name="horizontalTextPosition">2</at> |
|
374 |
<at name="text">Open report document</at> |
|
375 |
<at name="selected">true</at> |
|
376 |
<at name="height">16</at> |
|
377 |
</object> |
|
378 |
</at> |
|
379 |
</object> |
|
380 |
</at> |
|
381 |
</object> |
|
382 |
</at> |
|
383 |
</item> |
Also available in: Unified diff