1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
package org.argouml.uml.diagram; |
40 | |
|
41 | |
import java.beans.PropertyChangeEvent; |
42 | |
import java.beans.PropertyChangeListener; |
43 | |
import java.beans.PropertyVetoException; |
44 | |
import java.beans.VetoableChangeListener; |
45 | |
import java.util.ArrayList; |
46 | |
import java.util.Iterator; |
47 | |
import java.util.List; |
48 | |
|
49 | |
import org.apache.log4j.Logger; |
50 | |
import org.argouml.application.events.ArgoDiagramAppearanceEvent; |
51 | |
import org.argouml.application.events.ArgoEventPump; |
52 | |
import org.argouml.application.events.ArgoEventTypes; |
53 | |
import org.argouml.application.events.ArgoNotationEvent; |
54 | |
import org.argouml.kernel.Project; |
55 | |
import org.argouml.kernel.ProjectManager; |
56 | |
import org.argouml.model.CoreHelper; |
57 | |
import org.argouml.model.DeleteInstanceEvent; |
58 | |
import org.argouml.model.InvalidElementException; |
59 | |
import org.argouml.model.Model; |
60 | |
import org.argouml.model.ModelManagementHelper; |
61 | |
import org.argouml.uml.diagram.activity.ui.FigPool; |
62 | |
import org.argouml.uml.diagram.static_structure.ui.FigComment; |
63 | |
import org.argouml.uml.diagram.ui.ArgoFig; |
64 | |
import org.argouml.uml.diagram.ui.FigEdgeModelElement; |
65 | |
import org.argouml.uml.diagram.ui.FigNodeModelElement; |
66 | |
import org.argouml.util.EnumerationIterator; |
67 | |
import org.argouml.util.IItemUID; |
68 | |
import org.argouml.util.ItemUID; |
69 | |
import org.tigris.gef.base.Diagram; |
70 | |
import org.tigris.gef.base.Editor; |
71 | |
import org.tigris.gef.base.LayerPerspective; |
72 | |
import org.tigris.gef.graph.GraphModel; |
73 | |
import org.tigris.gef.graph.MutableGraphSupport; |
74 | |
import org.tigris.gef.presentation.Fig; |
75 | |
import org.tigris.gef.presentation.FigEdge; |
76 | |
import org.tigris.gef.presentation.FigGroup; |
77 | |
import org.tigris.gef.presentation.FigNode; |
78 | |
import org.tigris.gef.undo.UndoManager; |
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
public abstract class ArgoDiagramImpl extends Diagram |
104 | |
implements PropertyChangeListener, VetoableChangeListener, ArgoDiagram, |
105 | |
IItemUID { |
106 | |
|
107 | |
private ItemUID id; |
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
private Project project; |
113 | |
|
114 | |
protected Object namespace; |
115 | |
|
116 | |
private DiagramSettings settings; |
117 | |
|
118 | 900 | private static final Logger LOG = Logger.getLogger(ArgoDiagramImpl.class); |
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | |
|
128 | |
@Deprecated |
129 | |
public ArgoDiagramImpl() { |
130 | 76 | super(); |
131 | |
|
132 | |
|
133 | |
|
134 | 76 | getLayer().getGraphModel().removeGraphEventListener(getLayer()); |
135 | |
|
136 | 76 | constructorInit(); |
137 | 76 | } |
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
|
146 | |
|
147 | |
@Deprecated |
148 | |
public ArgoDiagramImpl(String diagramName) { |
149 | |
|
150 | 0 | super(diagramName); |
151 | |
try { |
152 | 0 | setName(diagramName); |
153 | 0 | } catch (PropertyVetoException pve) { } |
154 | 0 | constructorInit(); |
155 | 0 | } |
156 | |
|
157 | |
|
158 | |
|
159 | |
|
160 | |
|
161 | |
|
162 | |
|
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
public ArgoDiagramImpl(String name, GraphModel graphModel, |
168 | |
LayerPerspective layer) { |
169 | 2040 | super(name, graphModel, layer); |
170 | |
|
171 | |
try { |
172 | 2040 | setName(name); |
173 | 0 | } catch (PropertyVetoException pve) { |
174 | 2040 | } |
175 | 2040 | constructorInit(); |
176 | 2040 | } |
177 | |
|
178 | |
|
179 | |
|
180 | |
|
181 | |
|
182 | |
private void constructorInit() { |
183 | |
|
184 | |
|
185 | 2116 | Project project = ProjectManager.getManager().getCurrentProject(); |
186 | 2116 | if (project != null) { |
187 | 316 | settings = project.getProjectSettings().getDefaultDiagramSettings(); |
188 | |
} |
189 | |
|
190 | |
|
191 | 2116 | if (!(UndoManager.getInstance() instanceof DiagramUndoManager)) { |
192 | 900 | UndoManager.setInstance(new DiagramUndoManager()); |
193 | 900 | LOG.info("Setting Diagram undo manager"); |
194 | |
} else { |
195 | 1216 | LOG.info("Diagram undo manager already set"); |
196 | |
} |
197 | |
|
198 | |
|
199 | |
|
200 | 2116 | ArgoEventPump.addListener(ArgoEventTypes.ANY_NOTATION_EVENT, this); |
201 | 2116 | ArgoEventPump.addListener( |
202 | |
ArgoEventTypes.ANY_DIAGRAM_APPEARANCE_EVENT, this); |
203 | |
|
204 | |
|
205 | 2116 | addVetoableChangeListener(this); |
206 | 2116 | } |
207 | |
|
208 | |
|
209 | |
public void setName(String n) throws PropertyVetoException { |
210 | 4292 | super.setName(n); |
211 | 4292 | MutableGraphSupport.enableSaveAction(); |
212 | 4292 | } |
213 | |
|
214 | |
|
215 | |
public void setItemUID(ItemUID i) { |
216 | 0 | id = i; |
217 | 0 | } |
218 | |
|
219 | |
|
220 | |
public ItemUID getItemUID() { |
221 | 0 | return id; |
222 | |
} |
223 | |
|
224 | |
|
225 | |
|
226 | |
|
227 | |
|
228 | |
static final long serialVersionUID = -401219134410459387L; |
229 | |
|
230 | |
|
231 | |
public String getVetoMessage(String propertyName) { |
232 | 0 | if (propertyName.equals("name")) { |
233 | 0 | return "Name of diagram may not exist already"; |
234 | |
} |
235 | 0 | return null; |
236 | |
} |
237 | |
|
238 | |
|
239 | |
public Fig getContainingFig(Object obj) { |
240 | 2598 | Fig fig = super.presentationFor(obj); |
241 | 2598 | if (fig == null && Model.getFacade().isAUMLElement(obj)) { |
242 | |
|
243 | |
|
244 | 0 | if (Model.getFacade().isAOperation(obj) |
245 | |
|| Model.getFacade().isAReception(obj) |
246 | |
|| Model.getFacade().isAAttribute(obj)) { |
247 | |
|
248 | |
|
249 | 0 | return presentationFor(Model.getFacade().getOwner(obj)); |
250 | |
} |
251 | |
} |
252 | 2598 | return fig; |
253 | |
} |
254 | |
|
255 | |
|
256 | |
public void damage() { |
257 | 26 | if (getLayer() != null && getLayer().getEditors() != null) { |
258 | 26 | Iterator it = getLayer().getEditors().iterator(); |
259 | 39 | while (it.hasNext()) { |
260 | 13 | ((Editor) it.next()).damageAll(); |
261 | |
} |
262 | |
} |
263 | 26 | } |
264 | |
|
265 | |
|
266 | |
public List getEdges() { |
267 | 148 | if (getGraphModel() != null) { |
268 | 148 | return getGraphModel().getEdges(); |
269 | |
} |
270 | 0 | return super.getEdges(); |
271 | |
} |
272 | |
|
273 | |
|
274 | |
public List getNodes() { |
275 | 148 | if (getGraphModel() != null) { |
276 | 148 | return getGraphModel().getNodes(); |
277 | |
} |
278 | 0 | return super.getNodes(); |
279 | |
} |
280 | |
|
281 | |
|
282 | |
public String toString() { |
283 | 9143 | return "Diagram: " + getName(); |
284 | |
} |
285 | |
|
286 | |
|
287 | |
public String repair() { |
288 | 0 | StringBuffer report = new StringBuffer(500); |
289 | |
|
290 | |
boolean faultFixed; |
291 | |
do { |
292 | 0 | faultFixed = false; |
293 | 0 | List<Fig> figs = new ArrayList<Fig>(getLayer().getContentsNoEdges()); |
294 | 0 | for (Fig f : figs) { |
295 | 0 | if (repairFig(f, report)) { |
296 | 0 | faultFixed = true; |
297 | |
} |
298 | |
} |
299 | 0 | figs = new ArrayList<Fig>(getLayer().getContentsEdgesOnly()); |
300 | 0 | for (Fig f : figs) { |
301 | 0 | if (repairFig(f, report)) { |
302 | 0 | faultFixed = true; |
303 | |
} |
304 | |
} |
305 | 0 | } while (faultFixed); |
306 | |
|
307 | 0 | return report.toString(); |
308 | |
} |
309 | |
|
310 | |
private boolean repairFig(Fig f, StringBuffer report) { |
311 | 0 | LOG.info("Checking " + figDescription(f) + f.getOwner()); |
312 | 0 | boolean faultFixed = false; |
313 | 0 | String figDescription = null; |
314 | |
|
315 | |
|
316 | |
|
317 | 0 | if (!getLayer().equals(f.getLayer())) { |
318 | 0 | if (figDescription == null) { |
319 | 0 | figDescription = figDescription(f); |
320 | 0 | report.append(figDescription); |
321 | |
} |
322 | |
|
323 | |
|
324 | 0 | if (f.getLayer() == null) { |
325 | 0 | report.append("-- Fixed: layer was null\n"); |
326 | |
} else { |
327 | 0 | report.append("-- Fixed: refered to wrong layer\n"); |
328 | |
} |
329 | 0 | faultFixed = true; |
330 | |
|
331 | 0 | f.setLayer(getLayer()); |
332 | |
} |
333 | |
|
334 | |
|
335 | 0 | if (!f.isVisible()) { |
336 | 0 | if (figDescription == null) { |
337 | 0 | figDescription = figDescription(f); |
338 | 0 | report.append(figDescription); |
339 | |
} |
340 | |
|
341 | 0 | report.append("-- Fixed: a Fig must be visible\n"); |
342 | 0 | faultFixed = true; |
343 | |
|
344 | 0 | f.setVisible(true); |
345 | |
} |
346 | |
|
347 | 0 | if (f instanceof FigEdge) { |
348 | |
|
349 | |
|
350 | 0 | FigEdge fe = (FigEdge) f; |
351 | 0 | FigNode destFig = fe.getDestFigNode(); |
352 | 0 | FigNode sourceFig = fe.getSourceFigNode(); |
353 | |
|
354 | 0 | if (destFig == null) { |
355 | 0 | if (figDescription == null) { |
356 | 0 | figDescription = figDescription(f); |
357 | 0 | report.append(figDescription); |
358 | |
} |
359 | 0 | faultFixed = true; |
360 | 0 | report.append("-- Removed: as it has no dest Fig\n"); |
361 | 0 | f.removeFromDiagram(); |
362 | 0 | } else if (sourceFig == null) { |
363 | 0 | if (figDescription == null) { |
364 | 0 | figDescription = figDescription(f); |
365 | 0 | report.append(figDescription); |
366 | |
} |
367 | 0 | faultFixed = true; |
368 | 0 | report.append("-- Removed: as it has no source Fig\n"); |
369 | 0 | f.removeFromDiagram(); |
370 | 0 | } else if (sourceFig.getOwner() == null) { |
371 | 0 | if (figDescription == null) { |
372 | 0 | figDescription = figDescription(f); |
373 | 0 | report.append(figDescription); |
374 | |
} |
375 | 0 | faultFixed = true; |
376 | 0 | report.append("-- Removed: as its source Fig has no owner\n"); |
377 | 0 | f.removeFromDiagram(); |
378 | 0 | } else if (destFig.getOwner() == null) { |
379 | 0 | if (figDescription == null) { |
380 | 0 | figDescription = figDescription(f); |
381 | 0 | report.append(figDescription); |
382 | |
} |
383 | 0 | faultFixed = true; |
384 | 0 | report.append( |
385 | |
"-- Removed: as its destination Fig has no owner\n"); |
386 | 0 | f.removeFromDiagram(); |
387 | 0 | } else if (Model.getUmlFactory().isRemoved( |
388 | |
sourceFig.getOwner())) { |
389 | 0 | if (figDescription == null) { |
390 | 0 | figDescription = figDescription(f); |
391 | 0 | report.append(figDescription); |
392 | |
} |
393 | 0 | faultFixed = true; |
394 | 0 | report.append("-- Removed: as its source Figs owner is no " |
395 | |
+ "longer in the repository\n"); |
396 | 0 | f.removeFromDiagram(); |
397 | 0 | } else if (Model.getUmlFactory().isRemoved( |
398 | |
destFig.getOwner())) { |
399 | 0 | if (figDescription == null) { |
400 | 0 | figDescription = figDescription(f); |
401 | 0 | report.append(figDescription); |
402 | |
} |
403 | 0 | faultFixed = true; |
404 | 0 | report.append("-- Removed: as its destination Figs owner " |
405 | |
+ "is no longer in the repository\n"); |
406 | 0 | f.removeFromDiagram(); |
407 | |
} |
408 | 0 | } else if ((f instanceof FigNode || f instanceof FigEdge) |
409 | |
&& f.getOwner() == null && !(f instanceof FigPool)) { |
410 | 0 | if (figDescription == null) { |
411 | 0 | figDescription = figDescription(f); |
412 | 0 | report.append(figDescription); |
413 | |
} |
414 | |
|
415 | |
|
416 | 0 | faultFixed = true; |
417 | 0 | report.append("-- Removed: owner was null\n"); |
418 | |
|
419 | 0 | f.removeFromDiagram(); |
420 | 0 | } else if ((f instanceof FigNode || f instanceof FigEdge) |
421 | |
&& Model.getFacade().isAUMLElement(f.getOwner()) |
422 | |
&& Model.getUmlFactory().isRemoved(f.getOwner())) { |
423 | 0 | if (figDescription == null) { |
424 | 0 | figDescription = figDescription(f); |
425 | 0 | report.append(figDescription); |
426 | |
} |
427 | |
|
428 | |
|
429 | 0 | faultFixed = true; |
430 | 0 | report.append( |
431 | |
"-- Removed: model element no longer in the repository\n"); |
432 | |
|
433 | 0 | f.removeFromDiagram(); |
434 | 0 | } else if (f instanceof FigGroup && !(f instanceof FigNode)) { |
435 | 0 | if (figDescription == null) { |
436 | 0 | figDescription = figDescription(f); |
437 | 0 | report.append(figDescription); |
438 | |
} |
439 | |
|
440 | |
|
441 | |
|
442 | 0 | faultFixed = true; |
443 | 0 | report.append( |
444 | |
"-- Removed: a FigGroup should not be on the diagram\n"); |
445 | |
|
446 | 0 | f.removeFromDiagram(); |
447 | |
} |
448 | |
|
449 | 0 | return faultFixed; |
450 | |
} |
451 | |
|
452 | |
|
453 | |
|
454 | |
|
455 | |
|
456 | |
|
457 | |
|
458 | |
|
459 | |
|
460 | |
|
461 | |
|
462 | |
|
463 | |
|
464 | |
|
465 | |
|
466 | |
|
467 | |
private String figDescription(Fig f) { |
468 | 0 | String description = "\n" + f.getClass().getName(); |
469 | 0 | if (f instanceof FigComment) { |
470 | 0 | description += " \"" + ((FigComment) f).getBody() + "\""; |
471 | 0 | } else if (f instanceof FigNodeModelElement) { |
472 | 0 | description += " \"" + ((FigNodeModelElement) f).getName() + "\""; |
473 | 0 | } else if (f instanceof FigEdgeModelElement) { |
474 | 0 | FigEdgeModelElement fe = (FigEdgeModelElement) f; |
475 | 0 | description += " \"" + fe.getName() + "\""; |
476 | |
String source; |
477 | 0 | if (fe.getSourceFigNode() == null) { |
478 | 0 | source = "(null)"; |
479 | |
} else { |
480 | 0 | source = |
481 | |
((FigNodeModelElement) fe.getSourceFigNode()).getName(); |
482 | |
} |
483 | |
String dest; |
484 | 0 | if (fe.getDestFigNode() == null) { |
485 | 0 | dest = "(null)"; |
486 | |
} else { |
487 | 0 | dest = ((FigNodeModelElement) fe.getDestFigNode()).getName(); |
488 | |
} |
489 | 0 | description += " [" + source + "=>" + dest + "]"; |
490 | |
} |
491 | 0 | return description + "\n"; |
492 | |
} |
493 | |
|
494 | |
|
495 | |
public List presentationsFor(Object obj) { |
496 | 0 | List<Fig> presentations = new ArrayList<Fig>(); |
497 | 0 | int figCount = getLayer().getContents().size(); |
498 | 0 | for (int figIndex = 0; figIndex < figCount; ++figIndex) { |
499 | 0 | Fig fig = (Fig) getLayer().getContents().get(figIndex); |
500 | 0 | if (fig.getOwner() == obj) { |
501 | 0 | presentations.add(fig); |
502 | |
} |
503 | |
} |
504 | |
|
505 | 0 | return presentations; |
506 | |
} |
507 | |
|
508 | |
|
509 | |
public void remove() { |
510 | 174 | List<Fig> contents = new ArrayList<Fig>(getLayer().getContents()); |
511 | 174 | int size = contents.size(); |
512 | 174 | for (int i = 0; i < size; ++i) { |
513 | 0 | Fig f = contents.get(i); |
514 | 0 | f.removeFromDiagram(); |
515 | |
} |
516 | 174 | firePropertyChange("remove", null, null); |
517 | 174 | super.remove(); |
518 | 174 | } |
519 | |
|
520 | |
|
521 | |
public void setProject(Project p) { |
522 | 2116 | project = p; |
523 | 2116 | } |
524 | |
|
525 | |
public Project getProject() { |
526 | 2 | return project; |
527 | |
} |
528 | |
|
529 | |
public abstract void encloserChanged( |
530 | |
FigNode enclosed, FigNode oldEncloser, FigNode newEncloser); |
531 | |
|
532 | |
|
533 | |
|
534 | |
public Object getDependentElement() { |
535 | 37 | return null; |
536 | |
} |
537 | |
|
538 | |
|
539 | |
public Object getNamespace() { |
540 | 15788 | return namespace; |
541 | |
} |
542 | |
|
543 | |
|
544 | |
public void setNamespace(Object ns) { |
545 | 2116 | if (!Model.getFacade().isANamespace(ns)) { |
546 | 0 | LOG.error("Not a namespace"); |
547 | 0 | LOG.error(ns); |
548 | 0 | throw new IllegalArgumentException("Given object not a namespace"); |
549 | |
} |
550 | 2116 | if ((namespace != null) && (namespace != ns)) { |
551 | 0 | Model.getPump().removeModelEventListener(this, namespace); |
552 | |
} |
553 | 2116 | Object oldNs = namespace; |
554 | 2116 | namespace = ns; |
555 | 2116 | firePropertyChange(NAMESPACE_KEY, oldNs, ns); |
556 | |
|
557 | |
|
558 | |
|
559 | |
|
560 | |
|
561 | |
|
562 | 2116 | Model.getPump().addModelEventListener(this, namespace, "remove"); |
563 | 2116 | } |
564 | |
|
565 | |
|
566 | |
public void setModelElementNamespace(Object modelElement, Object ns) { |
567 | 0 | if (modelElement == null) { |
568 | 0 | return; |
569 | |
} |
570 | |
|
571 | |
|
572 | |
|
573 | 0 | if (ns == null) { |
574 | 0 | if (getNamespace() != null) { |
575 | 0 | ns = getNamespace(); |
576 | |
} else { |
577 | 0 | ns = getProject().getRoot(); |
578 | |
} |
579 | |
} |
580 | |
|
581 | |
|
582 | 0 | if (ns == null) { |
583 | 0 | return; |
584 | |
} |
585 | |
|
586 | |
|
587 | |
|
588 | 0 | if (Model.getFacade().getNamespace(modelElement) == ns) { |
589 | 0 | return; |
590 | |
} |
591 | |
|
592 | 0 | CoreHelper coreHelper = Model.getCoreHelper(); |
593 | 0 | ModelManagementHelper modelHelper = Model.getModelManagementHelper(); |
594 | |
|
595 | 0 | if (!modelHelper.isCyclicOwnership(ns, modelElement) |
596 | |
&& coreHelper.isValidNamespace(modelElement, ns)) { |
597 | |
|
598 | 0 | coreHelper.setModelElementContainer(modelElement, ns); |
599 | |
|
600 | |
|
601 | |
|
602 | |
} |
603 | 0 | } |
604 | |
|
605 | |
|
606 | |
public void propertyChange(PropertyChangeEvent evt) { |
607 | 0 | if ((evt.getSource() == namespace) |
608 | |
&& (evt instanceof DeleteInstanceEvent) |
609 | |
&& "remove".equals(evt.getPropertyName())) { |
610 | |
|
611 | 0 | Model.getPump().removeModelEventListener(this, namespace, "remove"); |
612 | |
|
613 | 0 | if (getProject() != null) { |
614 | 0 | getProject().moveToTrash(this); |
615 | |
} |
616 | |
} |
617 | 0 | } |
618 | |
|
619 | |
|
620 | |
public Object getOwner() { |
621 | 5410 | return getNamespace(); |
622 | |
} |
623 | |
|
624 | |
public Iterator<Fig> getFigIterator() { |
625 | 0 | return new EnumerationIterator(elements()); |
626 | |
} |
627 | |
|
628 | |
public void setDiagramSettings(DiagramSettings newSettings) { |
629 | 2116 | settings = newSettings; |
630 | 2116 | } |
631 | |
|
632 | |
public DiagramSettings getDiagramSettings() { |
633 | 0 | return settings; |
634 | |
} |
635 | |
|
636 | |
|
637 | |
|
638 | |
|
639 | |
|
640 | |
|
641 | |
public void diagramFontChanged(ArgoDiagramAppearanceEvent e) { |
642 | 24 | renderingChanged(); |
643 | 24 | } |
644 | |
|
645 | |
|
646 | |
|
647 | |
|
648 | |
|
649 | |
|
650 | |
|
651 | |
public void renderingChanged() { |
652 | 26 | for (Object fig : getLayer().getContents()) { |
653 | |
try { |
654 | |
|
655 | 0 | if (fig instanceof ArgoFig) { |
656 | 0 | ((ArgoFig) fig).renderingChanged(); |
657 | |
} else { |
658 | 0 | LOG.warn("Diagram " + getName() + " contains non-ArgoFig " |
659 | |
+ fig); |
660 | |
} |
661 | 0 | } catch (InvalidElementException e) { |
662 | 0 | LOG.error("Tried to refresh deleted element ", e); |
663 | 0 | } |
664 | |
} |
665 | 26 | damage(); |
666 | 26 | } |
667 | |
|
668 | |
public void notationChanged(ArgoNotationEvent e) { |
669 | 2 | renderingChanged(); |
670 | 2 | } |
671 | |
|
672 | |
public void notationAdded(ArgoNotationEvent e) { |
673 | |
|
674 | 0 | } |
675 | |
|
676 | |
public void notationProviderAdded(ArgoNotationEvent e) { |
677 | |
|
678 | 0 | } |
679 | |
|
680 | |
public void notationProviderRemoved(ArgoNotationEvent e) { |
681 | |
|
682 | 0 | } |
683 | |
|
684 | |
|
685 | |
public void notationRemoved(ArgoNotationEvent e) { |
686 | |
|
687 | 0 | } |
688 | |
|
689 | |
|
690 | |
|
691 | |
|
692 | |
|
693 | |
|
694 | |
|
695 | |
|
696 | |
|
697 | |
|
698 | |
|
699 | |
|
700 | |
public void vetoableChange(PropertyChangeEvent evt) |
701 | |
throws PropertyVetoException { |
702 | |
|
703 | 2252 | if ("name".equals(evt.getPropertyName())) { |
704 | 2252 | if (project != null) { |
705 | 0 | if (!project.isValidDiagramName((String) evt.getNewValue())) { |
706 | 0 | throw new PropertyVetoException("Invalid name", evt); |
707 | |
} |
708 | |
} |
709 | |
} |
710 | 2252 | } |
711 | |
|
712 | |
} |