Merge lp:~danilovesky/workcraft/trunk-export-png into lp:workcraft
- trunk-export-png
- Merge into trunk
Proposed by
Danil Sokolov
Status: | Merged |
---|---|
Merged at revision: | 722 |
Proposed branch: | lp:~danilovesky/workcraft/trunk-export-png |
Merge into: | lp:workcraft |
Diff against target: |
745 lines (+392/-62) 11 files modified
CircuitPlugin/.classpath (+0/-1) PetrifyExtraPlugin/src/org/workcraft/plugins/petrify/tools/ShowSg.java (+3/-2) WorkcraftCore/.classpath (+23/-20) WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java (+15/-15) WorkcraftCore/src/org/workcraft/plugins/BuiltinExporters.java (+6/-0) WorkcraftCore/src/org/workcraft/plugins/interop/PDFExporter.java (+110/-0) WorkcraftCore/src/org/workcraft/plugins/interop/PNGExporter.java (+110/-0) WorkcraftCore/src/org/workcraft/plugins/interop/PSExporter.java (+110/-0) WorkcraftCore/src/org/workcraft/plugins/workspace/handlers/SystemOpen.java (+6/-20) WorkcraftCore/src/org/workcraft/serialisation/Format.java (+7/-1) WorkcraftCore/src/org/workcraft/util/GUI.java (+2/-3) |
To merge this branch: | bzr merge lp:~danilovesky/workcraft/trunk-export-png |
Related bugs: | |
Related blueprints: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Danil Sokolov | Approve | ||
Review via email: mp+283753@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Danil Sokolov (danilovesky) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CircuitPlugin/.classpath' |
2 | --- CircuitPlugin/.classpath 2015-10-17 21:21:21 +0000 |
3 | +++ CircuitPlugin/.classpath 2016-01-25 00:18:22 +0000 |
4 | @@ -4,7 +4,6 @@ |
5 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
6 | <classpathentry combineaccessrules="false" kind="src" path="/WorkcraftCore"/> |
7 | <classpathentry combineaccessrules="false" kind="src" path="/CpogsPlugin"/> |
8 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-awt-util.jar"/> |
9 | <classpathentry combineaccessrules="false" kind="src" path="/STGPlugin"/> |
10 | <classpathentry combineaccessrules="false" kind="src" path="/MpsatVerificationPlugin"/> |
11 | <classpathentry combineaccessrules="false" kind="src" path="/PcompPlugin"/> |
12 | |
13 | === modified file 'PetrifyExtraPlugin/src/org/workcraft/plugins/petrify/tools/ShowSg.java' |
14 | --- PetrifyExtraPlugin/src/org/workcraft/plugins/petrify/tools/ShowSg.java 2016-01-21 16:35:51 +0000 |
15 | +++ PetrifyExtraPlugin/src/org/workcraft/plugins/petrify/tools/ShowSg.java 2016-01-25 00:18:22 +0000 |
16 | @@ -5,10 +5,10 @@ |
17 | |
18 | import org.workcraft.Framework; |
19 | import org.workcraft.Tool; |
20 | +import org.workcraft.gui.DesktopApi; |
21 | import org.workcraft.plugins.petri.PetriNetModel; |
22 | import org.workcraft.plugins.petrify.tasks.DrawSgResult; |
23 | import org.workcraft.plugins.petrify.tasks.DrawSgTask; |
24 | -import org.workcraft.plugins.workspace.handlers.SystemOpen; |
25 | import org.workcraft.tasks.ProgressMonitor; |
26 | import org.workcraft.tasks.Result; |
27 | import org.workcraft.tasks.Result.Outcome; |
28 | @@ -63,7 +63,8 @@ |
29 | @Override |
30 | public void finished(Result<? extends DrawSgResult> result, String description) { |
31 | if (result.getOutcome() == Outcome.FINISHED) { |
32 | - SystemOpen.open(result.getReturnValue().getPsFile()); |
33 | + DesktopApi.open(result.getReturnValue().getPsFile()); |
34 | + //SystemOpen.open(result.getReturnValue().getPsFile()); |
35 | } else if (result.getOutcome() != Outcome.CANCELLED) { |
36 | String errorMessage = "Petrify tool chain execution failed :-("; |
37 | Throwable cause = result.getCause(); |
38 | |
39 | === added file 'ThirdParty/batik/batik-anim-1.8.jar' |
40 | Binary files ThirdParty/batik/batik-anim-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-anim-1.8.jar 2016-01-25 00:18:22 +0000 differ |
41 | === removed file 'ThirdParty/batik/batik-anim.jar' |
42 | Binary files ThirdParty/batik/batik-anim.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-anim.jar 1970-01-01 00:00:00 +0000 differ |
43 | === added file 'ThirdParty/batik/batik-awt-util-1.8.jar' |
44 | Binary files ThirdParty/batik/batik-awt-util-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-awt-util-1.8.jar 2016-01-25 00:18:22 +0000 differ |
45 | === removed file 'ThirdParty/batik/batik-awt-util.jar' |
46 | Binary files ThirdParty/batik/batik-awt-util.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-awt-util.jar 1970-01-01 00:00:00 +0000 differ |
47 | === added file 'ThirdParty/batik/batik-bridge-1.8.jar' |
48 | Binary files ThirdParty/batik/batik-bridge-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-bridge-1.8.jar 2016-01-25 00:18:22 +0000 differ |
49 | === removed file 'ThirdParty/batik/batik-bridge.jar' |
50 | Binary files ThirdParty/batik/batik-bridge.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-bridge.jar 1970-01-01 00:00:00 +0000 differ |
51 | === added file 'ThirdParty/batik/batik-codec-1.8.jar' |
52 | Binary files ThirdParty/batik/batik-codec-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-codec-1.8.jar 2016-01-25 00:18:22 +0000 differ |
53 | === removed file 'ThirdParty/batik/batik-codec.jar' |
54 | Binary files ThirdParty/batik/batik-codec.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-codec.jar 1970-01-01 00:00:00 +0000 differ |
55 | === added file 'ThirdParty/batik/batik-css-1.8.jar' |
56 | Binary files ThirdParty/batik/batik-css-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-css-1.8.jar 2016-01-25 00:18:22 +0000 differ |
57 | === removed file 'ThirdParty/batik/batik-css.jar' |
58 | Binary files ThirdParty/batik/batik-css.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-css.jar 1970-01-01 00:00:00 +0000 differ |
59 | === added file 'ThirdParty/batik/batik-dom-1.8.jar' |
60 | Binary files ThirdParty/batik/batik-dom-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-dom-1.8.jar 2016-01-25 00:18:22 +0000 differ |
61 | === removed file 'ThirdParty/batik/batik-dom.jar' |
62 | Binary files ThirdParty/batik/batik-dom.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-dom.jar 1970-01-01 00:00:00 +0000 differ |
63 | === added file 'ThirdParty/batik/batik-ext-1.8.jar' |
64 | Binary files ThirdParty/batik/batik-ext-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-ext-1.8.jar 2016-01-25 00:18:22 +0000 differ |
65 | === removed file 'ThirdParty/batik/batik-ext.jar' |
66 | Binary files ThirdParty/batik/batik-ext.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-ext.jar 1970-01-01 00:00:00 +0000 differ |
67 | === added file 'ThirdParty/batik/batik-extension-1.8.jar' |
68 | Binary files ThirdParty/batik/batik-extension-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-extension-1.8.jar 2016-01-25 00:18:22 +0000 differ |
69 | === removed file 'ThirdParty/batik/batik-extension.jar' |
70 | Binary files ThirdParty/batik/batik-extension.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-extension.jar 1970-01-01 00:00:00 +0000 differ |
71 | === added file 'ThirdParty/batik/batik-gui-util-1.8.jar' |
72 | Binary files ThirdParty/batik/batik-gui-util-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-gui-util-1.8.jar 2016-01-25 00:18:22 +0000 differ |
73 | === removed file 'ThirdParty/batik/batik-gui-util.jar' |
74 | Binary files ThirdParty/batik/batik-gui-util.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-gui-util.jar 1970-01-01 00:00:00 +0000 differ |
75 | === added file 'ThirdParty/batik/batik-gvt-1.8.jar' |
76 | Binary files ThirdParty/batik/batik-gvt-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-gvt-1.8.jar 2016-01-25 00:18:22 +0000 differ |
77 | === removed file 'ThirdParty/batik/batik-gvt.jar' |
78 | Binary files ThirdParty/batik/batik-gvt.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-gvt.jar 1970-01-01 00:00:00 +0000 differ |
79 | === added file 'ThirdParty/batik/batik-parser-1.8.jar' |
80 | Binary files ThirdParty/batik/batik-parser-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-parser-1.8.jar 2016-01-25 00:18:22 +0000 differ |
81 | === removed file 'ThirdParty/batik/batik-parser.jar' |
82 | Binary files ThirdParty/batik/batik-parser.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-parser.jar 1970-01-01 00:00:00 +0000 differ |
83 | === added file 'ThirdParty/batik/batik-rasterizer-1.8.jar' |
84 | Binary files ThirdParty/batik/batik-rasterizer-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-rasterizer-1.8.jar 2016-01-25 00:18:22 +0000 differ |
85 | === added file 'ThirdParty/batik/batik-script-1.8.jar' |
86 | Binary files ThirdParty/batik/batik-script-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-script-1.8.jar 2016-01-25 00:18:22 +0000 differ |
87 | === removed file 'ThirdParty/batik/batik-script.jar' |
88 | Binary files ThirdParty/batik/batik-script.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-script.jar 1970-01-01 00:00:00 +0000 differ |
89 | === added file 'ThirdParty/batik/batik-svg-dom-1.8.jar' |
90 | Binary files ThirdParty/batik/batik-svg-dom-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-svg-dom-1.8.jar 2016-01-25 00:18:22 +0000 differ |
91 | === removed file 'ThirdParty/batik/batik-svg-dom.jar' |
92 | Binary files ThirdParty/batik/batik-svg-dom.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-svg-dom.jar 1970-01-01 00:00:00 +0000 differ |
93 | === added file 'ThirdParty/batik/batik-svggen-1.8.jar' |
94 | Binary files ThirdParty/batik/batik-svggen-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-svggen-1.8.jar 2016-01-25 00:18:22 +0000 differ |
95 | === removed file 'ThirdParty/batik/batik-svggen.jar' |
96 | Binary files ThirdParty/batik/batik-svggen.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-svggen.jar 1970-01-01 00:00:00 +0000 differ |
97 | === added file 'ThirdParty/batik/batik-swing-1.8.jar' |
98 | Binary files ThirdParty/batik/batik-swing-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-swing-1.8.jar 2016-01-25 00:18:22 +0000 differ |
99 | === removed file 'ThirdParty/batik/batik-swing.jar' |
100 | Binary files ThirdParty/batik/batik-swing.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-swing.jar 1970-01-01 00:00:00 +0000 differ |
101 | === added file 'ThirdParty/batik/batik-transcoder-1.8.jar' |
102 | Binary files ThirdParty/batik/batik-transcoder-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-transcoder-1.8.jar 2016-01-25 00:18:22 +0000 differ |
103 | === removed file 'ThirdParty/batik/batik-transcoder.jar' |
104 | Binary files ThirdParty/batik/batik-transcoder.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-transcoder.jar 1970-01-01 00:00:00 +0000 differ |
105 | === added file 'ThirdParty/batik/batik-util-1.8.jar' |
106 | Binary files ThirdParty/batik/batik-util-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-util-1.8.jar 2016-01-25 00:18:22 +0000 differ |
107 | === removed file 'ThirdParty/batik/batik-util.jar' |
108 | Binary files ThirdParty/batik/batik-util.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-util.jar 1970-01-01 00:00:00 +0000 differ |
109 | === added file 'ThirdParty/batik/batik-xml-1.8.jar' |
110 | Binary files ThirdParty/batik/batik-xml-1.8.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/batik-xml-1.8.jar 2016-01-25 00:18:22 +0000 differ |
111 | === removed file 'ThirdParty/batik/batik-xml.jar' |
112 | Binary files ThirdParty/batik/batik-xml.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/batik-xml.jar 1970-01-01 00:00:00 +0000 differ |
113 | === added file 'ThirdParty/batik/fop-transcoder-allinone.jar' |
114 | Binary files ThirdParty/batik/fop-transcoder-allinone.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/fop-transcoder-allinone.jar 2016-01-25 00:18:22 +0000 differ |
115 | === added file 'ThirdParty/batik/xml-apis-1.3.04.jar' |
116 | Binary files ThirdParty/batik/xml-apis-1.3.04.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/xml-apis-1.3.04.jar 2016-01-25 00:18:22 +0000 differ |
117 | === added file 'ThirdParty/batik/xml-apis-ext-1.3.04.jar' |
118 | Binary files ThirdParty/batik/xml-apis-ext-1.3.04.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/xml-apis-ext-1.3.04.jar 2016-01-25 00:18:22 +0000 differ |
119 | === removed file 'ThirdParty/batik/xml-apis-ext.jar' |
120 | Binary files ThirdParty/batik/xml-apis-ext.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/xml-apis-ext.jar 1970-01-01 00:00:00 +0000 differ |
121 | === removed file 'ThirdParty/batik/xml-apis.jar' |
122 | Binary files ThirdParty/batik/xml-apis.jar 2010-02-25 19:24:09 +0000 and ThirdParty/batik/xml-apis.jar 1970-01-01 00:00:00 +0000 differ |
123 | === added file 'ThirdParty/batik/xmlgraphics-commons-2.1.jar' |
124 | Binary files ThirdParty/batik/xmlgraphics-commons-2.1.jar 1970-01-01 00:00:00 +0000 and ThirdParty/batik/xmlgraphics-commons-2.1.jar 2016-01-25 00:18:22 +0000 differ |
125 | === modified file 'WorkcraftCore/.classpath' |
126 | --- WorkcraftCore/.classpath 2015-12-17 16:50:15 +0000 |
127 | +++ WorkcraftCore/.classpath 2016-01-25 00:18:22 +0000 |
128 | @@ -2,26 +2,6 @@ |
129 | <classpath> |
130 | <classpathentry kind="src" path="src"/> |
131 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
132 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-anim.jar"/> |
133 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-awt-util.jar"/> |
134 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-bridge.jar"/> |
135 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-codec.jar"/> |
136 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-css.jar"/> |
137 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-dom.jar"/> |
138 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-ext.jar"/> |
139 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-extension.jar"/> |
140 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-gui-util.jar"/> |
141 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-gvt.jar"/> |
142 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-parser.jar"/> |
143 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-script.jar"/> |
144 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-svg-dom.jar"/> |
145 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-svggen.jar"/> |
146 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-swing.jar"/> |
147 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-transcoder.jar"/> |
148 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-util.jar"/> |
149 | - <classpathentry kind="lib" path="/ThirdParty/batik/batik-xml.jar"/> |
150 | - <classpathentry kind="lib" path="/ThirdParty/batik/xml-apis-ext.jar"/> |
151 | - <classpathentry kind="lib" path="/ThirdParty/batik/xml-apis.jar"/> |
152 | <classpathentry kind="lib" path="/ThirdParty/flexdock-0.5.1.jar"/> |
153 | <classpathentry kind="lib" path="/ThirdParty/javaparser-1.0.7.jar"/> |
154 | <classpathentry kind="lib" path="/ThirdParty/jedit.jar"/> |
155 | @@ -33,5 +13,28 @@ |
156 | <classpathentry kind="lib" path="/ThirdParty/commons-logging-1.1.3.jar"/> |
157 | <classpathentry kind="lib" path="/ThirdParty/"/> |
158 | <classpathentry kind="lib" path="/ThirdParty/jga-0.8-lgpl.jar"/> |
159 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-bridge-1.8.jar"/> |
160 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-dom-1.8.jar"/> |
161 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-util-1.8.jar"/> |
162 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-script-1.8.jar"/> |
163 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-svg-dom-1.8.jar"/> |
164 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-gvt-1.8.jar"/> |
165 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-svggen-1.8.jar"/> |
166 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-codec-1.8.jar"/> |
167 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-css-1.8.jar"/> |
168 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-ext-1.8.jar"/> |
169 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-extension-1.8.jar"/> |
170 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-gui-util-1.8.jar"/> |
171 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-parser-1.8.jar"/> |
172 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-rasterizer-1.8.jar"/> |
173 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-swing-1.8.jar"/> |
174 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-transcoder-1.8.jar"/> |
175 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-xml-1.8.jar"/> |
176 | + <classpathentry kind="lib" path="/ThirdParty/batik/xml-apis-1.3.04.jar"/> |
177 | + <classpathentry kind="lib" path="/ThirdParty/batik/xml-apis-ext-1.3.04.jar"/> |
178 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-awt-util-1.8.jar"/> |
179 | + <classpathentry kind="lib" path="/ThirdParty/batik/batik-anim-1.8.jar"/> |
180 | + <classpathentry kind="lib" path="/ThirdParty/batik/xmlgraphics-commons-2.1.jar"/> |
181 | + <classpathentry kind="lib" path="/ThirdParty/batik/fop-transcoder-allinone.jar"/> |
182 | <classpathentry kind="output" path="bin"/> |
183 | </classpath> |
184 | |
185 | === modified file 'WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java' |
186 | --- WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java 2016-01-14 18:28:55 +0000 |
187 | +++ WorkcraftCore/src/org/workcraft/gui/workspace/WorkspacePopupProvider.java 2016-01-25 00:18:22 +0000 |
188 | @@ -68,10 +68,8 @@ |
189 | |
190 | final File file = workspace.getFile(path); |
191 | |
192 | - if(file.isDirectory()) |
193 | - { |
194 | + if(file.isDirectory()) { |
195 | popup.addSeparator(); |
196 | - |
197 | { |
198 | final JMenuItem miLink = new JMenuItem("Link external files or directories..."); |
199 | miLink.addActionListener(new ActionListener() { |
200 | @@ -125,31 +123,29 @@ |
201 | { |
202 | popup.addSeparator(); |
203 | final WorkspaceEntry openFile = workspace.getOpenFile(path); |
204 | - if (openFile==null) |
205 | - { |
206 | + if (openFile==null) { |
207 | if(file.exists()) { |
208 | - if(file.getName().endsWith(FileFilters.DOCUMENT_EXTENSION)) |
209 | - { |
210 | + if(file.getName().endsWith(FileFilters.DOCUMENT_EXTENSION)) { |
211 | final JMenuItem miOpen = new JMenuItem("Open"); |
212 | - miOpen.addActionListener(new ActionListener() |
213 | - { |
214 | - @Override public void actionPerformed(ActionEvent e) { |
215 | + miOpen.addActionListener(new ActionListener() { |
216 | + @Override |
217 | + public void actionPerformed(ActionEvent e) { |
218 | framework.getMainWindow().openWork(file); |
219 | } |
220 | - } |
221 | - ); |
222 | + }); |
223 | popup.add(miOpen); |
224 | } |
225 | |
226 | for (PluginInfo<? extends FileHandler> info : framework.getPluginManager().getPlugins(FileHandler.class)) { |
227 | FileHandler handler = info.getSingleton(); |
228 | |
229 | - if (!handler.accept(file)) |
230 | - continue; |
231 | + if ( !handler.accept(file) ) { |
232 | + continue; |
233 | + } |
234 | JMenuItem mi = new JMenuItem(handler.getDisplayName()); |
235 | handlers.put(mi, handler); |
236 | mi.addActionListener(new ActionListener() { |
237 | - |
238 | + @Override |
239 | public void actionPerformed(ActionEvent e) { |
240 | handlers.get(e.getSource()).execute(file); |
241 | } |
242 | @@ -167,6 +163,7 @@ |
243 | |
244 | JMenuItem miOpenView = new JMenuItem("Open editor"); |
245 | miOpenView.addActionListener(new ActionListener() { |
246 | + @Override |
247 | public void actionPerformed(ActionEvent e) { |
248 | framework.getMainWindow().createEditorWindow(openFile); |
249 | } |
250 | @@ -174,6 +171,7 @@ |
251 | |
252 | JMenuItem miSave = new JMenuItem("Save"); |
253 | miSave.addActionListener(new ActionListener() { |
254 | + @Override |
255 | public void actionPerformed(ActionEvent e) { |
256 | try { |
257 | framework.getMainWindow().save(openFile); |
258 | @@ -184,6 +182,7 @@ |
259 | |
260 | JMenuItem miSaveAs = new JMenuItem("Save as..."); |
261 | miSaveAs.addActionListener(new ActionListener() { |
262 | + @Override |
263 | public void actionPerformed(ActionEvent e) { |
264 | try { |
265 | framework.getMainWindow().saveAs(openFile); |
266 | @@ -238,6 +237,7 @@ |
267 | |
268 | JMenuItem miRemove = new JMenuItem("Delete"); |
269 | miRemove.addActionListener(new ActionListener() { |
270 | + @Override |
271 | public void actionPerformed(ActionEvent e) { |
272 | try { |
273 | workspace.delete(path); |
274 | |
275 | === modified file 'WorkcraftCore/src/org/workcraft/plugins/BuiltinExporters.java' |
276 | --- WorkcraftCore/src/org/workcraft/plugins/BuiltinExporters.java 2014-12-12 18:43:40 +0000 |
277 | +++ WorkcraftCore/src/org/workcraft/plugins/BuiltinExporters.java 2016-01-25 00:18:22 +0000 |
278 | @@ -5,6 +5,9 @@ |
279 | import org.workcraft.PluginManager; |
280 | import org.workcraft.interop.Exporter; |
281 | import org.workcraft.plugins.interop.DotExporter; |
282 | +import org.workcraft.plugins.interop.PSExporter; |
283 | +import org.workcraft.plugins.interop.PDFExporter; |
284 | +import org.workcraft.plugins.interop.PNGExporter; |
285 | import org.workcraft.plugins.interop.SVGExporter; |
286 | |
287 | public class BuiltinExporters implements Module { |
288 | @@ -15,6 +18,9 @@ |
289 | |
290 | pm.registerClass(Exporter.class, DotExporter.class); |
291 | pm.registerClass(Exporter.class, SVGExporter.class); |
292 | + pm.registerClass(Exporter.class, PDFExporter.class); |
293 | + pm.registerClass(Exporter.class, PSExporter.class); |
294 | + pm.registerClass(Exporter.class, PNGExporter.class); |
295 | } |
296 | |
297 | @Override |
298 | |
299 | === added file 'WorkcraftCore/src/org/workcraft/plugins/interop/PDFExporter.java' |
300 | --- WorkcraftCore/src/org/workcraft/plugins/interop/PDFExporter.java 1970-01-01 00:00:00 +0000 |
301 | +++ WorkcraftCore/src/org/workcraft/plugins/interop/PDFExporter.java 2016-01-25 00:18:22 +0000 |
302 | @@ -0,0 +1,110 @@ |
303 | +/* |
304 | +* |
305 | +* Copyright 2008,2009 Newcastle University |
306 | +* |
307 | +* This file is part of Workcraft. |
308 | +* |
309 | +* Workcraft is free software: you can redistribute it and/or modify |
310 | +* it under the terms of the GNU General Public License as published by |
311 | +* the Free Software Foundation, either version 3 of the License, or |
312 | +* (at your option) any later version. |
313 | +* |
314 | +* Workcraft is distributed in the hope that it will be useful, |
315 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
316 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
317 | +* GNU General Public License for more details. |
318 | +* |
319 | +* You should have received a copy of the GNU General Public License |
320 | +* along with Workcraft. If not, see <http://www.gnu.org/licenses/>. |
321 | +* |
322 | +*/ |
323 | + |
324 | +package org.workcraft.plugins.interop; |
325 | + |
326 | +import java.awt.Dimension; |
327 | +import java.awt.geom.Rectangle2D; |
328 | +import java.io.ByteArrayInputStream; |
329 | +import java.io.ByteArrayOutputStream; |
330 | +import java.io.IOException; |
331 | +import java.io.OutputStream; |
332 | +import java.io.OutputStreamWriter; |
333 | +import java.util.UUID; |
334 | + |
335 | +import javax.xml.parsers.ParserConfigurationException; |
336 | + |
337 | +import org.apache.batik.svggen.SVGGraphics2D; |
338 | +import org.apache.batik.transcoder.Transcoder; |
339 | +import org.apache.batik.transcoder.TranscoderException; |
340 | +import org.apache.batik.transcoder.TranscoderInput; |
341 | +import org.apache.batik.transcoder.TranscoderOutput; |
342 | +import org.apache.fop.svg.PDFTranscoder; |
343 | +import org.w3c.dom.Document; |
344 | +import org.workcraft.dom.Model; |
345 | +import org.workcraft.dom.visual.VisualGroup; |
346 | +import org.workcraft.dom.visual.VisualModel; |
347 | +import org.workcraft.exceptions.ModelValidationException; |
348 | +import org.workcraft.exceptions.SerialisationException; |
349 | +import org.workcraft.gui.graph.tools.Decorator; |
350 | +import org.workcraft.interop.Exporter; |
351 | +import org.workcraft.serialisation.Format; |
352 | +import org.workcraft.util.XmlUtil; |
353 | + |
354 | +public class PDFExporter implements Exporter { |
355 | + |
356 | + |
357 | + public void export(Model model, OutputStream out) throws IOException, |
358 | + ModelValidationException, SerialisationException { |
359 | + |
360 | + if (model == null) |
361 | + throw new SerialisationException ("Not a visual model"); |
362 | + |
363 | + try { |
364 | + Document doc = XmlUtil.createDocument(); |
365 | + |
366 | + SVGGraphics2D g2d = new SVGGraphics2D(doc); |
367 | + |
368 | + g2d.scale(50, 50); |
369 | + |
370 | + Rectangle2D bounds = ((VisualGroup)model.getRoot()).getBoundingBoxInLocalSpace(); |
371 | + |
372 | + g2d.translate(-bounds.getMinX(), -bounds.getMinY()); |
373 | + g2d.setSVGCanvasSize(new Dimension((int)(bounds.getWidth()*50), (int)(bounds.getHeight()*50))); |
374 | + |
375 | + ((VisualModel)model).draw(g2d, Decorator.Empty.INSTANCE); |
376 | + |
377 | + ByteArrayOutputStream svgOut = new ByteArrayOutputStream(); |
378 | + g2d.stream(new OutputStreamWriter(svgOut)); |
379 | + ByteArrayInputStream svgIn = new ByteArrayInputStream(svgOut.toByteArray()); |
380 | + |
381 | + Transcoder transcoder = new PDFTranscoder(); |
382 | + TranscoderInput transcoderInput = new TranscoderInput(svgIn); |
383 | + TranscoderOutput transcoderOutput = new TranscoderOutput(out); |
384 | + transcoder.transcode(transcoderInput, transcoderOutput); |
385 | + } catch (ParserConfigurationException e) { |
386 | + throw new SerialisationException(e); |
387 | + } catch (TranscoderException e) { |
388 | + throw new SerialisationException(e); |
389 | + } |
390 | + } |
391 | + |
392 | + |
393 | + public String getDescription() { |
394 | + return ".pdf (FOP PDF generator)"; |
395 | + } |
396 | + |
397 | + public String getExtenstion() { |
398 | + return ".pdf"; |
399 | + } |
400 | + |
401 | + public int getCompatibility(Model model) { |
402 | + if (model instanceof VisualModel) |
403 | + return Exporter.GENERAL_COMPATIBILITY; |
404 | + else |
405 | + return Exporter.NOT_COMPATIBLE; |
406 | + } |
407 | + |
408 | + @Override |
409 | + public UUID getTargetFormat() { |
410 | + return Format.PDF; |
411 | + } |
412 | +} |
413 | \ No newline at end of file |
414 | |
415 | === added file 'WorkcraftCore/src/org/workcraft/plugins/interop/PNGExporter.java' |
416 | --- WorkcraftCore/src/org/workcraft/plugins/interop/PNGExporter.java 1970-01-01 00:00:00 +0000 |
417 | +++ WorkcraftCore/src/org/workcraft/plugins/interop/PNGExporter.java 2016-01-25 00:18:22 +0000 |
418 | @@ -0,0 +1,110 @@ |
419 | +/* |
420 | +* |
421 | +* Copyright 2008,2009 Newcastle University |
422 | +* |
423 | +* This file is part of Workcraft. |
424 | +* |
425 | +* Workcraft is free software: you can redistribute it and/or modify |
426 | +* it under the terms of the GNU General Public License as published by |
427 | +* the Free Software Foundation, either version 3 of the License, or |
428 | +* (at your option) any later version. |
429 | +* |
430 | +* Workcraft is distributed in the hope that it will be useful, |
431 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
432 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
433 | +* GNU General Public License for more details. |
434 | +* |
435 | +* You should have received a copy of the GNU General Public License |
436 | +* along with Workcraft. If not, see <http://www.gnu.org/licenses/>. |
437 | +* |
438 | +*/ |
439 | + |
440 | +package org.workcraft.plugins.interop; |
441 | + |
442 | +import java.awt.Dimension; |
443 | +import java.awt.geom.Rectangle2D; |
444 | +import java.io.ByteArrayInputStream; |
445 | +import java.io.ByteArrayOutputStream; |
446 | +import java.io.IOException; |
447 | +import java.io.OutputStream; |
448 | +import java.io.OutputStreamWriter; |
449 | +import java.util.UUID; |
450 | + |
451 | +import javax.xml.parsers.ParserConfigurationException; |
452 | + |
453 | +import org.apache.batik.svggen.SVGGraphics2D; |
454 | +import org.apache.batik.transcoder.Transcoder; |
455 | +import org.apache.batik.transcoder.TranscoderException; |
456 | +import org.apache.batik.transcoder.TranscoderInput; |
457 | +import org.apache.batik.transcoder.TranscoderOutput; |
458 | +import org.apache.batik.transcoder.image.PNGTranscoder; |
459 | +import org.w3c.dom.Document; |
460 | +import org.workcraft.dom.Model; |
461 | +import org.workcraft.dom.visual.VisualGroup; |
462 | +import org.workcraft.dom.visual.VisualModel; |
463 | +import org.workcraft.exceptions.ModelValidationException; |
464 | +import org.workcraft.exceptions.SerialisationException; |
465 | +import org.workcraft.gui.graph.tools.Decorator; |
466 | +import org.workcraft.interop.Exporter; |
467 | +import org.workcraft.serialisation.Format; |
468 | +import org.workcraft.util.XmlUtil; |
469 | + |
470 | +public class PNGExporter implements Exporter { |
471 | + |
472 | + |
473 | + public void export(Model model, OutputStream out) throws IOException, |
474 | + ModelValidationException, SerialisationException { |
475 | + |
476 | + if (model == null) |
477 | + throw new SerialisationException ("Not a visual model"); |
478 | + |
479 | + try { |
480 | + Document doc = XmlUtil.createDocument(); |
481 | + |
482 | + SVGGraphics2D g2d = new SVGGraphics2D(doc); |
483 | + |
484 | + g2d.scale(50, 50); |
485 | + |
486 | + Rectangle2D bounds = ((VisualGroup)model.getRoot()).getBoundingBoxInLocalSpace(); |
487 | + |
488 | + g2d.translate(-bounds.getMinX(), -bounds.getMinY()); |
489 | + g2d.setSVGCanvasSize(new Dimension((int)(bounds.getWidth()*50), (int)(bounds.getHeight()*50))); |
490 | + |
491 | + ((VisualModel)model).draw(g2d, Decorator.Empty.INSTANCE); |
492 | + |
493 | + ByteArrayOutputStream svgOut = new ByteArrayOutputStream(); |
494 | + g2d.stream(new OutputStreamWriter(svgOut)); |
495 | + ByteArrayInputStream svgIn = new ByteArrayInputStream(svgOut.toByteArray()); |
496 | + |
497 | + Transcoder transcoder = new PNGTranscoder(); |
498 | + TranscoderInput transcoderInput = new TranscoderInput(svgIn); |
499 | + TranscoderOutput transcoderOutput = new TranscoderOutput(out); |
500 | + transcoder.transcode(transcoderInput, transcoderOutput); |
501 | + } catch (ParserConfigurationException e) { |
502 | + throw new SerialisationException(e); |
503 | + } catch (TranscoderException e) { |
504 | + throw new SerialisationException(e); |
505 | + } |
506 | + } |
507 | + |
508 | + |
509 | + public String getDescription() { |
510 | + return ".png (FOP PNG transcoder)"; |
511 | + } |
512 | + |
513 | + public String getExtenstion() { |
514 | + return ".png"; |
515 | + } |
516 | + |
517 | + public int getCompatibility(Model model) { |
518 | + if (model instanceof VisualModel) |
519 | + return Exporter.GENERAL_COMPATIBILITY; |
520 | + else |
521 | + return Exporter.NOT_COMPATIBLE; |
522 | + } |
523 | + |
524 | + @Override |
525 | + public UUID getTargetFormat() { |
526 | + return Format.PNG; |
527 | + } |
528 | +} |
529 | \ No newline at end of file |
530 | |
531 | === added file 'WorkcraftCore/src/org/workcraft/plugins/interop/PSExporter.java' |
532 | --- WorkcraftCore/src/org/workcraft/plugins/interop/PSExporter.java 1970-01-01 00:00:00 +0000 |
533 | +++ WorkcraftCore/src/org/workcraft/plugins/interop/PSExporter.java 2016-01-25 00:18:22 +0000 |
534 | @@ -0,0 +1,110 @@ |
535 | +/* |
536 | +* |
537 | +* Copyright 2008,2009 Newcastle University |
538 | +* |
539 | +* This file is part of Workcraft. |
540 | +* |
541 | +* Workcraft is free software: you can redistribute it and/or modify |
542 | +* it under the terms of the GNU General Public License as published by |
543 | +* the Free Software Foundation, either version 3 of the License, or |
544 | +* (at your option) any later version. |
545 | +* |
546 | +* Workcraft is distributed in the hope that it will be useful, |
547 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
548 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
549 | +* GNU General Public License for more details. |
550 | +* |
551 | +* You should have received a copy of the GNU General Public License |
552 | +* along with Workcraft. If not, see <http://www.gnu.org/licenses/>. |
553 | +* |
554 | +*/ |
555 | + |
556 | +package org.workcraft.plugins.interop; |
557 | + |
558 | +import java.awt.Dimension; |
559 | +import java.awt.geom.Rectangle2D; |
560 | +import java.io.ByteArrayInputStream; |
561 | +import java.io.ByteArrayOutputStream; |
562 | +import java.io.IOException; |
563 | +import java.io.OutputStream; |
564 | +import java.io.OutputStreamWriter; |
565 | +import java.util.UUID; |
566 | + |
567 | +import javax.xml.parsers.ParserConfigurationException; |
568 | + |
569 | +import org.apache.batik.svggen.SVGGraphics2D; |
570 | +import org.apache.batik.transcoder.Transcoder; |
571 | +import org.apache.batik.transcoder.TranscoderException; |
572 | +import org.apache.batik.transcoder.TranscoderInput; |
573 | +import org.apache.batik.transcoder.TranscoderOutput; |
574 | +import org.apache.fop.render.ps.PSTranscoder; |
575 | +import org.w3c.dom.Document; |
576 | +import org.workcraft.dom.Model; |
577 | +import org.workcraft.dom.visual.VisualGroup; |
578 | +import org.workcraft.dom.visual.VisualModel; |
579 | +import org.workcraft.exceptions.ModelValidationException; |
580 | +import org.workcraft.exceptions.SerialisationException; |
581 | +import org.workcraft.gui.graph.tools.Decorator; |
582 | +import org.workcraft.interop.Exporter; |
583 | +import org.workcraft.serialisation.Format; |
584 | +import org.workcraft.util.XmlUtil; |
585 | + |
586 | +public class PSExporter implements Exporter { |
587 | + |
588 | + |
589 | + public void export(Model model, OutputStream out) throws IOException, |
590 | + ModelValidationException, SerialisationException { |
591 | + |
592 | + if (model == null) |
593 | + throw new SerialisationException ("Not a visual model"); |
594 | + |
595 | + try { |
596 | + Document doc = XmlUtil.createDocument(); |
597 | + |
598 | + SVGGraphics2D g2d = new SVGGraphics2D(doc); |
599 | + |
600 | + g2d.scale(50, 50); |
601 | + |
602 | + Rectangle2D bounds = ((VisualGroup)model.getRoot()).getBoundingBoxInLocalSpace(); |
603 | + |
604 | + g2d.translate(-bounds.getMinX(), -bounds.getMinY()); |
605 | + g2d.setSVGCanvasSize(new Dimension((int)(bounds.getWidth()*50), (int)(bounds.getHeight()*50))); |
606 | + |
607 | + ((VisualModel)model).draw(g2d, Decorator.Empty.INSTANCE); |
608 | + |
609 | + ByteArrayOutputStream svgOut = new ByteArrayOutputStream(); |
610 | + g2d.stream(new OutputStreamWriter(svgOut)); |
611 | + ByteArrayInputStream svgIn = new ByteArrayInputStream(svgOut.toByteArray()); |
612 | + |
613 | + Transcoder transcoder = new PSTranscoder(); |
614 | + TranscoderInput transcoderInput = new TranscoderInput(svgIn); |
615 | + TranscoderOutput transcoderOutput = new TranscoderOutput(out); |
616 | + transcoder.transcode(transcoderInput, transcoderOutput); |
617 | + } catch (ParserConfigurationException e) { |
618 | + throw new SerialisationException(e); |
619 | + } catch (TranscoderException e) { |
620 | + throw new SerialisationException(e); |
621 | + } |
622 | + } |
623 | + |
624 | + |
625 | + public String getDescription() { |
626 | + return ".ps (FOP PS transcoder)"; |
627 | + } |
628 | + |
629 | + public String getExtenstion() { |
630 | + return ".ps"; |
631 | + } |
632 | + |
633 | + public int getCompatibility(Model model) { |
634 | + if (model instanceof VisualModel) |
635 | + return Exporter.GENERAL_COMPATIBILITY; |
636 | + else |
637 | + return Exporter.NOT_COMPATIBLE; |
638 | + } |
639 | + |
640 | + @Override |
641 | + public UUID getTargetFormat() { |
642 | + return Format.PS; |
643 | + } |
644 | +} |
645 | \ No newline at end of file |
646 | |
647 | === modified file 'WorkcraftCore/src/org/workcraft/plugins/workspace/handlers/SystemOpen.java' |
648 | --- WorkcraftCore/src/org/workcraft/plugins/workspace/handlers/SystemOpen.java 2015-11-24 14:16:37 +0000 |
649 | +++ WorkcraftCore/src/org/workcraft/plugins/workspace/handlers/SystemOpen.java 2016-01-25 00:18:22 +0000 |
650 | @@ -21,37 +21,23 @@ |
651 | |
652 | package org.workcraft.plugins.workspace.handlers; |
653 | |
654 | -import java.awt.Desktop; |
655 | import java.io.File; |
656 | -import java.io.IOException; |
657 | |
658 | +import org.workcraft.gui.DesktopApi; |
659 | import org.workcraft.gui.FileFilters; |
660 | import org.workcraft.workspace.FileHandler; |
661 | |
662 | public class SystemOpen implements FileHandler { |
663 | |
664 | + @Override |
665 | public boolean accept(File f) { |
666 | return !f.getName().endsWith(FileFilters.DOCUMENT_EXTENSION); |
667 | } |
668 | - |
669 | - |
670 | + |
671 | + @Override |
672 | public void execute(File f) { |
673 | - open(f); |
674 | - } |
675 | - |
676 | - |
677 | - public static void open(File f) { |
678 | - try { |
679 | - if (System.getProperty ("os.name").contains("Windows")) { |
680 | - Runtime.getRuntime().exec (new String[] {"cmd", "/c", f.getAbsolutePath() }); |
681 | - } else { |
682 | - Desktop.getDesktop().open(f); |
683 | - } |
684 | - } catch (IOException e) { |
685 | - e.printStackTrace(); |
686 | - } |
687 | - } |
688 | - |
689 | + DesktopApi.open(f); |
690 | + } |
691 | |
692 | @Override |
693 | public String getDisplayName() { |
694 | |
695 | === modified file 'WorkcraftCore/src/org/workcraft/serialisation/Format.java' |
696 | --- WorkcraftCore/src/org/workcraft/serialisation/Format.java 2015-06-29 17:01:11 +0000 |
697 | +++ WorkcraftCore/src/org/workcraft/serialisation/Format.java 2016-01-25 00:18:22 +0000 |
698 | @@ -27,7 +27,9 @@ |
699 | public static final UUID STG = UUID.fromString("000199d9-4ac1-4423-b8ea-9017d838e45b"); |
700 | public static final UUID SG = UUID.fromString("f309012a-ab89-4036-bb80-8b1a161e8899"); |
701 | public static final UUID SVG = UUID.fromString("99439c3c-753b-46e3-a5d5-6a0993305a2c"); |
702 | - public static final UUID PS = UUID.fromString("9b5bd9f0-b5cf-11df-8d81-0800200c9a66"); |
703 | + public static final UUID PS = UUID.fromString("9b5bd9f0-b5cf-11df-8d81-0800200c9a66"); |
704 | + public static final UUID PDF = UUID.fromString("fa1da69d-3a17-4296-809e-a71f28066fc0"); |
705 | + public static final UUID PNG = UUID.fromString("c09714a6-cae9-4744-95cb-17ba4d28f5ef"); |
706 | public static final UUID workcraftXML = UUID.fromString("6ea20f69-c9c4-4888-9124-252fe4345309"); |
707 | public static final UUID defaultVisualXML = UUID.fromString("2fa9669c-a1bf-4be4-8622-007635d672e5"); |
708 | public static final UUID DOT = UUID.fromString("f1596b60-e294-11de-8a39-0800200c9a66"); |
709 | @@ -44,6 +46,10 @@ |
710 | return ".svg (Scalable Vector Graphics)"; |
711 | else if (format.equals(PS)) |
712 | return ".ps (PostScript)"; |
713 | + else if (format.equals(PDF)) |
714 | + return ".pdf (Portable Document Format)"; |
715 | + else if (format.equals(PNG)) |
716 | + return ".png (Portable Network Graphics)"; |
717 | else if (format.equals(workcraftXML)) |
718 | return ".xml (Workcraft math model)"; |
719 | else if (format.equals(defaultVisualXML)) |
720 | |
721 | === modified file 'WorkcraftCore/src/org/workcraft/util/GUI.java' |
722 | --- WorkcraftCore/src/org/workcraft/util/GUI.java 2015-09-10 22:34:47 +0000 |
723 | +++ WorkcraftCore/src/org/workcraft/util/GUI.java 2016-01-25 00:18:22 +0000 |
724 | @@ -25,10 +25,10 @@ |
725 | import javax.swing.JPanel; |
726 | import javax.swing.UIManager; |
727 | |
728 | +import org.apache.batik.anim.dom.SAXSVGDocumentFactory; |
729 | import org.apache.batik.bridge.BridgeContext; |
730 | import org.apache.batik.bridge.GVTBuilder; |
731 | import org.apache.batik.bridge.UserAgentAdapter; |
732 | -import org.apache.batik.dom.svg.SAXSVGDocumentFactory; |
733 | import org.apache.batik.gvt.GraphicsNode; |
734 | import org.apache.batik.util.XMLResourceDescriptor; |
735 | import org.w3c.dom.Document; |
736 | @@ -125,8 +125,7 @@ |
737 | BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); |
738 | |
739 | Graphics2D g2d = (Graphics2D) bufferedImage.getGraphics(); |
740 | - if(background!=null) |
741 | - { |
742 | + if (background != null) { |
743 | g2d.setColor(background); |
744 | g2d.fillRect(0,0,width, height); |
745 | } |