1 | /* $Id: ArgoParser.java 19907 2012-12-30 13:06:01Z closettop_nightlybuild $ | |
2 | ***************************************************************************** | |
3 | * Copyright (c) 2009-2012 Contributors - see below | |
4 | * All rights reserved. This program and the accompanying materials | |
5 | * are made available under the terms of the Eclipse Public License v1.0 | |
6 | * which accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * tfmorris | |
11 | ***************************************************************************** | |
12 | * | |
13 | * Some portions of this file was previously release using the BSD License: | |
14 | */ | |
15 | ||
16 | // Copyright (c) 1996-2008 The Regents of the University of California. All | |
17 | // Rights Reserved. Permission to use, copy, modify, and distribute this | |
18 | // software and its documentation without fee, and without a written | |
19 | // agreement is hereby granted, provided that the above copyright notice | |
20 | // and this paragraph appear in all copies. This software program and | |
21 | // documentation are copyrighted by The Regents of the University of | |
22 | // California. The software program and documentation are supplied "AS | |
23 | // IS", without any accompanying services from The Regents. The Regents | |
24 | // does not warrant that the operation of the program will be | |
25 | // uninterrupted or error-free. The end-user understands that the program | |
26 | // was developed for research purposes and is advised not to rely | |
27 | // exclusively on the program for any reason. IN NO EVENT SHALL THE | |
28 | // UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, | |
29 | // SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, | |
30 | // ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF | |
31 | // THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF | |
32 | // SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY | |
33 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
34 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE | |
35 | // PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF | |
36 | // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, | |
37 | // UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | |
38 | ||
39 | package org.argouml.persistence; | |
40 | ||
41 | import java.io.Reader; | |
42 | import java.util.ArrayList; | |
43 | import java.util.List; | |
44 | import java.util.logging.Level; | |
45 | import java.util.logging.Logger; | |
46 | ||
47 | import org.argouml.kernel.Project; | |
48 | import org.argouml.kernel.ProjectSettings; | |
49 | import org.argouml.notation.NotationSettings; | |
50 | import org.argouml.uml.diagram.DiagramSettings; | |
51 | import org.xml.sax.InputSource; | |
52 | import org.xml.sax.SAXException; | |
53 | ||
54 | ||
55 | /** | |
56 | * Parser for ArgoUML project description file (.argo). | |
57 | */ | |
58 | class ArgoParser extends SAXParserBase { | |
59 | ||
60 | /** | |
61 | * Logger. | |
62 | */ | |
63 | private static final Logger LOG = | |
64 | Logger.getLogger(ArgoParser.class.getName()); | |
65 | ||
66 | private Project project; | |
67 | ||
68 | private ProjectSettings ps; | |
69 | ||
70 | private DiagramSettings diagramDefaults; | |
71 | ||
72 | private NotationSettings notationSettings; | |
73 | ||
74 | private ArgoTokenTable tokens = new ArgoTokenTable(); | |
75 | ||
76 | private List<String> memberList = new ArrayList<String>(); | |
77 | ||
78 | /** | |
79 | * The constructor. | |
80 | * | |
81 | */ | |
82 | public ArgoParser() { | |
83 | super(); | |
84 | } | |
85 | ||
86 | /** | |
87 | * @param theProject the project to populate | |
88 | * @param source the input source | |
89 | * @throws SAXException on error when parsing xml | |
90 | */ | |
91 | public void readProject(Project theProject, InputSource source) | |
92 | throws SAXException { | |
93 | ||
94 |
1
1. readProject : negated conditional → NO_COVERAGE |
if (source == null) { |
95 | throw new IllegalArgumentException( | |
96 | "An InputSource must be supplied"); | |
97 | } | |
98 | ||
99 |
1
1. readProject : removed call to org/argouml/persistence/ArgoParser::preRead → NO_COVERAGE |
preRead(theProject); |
100 | ||
101 | try { | |
102 |
1
1. readProject : removed call to org/argouml/persistence/ArgoParser::parse → NO_COVERAGE |
parse(source); |
103 | } catch (SAXException e) { | |
104 |
1
1. readProject : removed call to org/argouml/persistence/ArgoParser::logError → NO_COVERAGE |
logError(source.toString(), e); |
105 | throw e; | |
106 | } | |
107 | } | |
108 | ||
109 | /** | |
110 | * @param theProject the project to populate | |
111 | * @param reader the reader | |
112 | * @throws SAXException on error when parsing xml | |
113 | */ | |
114 | public void readProject(Project theProject, Reader reader) | |
115 | throws SAXException { | |
116 | ||
117 |
1
1. readProject : negated conditional → NO_COVERAGE |
if (reader == null) { |
118 | throw new IllegalArgumentException( | |
119 | "A reader must be supplied"); | |
120 | } | |
121 | ||
122 |
1
1. readProject : removed call to org/argouml/persistence/ArgoParser::preRead → NO_COVERAGE |
preRead(theProject); |
123 | ||
124 | try { | |
125 |
1
1. readProject : removed call to org/argouml/persistence/ArgoParser::parse → NO_COVERAGE |
parse(reader); |
126 | } catch (SAXException e) { | |
127 |
1
1. readProject : removed call to org/argouml/persistence/ArgoParser::logError → NO_COVERAGE |
logError(reader.toString(), e); |
128 | throw e; | |
129 | } | |
130 | } | |
131 | ||
132 | private void preRead(Project theProject) { | |
133 | LOG.log(Level.INFO, | |
134 | "=======================================\n" | |
135 | + "== READING PROJECT {0}", | |
136 | theProject); | |
137 | ||
138 | project = theProject; | |
139 | ps = project.getProjectSettings(); | |
140 | diagramDefaults = ps.getDefaultDiagramSettings(); | |
141 | notationSettings = ps.getNotationSettings(); | |
142 | } | |
143 | ||
144 | private void logError(String projectName, SAXException e) { | |
145 | LOG.log(Level.SEVERE, | |
146 | "Exception reading project ================"+projectName, e); | |
147 | } | |
148 | ||
149 | /** | |
150 | * Get the project to which the URI is to be parsed. | |
151 | * @return the project | |
152 | */ | |
153 | public Project getProject() { | |
154 |
1
1. getProject : mutated return of Object value for org/argouml/persistence/ArgoParser::getProject to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return project; |
155 | } | |
156 | ||
157 | /** | |
158 | * Set the project to which the URI is to be parsed. | |
159 | * @param newProj the project | |
160 | */ | |
161 | public void setProject(Project newProj) { | |
162 | project = newProj; | |
163 | ps = project.getProjectSettings(); | |
164 | } | |
165 | ||
166 | /* | |
167 | * @see org.argouml.persistence.SAXParserBase#handleStartElement( | |
168 | * org.argouml.persistence.XMLElement) | |
169 | */ | |
170 | public void handleStartElement(XMLElement e) throws SAXException { | |
171 | if (DBG) { | |
172 | LOG.log(Level.FINE, | |
173 | "NOTE: ArgoParser handleStartTag: {0}", e.getName()); | |
174 | } | |
175 | switch (tokens.toToken(e.getName(), true)) { | |
176 | case ArgoTokenTable.TOKEN_ARGO: | |
177 |
1
1. handleStartElement : removed call to org/argouml/persistence/ArgoParser::handleArgo → NO_COVERAGE |
handleArgo(e); |
178 | break; | |
179 | case ArgoTokenTable.TOKEN_DOCUMENTATION: | |
180 |
1
1. handleStartElement : removed call to org/argouml/persistence/ArgoParser::handleDocumentation → NO_COVERAGE |
handleDocumentation(e); |
181 | break; | |
182 | case ArgoTokenTable.TOKEN_SETTINGS: | |
183 |
1
1. handleStartElement : removed call to org/argouml/persistence/ArgoParser::handleSettings → NO_COVERAGE |
handleSettings(e); |
184 | break; | |
185 | default: | |
186 | if (DBG) { | |
187 | LOG.log(Level.WARNING, "WARNING: unknown tag:" + e.getName()); | |
188 | } | |
189 | break; | |
190 | } | |
191 | } | |
192 | ||
193 | /* | |
194 | * @see org.argouml.persistence.SAXParserBase#handleEndElement( | |
195 | * org.argouml.persistence.XMLElement) | |
196 | */ | |
197 | @SuppressWarnings("deprecation") | |
198 | public void handleEndElement(XMLElement e) throws SAXException { | |
199 | if (DBG) { | |
200 | LOG.log(Level.FINE, | |
201 | "NOTE: ArgoParser handleEndTag: {0}", e.getName()); | |
202 | } | |
203 | switch (tokens.toToken(e.getName(), false)) { | |
204 | case ArgoTokenTable.TOKEN_MEMBER: | |
205 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleMember → NO_COVERAGE |
handleMember(e); |
206 | break; | |
207 | case ArgoTokenTable.TOKEN_AUTHORNAME: | |
208 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleAuthorName → NO_COVERAGE |
handleAuthorName(e); |
209 | break; | |
210 | case ArgoTokenTable.TOKEN_AUTHOREMAIL: | |
211 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleAuthorEmail → NO_COVERAGE |
handleAuthorEmail(e); |
212 | break; | |
213 | case ArgoTokenTable.TOKEN_VERSION: | |
214 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleVersion → NO_COVERAGE |
handleVersion(e); |
215 | break; | |
216 | case ArgoTokenTable.TOKEN_DESCRIPTION: | |
217 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleDescription → NO_COVERAGE |
handleDescription(e); |
218 | break; | |
219 | case ArgoTokenTable.TOKEN_SEARCHPATH: | |
220 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleSearchpath → NO_COVERAGE |
handleSearchpath(e); |
221 | break; | |
222 | case ArgoTokenTable.TOKEN_HISTORYFILE: | |
223 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleHistoryfile → NO_COVERAGE |
handleHistoryfile(e); |
224 | break; | |
225 | case ArgoTokenTable.TOKEN_NOTATIONLANGUAGE: | |
226 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleNotationLanguage → NO_COVERAGE |
handleNotationLanguage(e); |
227 | break; | |
228 | case ArgoTokenTable.TOKEN_SHOWBOLDNAMES: | |
229 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowBoldNames → NO_COVERAGE |
handleShowBoldNames(e); |
230 | break; | |
231 | case ArgoTokenTable.TOKEN_USEGUILLEMOTS: | |
232 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleUseGuillemots → NO_COVERAGE |
handleUseGuillemots(e); |
233 | break; | |
234 | case ArgoTokenTable.TOKEN_SHOWVISIBILITY: | |
235 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowVisibility → NO_COVERAGE |
handleShowVisibility(e); |
236 | break; | |
237 | case ArgoTokenTable.TOKEN_SHOWMULTIPLICITY: | |
238 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowMultiplicity → NO_COVERAGE |
handleShowMultiplicity(e); |
239 | break; | |
240 | case ArgoTokenTable.TOKEN_SHOWINITIALVALUE: | |
241 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowInitialValue → NO_COVERAGE |
handleShowInitialValue(e); |
242 | break; | |
243 | case ArgoTokenTable.TOKEN_SHOWPROPERTIES: | |
244 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowProperties → NO_COVERAGE |
handleShowProperties(e); |
245 | break; | |
246 | case ArgoTokenTable.TOKEN_SHOWTYPES: | |
247 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowTypes → NO_COVERAGE |
handleShowTypes(e); |
248 | break; | |
249 | case ArgoTokenTable.TOKEN_SHOWSTEREOTYPES: | |
250 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowStereotypes → NO_COVERAGE |
handleShowStereotypes(e); |
251 | break; | |
252 | case ArgoTokenTable.TOKEN_SHOWSINGULARMULTIPLICITIES: | |
253 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowSingularMultiplicities → NO_COVERAGE |
handleShowSingularMultiplicities(e); |
254 | break; | |
255 | case ArgoTokenTable.TOKEN_DEFAULTSHADOWWIDTH: | |
256 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleDefaultShadowWidth → NO_COVERAGE |
handleDefaultShadowWidth(e); |
257 | break; | |
258 | case ArgoTokenTable.TOKEN_FONTNAME: | |
259 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleFontName → NO_COVERAGE |
handleFontName(e); |
260 | break; | |
261 | case ArgoTokenTable.TOKEN_FONTSIZE: | |
262 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleFontSize → NO_COVERAGE |
handleFontSize(e); |
263 | break; | |
264 | case ArgoTokenTable.TOKEN_GENERATION_OUTPUT_DIR: | |
265 | // ignored - it shouldn't have been in the project in the 1st place | |
266 | break; | |
267 | case ArgoTokenTable.TOKEN_SHOWASSOCIATIONNAMES: | |
268 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleShowAssociationNames → NO_COVERAGE |
handleShowAssociationNames(e); |
269 | break; | |
270 | case ArgoTokenTable.TOKEN_HIDEBIDIRECTIONALARROWS: | |
271 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleHideBidirectionalArrows → NO_COVERAGE |
handleHideBidirectionalArrows(e); |
272 | break; | |
273 | case ArgoTokenTable.TOKEN_ACTIVE_DIAGRAM: | |
274 |
1
1. handleEndElement : removed call to org/argouml/persistence/ArgoParser::handleActiveDiagram → NO_COVERAGE |
handleActiveDiagram(e); |
275 | break; | |
276 | default: | |
277 | if (DBG) { | |
278 | LOG.log(Level.WARNING, | |
279 | "WARNING: unknown end tag:" + e.getName()); | |
280 | } | |
281 | break; | |
282 | } | |
283 | } | |
284 | ||
285 | /* | |
286 | * @see org.argouml.persistence.SAXParserBase#isElementOfInterest(String) | |
287 | */ | |
288 | @Override | |
289 | protected boolean isElementOfInterest(String name) { | |
290 |
1
1. isElementOfInterest : replaced return of integer sized value with (x == 0 ? 1 : 0) → NO_COVERAGE |
return tokens.contains(name); |
291 | } | |
292 | ||
293 | /** | |
294 | * @param e the element | |
295 | */ | |
296 | protected void handleArgo(@SuppressWarnings("unused") XMLElement e) { | |
297 | /* do nothing */ | |
298 | } | |
299 | ||
300 | /** | |
301 | * @param e the element | |
302 | */ | |
303 | protected void handleDocumentation( | |
304 | @SuppressWarnings("unused") XMLElement e) { | |
305 | /* do nothing */ | |
306 | } | |
307 | ||
308 | /** | |
309 | * @param e the element | |
310 | */ | |
311 | protected void handleSettings(@SuppressWarnings("unused") XMLElement e) { | |
312 | /* do nothing */ | |
313 | } | |
314 | ||
315 | /** | |
316 | * @param e the element | |
317 | */ | |
318 | protected void handleAuthorName(XMLElement e) { | |
319 | String authorname = e.getText().trim(); | |
320 |
1
1. handleAuthorName : removed call to org/argouml/kernel/Project::setAuthorname → NO_COVERAGE |
project.setAuthorname(authorname); |
321 | } | |
322 | ||
323 | /** | |
324 | * @param e the element | |
325 | */ | |
326 | protected void handleAuthorEmail(XMLElement e) { | |
327 | String authoremail = e.getText().trim(); | |
328 |
1
1. handleAuthorEmail : removed call to org/argouml/kernel/Project::setAuthoremail → NO_COVERAGE |
project.setAuthoremail(authoremail); |
329 | } | |
330 | ||
331 | /** | |
332 | * @param e the element | |
333 | */ | |
334 | protected void handleVersion(XMLElement e) { | |
335 | String version = e.getText().trim(); | |
336 |
1
1. handleVersion : removed call to org/argouml/kernel/Project::setVersion → NO_COVERAGE |
project.setVersion(version); |
337 | } | |
338 | ||
339 | /** | |
340 | * @param e the element | |
341 | */ | |
342 | protected void handleDescription(XMLElement e) { | |
343 | String description = e.getText().trim(); | |
344 |
1
1. handleDescription : removed call to org/argouml/kernel/Project::setDescription → NO_COVERAGE |
project.setDescription(description); |
345 | } | |
346 | ||
347 | /** | |
348 | * @param e the element | |
349 | */ | |
350 | protected void handleSearchpath(XMLElement e) { | |
351 | String searchpath = e.getAttribute("href").trim(); | |
352 |
1
1. handleSearchpath : removed call to org/argouml/kernel/Project::addSearchPath → NO_COVERAGE |
project.addSearchPath(searchpath); |
353 | } | |
354 | ||
355 | /** | |
356 | * @param e the element | |
357 | * @throws SAXException on any error parsing the member XML. | |
358 | */ | |
359 | protected void handleMember(XMLElement e) throws SAXException { | |
360 |
1
1. handleMember : negated conditional → NO_COVERAGE |
if (e == null) { |
361 | throw new SAXException("XML element is null"); | |
362 | } | |
363 | String type = e.getAttribute("type"); | |
364 | memberList.add(type); | |
365 | } | |
366 | ||
367 | /** | |
368 | * @param e the element | |
369 | */ | |
370 | protected void handleHistoryfile(XMLElement e) { | |
371 |
1
1. handleHistoryfile : negated conditional → NO_COVERAGE |
if (e.getAttribute("name") == null) { |
372 | return; | |
373 | } | |
374 | String historyfile = e.getAttribute("name").trim(); | |
375 |
1
1. handleHistoryfile : removed call to org/argouml/kernel/Project::setHistoryFile → NO_COVERAGE |
project.setHistoryFile(historyfile); |
376 | } | |
377 | ||
378 | /** | |
379 | * @param e the element | |
380 | */ | |
381 | protected void handleNotationLanguage(XMLElement e) { | |
382 | String language = e.getText().trim(); | |
383 | boolean success = ps.setNotationLanguage(language); | |
384 | /* TODO: Here we should e.g. show the user a message that | |
385 | * the loaded project was using a Notation that is not | |
386 | * currently available and a fall back on the default Notation | |
387 | * was done. Maybe this can be implemented in the | |
388 | * PersistenceManager? */ | |
389 | } | |
390 | ||
391 | /** | |
392 | * @param e the element | |
393 | */ | |
394 | protected void handleShowBoldNames(XMLElement e) { | |
395 | String ug = e.getText().trim(); | |
396 |
1
1. handleShowBoldNames : removed call to org/argouml/uml/diagram/DiagramSettings::setShowBoldNames → NO_COVERAGE |
diagramDefaults.setShowBoldNames(Boolean.parseBoolean(ug)); |
397 | } | |
398 | ||
399 | /** | |
400 | * @param e the element | |
401 | */ | |
402 | protected void handleUseGuillemots(XMLElement e) { | |
403 | String ug = e.getText().trim(); | |
404 |
1
1. handleUseGuillemots : removed call to org/argouml/kernel/ProjectSettings::setUseGuillemots → NO_COVERAGE |
ps.setUseGuillemots(ug); |
405 | } | |
406 | ||
407 | /** | |
408 | * @param e the element | |
409 | */ | |
410 | protected void handleShowVisibility(XMLElement e) { | |
411 | String showVisibility = e.getText().trim(); | |
412 |
1
1. handleShowVisibility : removed call to org/argouml/notation/NotationSettings::setShowVisibilities → NO_COVERAGE |
notationSettings.setShowVisibilities( |
413 | Boolean.parseBoolean(showVisibility)); | |
414 | } | |
415 | ||
416 | /** | |
417 | * @param e the element | |
418 | */ | |
419 | protected void handleShowMultiplicity(XMLElement e) { | |
420 | String showMultiplicity = e.getText().trim(); | |
421 |
1
1. handleShowMultiplicity : removed call to org/argouml/notation/NotationSettings::setShowMultiplicities → NO_COVERAGE |
notationSettings.setShowMultiplicities( |
422 | Boolean.parseBoolean(showMultiplicity)); | |
423 | } | |
424 | ||
425 | /** | |
426 | * @param e the element | |
427 | */ | |
428 | protected void handleShowInitialValue(XMLElement e) { | |
429 | String showInitialValue = e.getText().trim(); | |
430 |
1
1. handleShowInitialValue : removed call to org/argouml/notation/NotationSettings::setShowInitialValues → NO_COVERAGE |
notationSettings.setShowInitialValues( |
431 | Boolean.parseBoolean(showInitialValue)); | |
432 | } | |
433 | ||
434 | /** | |
435 | * @param e the element | |
436 | */ | |
437 | protected void handleShowProperties(XMLElement e) { | |
438 | String showproperties = e.getText().trim(); | |
439 |
1
1. handleShowProperties : removed call to org/argouml/notation/NotationSettings::setShowProperties → NO_COVERAGE |
notationSettings.setShowProperties( |
440 | Boolean.parseBoolean(showproperties)); | |
441 | } | |
442 | ||
443 | /** | |
444 | * @param e the element | |
445 | */ | |
446 | protected void handleShowTypes(XMLElement e) { | |
447 | String showTypes = e.getText().trim(); | |
448 |
1
1. handleShowTypes : removed call to org/argouml/notation/NotationSettings::setShowTypes → NO_COVERAGE |
notationSettings.setShowTypes(Boolean.parseBoolean(showTypes)); |
449 | } | |
450 | ||
451 | /** | |
452 | * @param e the element | |
453 | */ | |
454 | protected void handleShowStereotypes(XMLElement e) { | |
455 | String showStereotypes = e.getText().trim(); | |
456 |
1
1. handleShowStereotypes : removed call to org/argouml/kernel/ProjectSettings::setShowStereotypes → NO_COVERAGE |
ps.setShowStereotypes(Boolean.parseBoolean(showStereotypes)); |
457 | } | |
458 | ||
459 | /** | |
460 | * @param e the element | |
461 | */ | |
462 | protected void handleShowSingularMultiplicities(XMLElement e) { | |
463 | String showSingularMultiplicities = e.getText().trim(); | |
464 |
1
1. handleShowSingularMultiplicities : removed call to org/argouml/notation/NotationSettings::setShowSingularMultiplicities → NO_COVERAGE |
notationSettings.setShowSingularMultiplicities( |
465 | Boolean.parseBoolean(showSingularMultiplicities)); | |
466 | } | |
467 | ||
468 | /** | |
469 | * @param e the element | |
470 | */ | |
471 | protected void handleDefaultShadowWidth(XMLElement e) { | |
472 | String dsw = e.getText().trim(); | |
473 |
1
1. handleDefaultShadowWidth : removed call to org/argouml/uml/diagram/DiagramSettings::setDefaultShadowWidth → NO_COVERAGE |
diagramDefaults.setDefaultShadowWidth(Integer.parseInt(dsw)); |
474 | } | |
475 | ||
476 | /** | |
477 | * @param e the element | |
478 | */ | |
479 | protected void handleFontName(XMLElement e) { | |
480 | String dsw = e.getText().trim(); | |
481 |
1
1. handleFontName : removed call to org/argouml/uml/diagram/DiagramSettings::setFontName → NO_COVERAGE |
diagramDefaults.setFontName(dsw); |
482 | } | |
483 | ||
484 | /** | |
485 | * @param e the element | |
486 | */ | |
487 | protected void handleFontSize(XMLElement e) { | |
488 | String dsw = e.getText().trim(); | |
489 | try { | |
490 |
1
1. handleFontSize : removed call to org/argouml/uml/diagram/DiagramSettings::setFontSize → NO_COVERAGE |
diagramDefaults.setFontSize(Integer.parseInt(dsw)); |
491 | } catch (NumberFormatException e1) { | |
492 | LOG.log(Level.SEVERE, | |
493 | "NumberFormatException while parsing Font Size", e1); | |
494 | } | |
495 | } | |
496 | ||
497 | /** | |
498 | * @param e the element | |
499 | */ | |
500 | protected void handleShowAssociationNames(XMLElement e) { | |
501 | String showAssociationNames = e.getText().trim(); | |
502 |
1
1. handleShowAssociationNames : removed call to org/argouml/notation/NotationSettings::setShowAssociationNames → NO_COVERAGE |
notationSettings.setShowAssociationNames( |
503 | Boolean.parseBoolean(showAssociationNames)); | |
504 | } | |
505 | ||
506 | /** | |
507 | * @param e the element | |
508 | */ | |
509 | protected void handleHideBidirectionalArrows(XMLElement e) { | |
510 | String hideBidirectionalArrows = e.getText().trim(); | |
511 | // NOTE: For historical reasons true == hide, so we need to invert | |
512 | // the sense of this | |
513 |
2
1. handleHideBidirectionalArrows : negated conditional → NO_COVERAGE 2. handleHideBidirectionalArrows : removed call to org/argouml/uml/diagram/DiagramSettings::setShowBidirectionalArrows → NO_COVERAGE |
diagramDefaults.setShowBidirectionalArrows(! |
514 | Boolean.parseBoolean(hideBidirectionalArrows)); | |
515 | } | |
516 | ||
517 | ||
518 | protected void handleActiveDiagram(XMLElement e) { | |
519 | /* At this stage during loading, the diagrams are | |
520 | * not created yet - so we have to store this name for later use. */ | |
521 |
1
1. handleActiveDiagram : removed call to org/argouml/kernel/Project::setSavedDiagramName → NO_COVERAGE |
project.setSavedDiagramName(e.getText().trim()); |
522 | } | |
523 | ||
524 | /** | |
525 | * Get the number of diagram members read. | |
526 | * @return the number of diagram members read. | |
527 | */ | |
528 | public List<String> getMemberList() { | |
529 |
1
1. getMemberList : mutated return of Object value for org/argouml/persistence/ArgoParser::getMemberList to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return memberList; |
530 | } | |
531 | } | |
Mutations | ||
94 |
1.1 |
|
99 |
1.1 |
|
102 |
1.1 |
|
104 |
1.1 |
|
117 |
1.1 |
|
122 |
1.1 |
|
125 |
1.1 |
|
127 |
1.1 |
|
154 |
1.1 |
|
177 |
1.1 |
|
180 |
1.1 |
|
183 |
1.1 |
|
205 |
1.1 |
|
208 |
1.1 |
|
211 |
1.1 |
|
214 |
1.1 |
|
217 |
1.1 |
|
220 |
1.1 |
|
223 |
1.1 |
|
226 |
1.1 |
|
229 |
1.1 |
|
232 |
1.1 |
|
235 |
1.1 |
|
238 |
1.1 |
|
241 |
1.1 |
|
244 |
1.1 |
|
247 |
1.1 |
|
250 |
1.1 |
|
253 |
1.1 |
|
256 |
1.1 |
|
259 |
1.1 |
|
262 |
1.1 |
|
268 |
1.1 |
|
271 |
1.1 |
|
274 |
1.1 |
|
290 |
1.1 |
|
320 |
1.1 |
|
328 |
1.1 |
|
336 |
1.1 |
|
344 |
1.1 |
|
352 |
1.1 |
|
360 |
1.1 |
|
371 |
1.1 |
|
375 |
1.1 |
|
396 |
1.1 |
|
404 |
1.1 |
|
412 |
1.1 |
|
421 |
1.1 |
|
430 |
1.1 |
|
439 |
1.1 |
|
448 |
1.1 |
|
456 |
1.1 |
|
464 |
1.1 |
|
473 |
1.1 |
|
481 |
1.1 |
|
490 |
1.1 |
|
502 |
1.1 |
|
513 |
1.1 2.2 |
|
521 |
1.1 |
|
529 |
1.1 |