forked from xmf-xmodeler/Mosaic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXMFDump1511164055798.txt
7636 lines (6791 loc) · 319 KB
/
XMFDump1511164055798.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Call frame backtrace:
Current stack frame instructions:
<Unknown instruction 109>
LOCAL 0
STARTCALL
SENDSELF 0 'clientManager' <---
----------------------------------------------------------------------------------------------------
Called(127): XMF::findClient at line 30 char 0
Self: XMF[fields=roleFiller,properties,homeDir,docDir,buildDate,version,user,preferences,exception,standardOutput,initFile,imageDir,startupArgs,banner,handles,nextHandle]
Supers: findClient,findClientByName,getAllClients,bootEnterprise,bootMosaic,saveImage,saveImage,saveImageAndInflater,bootMenus,bootConsole,bootUndo,bootPropertyEditor,bootBrowser,bootDiagrams,bootDialogs,dialogClient,getColor,getColor,getFont,message,warning,errorMessage,openFile,errorMessageWithText,multiSelectTreeDialog,order,order2,saveFile,busy,getString,getBoolean,getFloat,getInteger,getClassifier,getExp,textClient,browseUsing,browse,clipboard,chooseFont,suppressModelBrowserNodeExpansion,registry,menuRegistryHandler,fileEditorManager,toolManager,toolBrowser,enableToolDefinitionMenuUpgrader,disableToolDefinitionMenuUpgrader,projDir,demoDir,setProperty,property,properties,hasProperty,oldEdit,edit,getChildren,getChildrenSlots,orderSequence,removeDiagramListeners,getDiagramListeners,nodeEvent,getAvailableMappings,propertyTarget,slotMissing,synchronise,slotDenied,setProperty,setHotLoad,setDaemonsActive,setDaemons,set,renameSlot,removeStructuralFeature,removeDaemonsWithTarget,removeDaemonsWithId,removeDaemonNamed,removeDaemon,machineInit,initSlots,init,hotLoaded,hotLoad,hasSlot,hasProperty,getProperties,getProperty,get,hasStructuralFeature,getStructuralFeatureNames,hasDaemonWithTarget,hasDaemonWithIdAndTarget,hasDaemonWithId,hasDaemonNamed,fire,destroyDaemon,daemonWithIdAndTarget,daemonWithId,daemonNamed,daemonsActive,daemons,allDaemonsWithTarget,allDaemonsWithId,compositeValues,allCompositeValuesAndSelf,allCompositeValues,addStructuralFeature,addPersistentDaemon,addMultiDaemon,addDaemon,slots,addMissingSlot,slotMissing,applyMapping_client,changedOnDiagram,addDiagramListener,removeDiagramListener,getDiagramListenerNamed,orderSequence,calcChildrenSlots,getChildrenToolTips,observeBy,observeBy,observedBy,observedBy,ignoreBy,ignoreByAll,saveXTO,saveXTOFile,showDiagram,showAndLayoutDiagram,toSVG,graphVizNode,getChildren,showModelBrowserNode,invokeOp,edit_redirect,assignToGlobal,pasteFromClipboard,copyToClipboard,cutToClipboard,getDefaultClipboardSource,legalSlotChangeCheck,deployXML,selectDiagram,createDiagramType,createDiagram,doubleClick,slotAffectsLabel,labelString,pprint,pprint,pprint,pprintln,toType,writeXMLFile,writeXML,lift,toSnapshot,toSnapshot,allHTMLEntries,allHTMLPackages,toHTML,writeHTML,writeHTML,writeHTMLAllEntries,writeHTMLAllPackages,writeHTMLIndex,writeHTMLOverview,yield,toString,systemId,setRoleFillerDialog,setOf,send,save2,save,removeDaemon,removeDaemon,println,print,oclIsKindOf,oclIsTypeOf,setDelegation,noOperationFound,isTypeOf,isReallyKindOf,init,init,of,isKindOf,addTo,checkConstraints,copy,deleteRecursive,die,equals,error,ferror,hashCode,isWithinNameSpace,isProtected,isViewProtected,isDeleteProtected,nameString,doc,edit,createDiagramType,createDiagramType,showAndLayoutDiagram,legalSlotChangeCheck,legalNameChangeCheck,getDefaultClipboardTarget,cutToClipboard_transaction,copyToClipboard_transaction,assignToGlobal,browse_redirect,evaluateExpression,selectModelBrowserNode,browse,getChildrenToolTips,createTool,showDiagram,oldShowDiagram,populateGraphViz
Local(0): <Class DialogBoxClient>
Source Code:
@Operation findClient(type : XCore::Element):XCore::Element
self.clientManager().findClient(type)
end
constant(0) = Array()
constant(1) = 'clientManager'
constant(2) = 'findClient'
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Called(113): XMF::message at line 46 char 0
Self: XMF[fields=roleFiller,properties,homeDir,docDir,buildDate,version,user,preferences,exception,standardOutput,initFile,imageDir,startupArgs,banner,handles,nextHandle]
Supers: message,warning,errorMessage,openFile,errorMessageWithText,multiSelectTreeDialog,order,order2,saveFile,busy,getString,getBoolean,getFloat,getInteger,getClassifier,getExp,textClient,browseUsing,browse,clipboard,chooseFont,suppressModelBrowserNodeExpansion,registry,menuRegistryHandler,fileEditorManager,toolManager,toolBrowser,enableToolDefinitionMenuUpgrader,disableToolDefinitionMenuUpgrader,projDir,demoDir,setProperty,property,properties,hasProperty,oldEdit,edit,getChildren,getChildrenSlots,orderSequence,removeDiagramListeners,getDiagramListeners,nodeEvent,getAvailableMappings,propertyTarget,slotMissing,synchronise,slotDenied,setProperty,setHotLoad,setDaemonsActive,setDaemons,set,renameSlot,removeStructuralFeature,removeDaemonsWithTarget,removeDaemonsWithId,removeDaemonNamed,removeDaemon,machineInit,initSlots,init,hotLoaded,hotLoad,hasSlot,hasProperty,getProperties,getProperty,get,hasStructuralFeature,getStructuralFeatureNames,hasDaemonWithTarget,hasDaemonWithIdAndTarget,hasDaemonWithId,hasDaemonNamed,fire,destroyDaemon,daemonWithIdAndTarget,daemonWithId,daemonNamed,daemonsActive,daemons,allDaemonsWithTarget,allDaemonsWithId,compositeValues,allCompositeValuesAndSelf,allCompositeValues,addStructuralFeature,addPersistentDaemon,addMultiDaemon,addDaemon,slots,addMissingSlot,slotMissing,applyMapping_client,changedOnDiagram,addDiagramListener,removeDiagramListener,getDiagramListenerNamed,orderSequence,calcChildrenSlots,getChildrenToolTips,observeBy,observeBy,observedBy,observedBy,ignoreBy,ignoreByAll,saveXTO,saveXTOFile,showDiagram,showAndLayoutDiagram,toSVG,graphVizNode,getChildren,showModelBrowserNode,invokeOp,edit_redirect,assignToGlobal,pasteFromClipboard,copyToClipboard,cutToClipboard,getDefaultClipboardSource,legalSlotChangeCheck,deployXML,selectDiagram,createDiagramType,createDiagram,doubleClick,slotAffectsLabel,labelString,pprint,pprint,pprint,pprintln,toType,writeXMLFile,writeXML,lift,toSnapshot,toSnapshot,allHTMLEntries,allHTMLPackages,toHTML,writeHTML,writeHTML,writeHTMLAllEntries,writeHTMLAllPackages,writeHTMLIndex,writeHTMLOverview,yield,toString,systemId,setRoleFillerDialog,setOf,send,save2,save,removeDaemon,removeDaemon,println,print,oclIsKindOf,oclIsTypeOf,setDelegation,noOperationFound,isTypeOf,isReallyKindOf,init,init,of,isKindOf,addTo,checkConstraints,copy,deleteRecursive,die,equals,error,ferror,hashCode,isWithinNameSpace,isProtected,isViewProtected,isDeleteProtected,nameString,doc,edit,createDiagramType,createDiagramType,showAndLayoutDiagram,legalSlotChangeCheck,legalNameChangeCheck,getDefaultClipboardTarget,cutToClipboard_transaction,copyToClipboard_transaction,assignToGlobal,browse_redirect,evaluateExpression,selectModelBrowserNode,browse,getChildrenToolTips,createTool,showDiagram,oldShowDiagram,populateGraphViz
Local(0): <Exception Execution interrupted.>
Source Code:
@Operation message(message : String):XCore::Element
self.dialogClient().newMessageDialog(message)
end
constant(0) = Array()
constant(1) = 'dialogClient'
constant(2) = 'newMessageDialog'
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Called(98): FileTextEditor::anonymous at line 101 char 0
Self: FileEditor[fields=file,listeners,commandInterpreter,owner,id,element,roleFiller,rightClickMenu,menuKey,name,tooltip,editable,dirty,lastModified]
Supers: anonymous,setSignature,setClean,focusGained,renew,isModified,getFileModifiedDate,close,ast,action,removeListener,removeDaemons,nameChangedEvent,nameChanged,focusLost,focusGained,fileRemoved,closeEvent,checkDaemons,addListener,undoStacked,showLine,show,setTooltip,setTooltip,setTextAt,setText,setSyntaxHighlightRules,setName,setFocus,setDirty,setCursorPosition,setClean,renew,removeDaemons,new,getTextAt,getText,getCursorPosition,focusLost,focusGained,dispose,closeOpenEditor,close,clearHighlights,addLineHighlight,addTerminates,addMultilineRule,addWordRule,dirty,editable,tooltip,name,hasCommandInterpreter,eventHandler,dispose,commandInterpreter,commandInterpreter,delete_client_check,delete_client,removeFromOwner,setOwner,addTo,allOwners,deleteRecursive,owner,getDefaultClipboardSource,delete_client_redirect,dispose,removeFromIdManager,disposeIdCollection,disposeCollection,disposeId,setId,id,globalMenu,elementTarget,buildGlobalMenu,setElement,element,element,setRightClickMenu,selfTarget,renewRightClickMenu,newRightClickMenu,globalMenu,globalMenu,globalMenu,clearRightClickMenu,clearRightClickMenu,buildMenuTreeFromRegistry,buildGlobalMenu,addRightClickMenuItems,addRightClickMenuItem,setMenuKey,menuKey,oldEdit,edit,getChildren,getChildrenSlots,orderSequence,removeDiagramListeners,getDiagramListeners,nodeEvent,getAvailableMappings,propertyTarget,slotMissing,synchronise,slotDenied,setProperty,setHotLoad,setDaemonsActive,setDaemons,set,renameSlot,removeStructuralFeature,removeDaemonsWithTarget,removeDaemonsWithId,removeDaemonNamed,removeDaemon,machineInit,initSlots,init,hotLoaded,hotLoad,hasSlot,hasProperty,getProperties,getProperty,get,hasStructuralFeature,getStructuralFeatureNames,hasDaemonWithTarget,hasDaemonWithIdAndTarget,hasDaemonWithId,hasDaemonNamed,fire,destroyDaemon,daemonWithIdAndTarget,daemonWithId,daemonNamed,daemonsActive,daemons,allDaemonsWithTarget,allDaemonsWithId,compositeValues,allCompositeValuesAndSelf,allCompositeValues,addStructuralFeature,addPersistentDaemon,addMultiDaemon,addDaemon,slots,addMissingSlot,slotMissing,applyMapping_client,changedOnDiagram,addDiagramListener,removeDiagramListener,getDiagramListenerNamed,orderSequence,calcChildrenSlots,getChildrenToolTips,observeBy,observeBy,observedBy,observedBy,ignoreBy,ignoreByAll,saveXTO,saveXTOFile,showDiagram,showAndLayoutDiagram,toSVG,graphVizNode,getChildren,showModelBrowserNode,invokeOp,edit_redirect,assignToGlobal,pasteFromClipboard,copyToClipboard,cutToClipboard,getDefaultClipboardSource,legalSlotChangeCheck,deployXML,selectDiagram,createDiagramType,createDiagram,doubleClick,slotAffectsLabel,labelString,pprint,pprint,pprint,pprintln,toType,writeXMLFile,writeXML,lift,toSnapshot,toSnapshot,allHTMLEntries,allHTMLPackages,toHTML,writeHTML,writeHTML,writeHTMLAllEntries,writeHTMLAllPackages,writeHTMLIndex,writeHTMLOverview,yield,toString,systemId,setRoleFillerDialog,setOf,send,save2,save,removeDaemon,removeDaemon,println,print,oclIsKindOf,oclIsTypeOf,setDelegation,noOperationFound,isTypeOf,isReallyKindOf,init,init,of,isKindOf,addTo,checkConstraints,copy,deleteRecursive,die,equals,error,ferror,hashCode,isWithinNameSpace,isProtected,isViewProtected,isDeleteProtected,nameString,doc,edit,createDiagramType,createDiagramType,showAndLayoutDiagram,legalSlotChangeCheck,legalNameChangeCheck,getDefaultClipboardTarget,cutToClipboard_transaction,copyToClipboard_transaction,assignToGlobal,browse_redirect,evaluateExpression,selectModelBrowserNode,browse,getChildrenToolTips,createTool,showDiagram,oldShowDiagram,populateGraphViz
Local(0): MachineException[fields=roleFiller,message,backtrace,resourceName,charCount,lineCount,data,id]
Local(1): MachineException[fields=roleFiller,message,backtrace,resourceName,charCount,lineCount,data,id]
Local(2): typeCaseValue
Source Code:
@Operation anonymous(exception : XCore::Element):XCore::Element
@TypeCase(exception)
Parser::ParseError do
self.commandInterpreter().syntaxError(self,exception.errorPos,exception.message);
self.commandInterpreter().rendering(self,true)
end
end
end
constant(0) = Array(typeCaseValue)
constant(1) = 'Parser'
constant(2) = 'ParseError'
constant(3) = 'errorPos'
constant(4) = 'message'
constant(5) = 'commandInterpreter'
constant(6) = 'syntaxError'
constant(7) = 'rendering'
constant(8) = 'xmf'
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Called(84): FileTextEditor::textChanged at line 75 char 0
Self: FileEditor[fields=file,listeners,commandInterpreter,owner,id,element,roleFiller,rightClickMenu,menuKey,name,tooltip,editable,dirty,lastModified]
Supers: textChanged,setSignature,setClean,focusGained,renew,isModified,getFileModifiedDate,close,ast,action,removeListener,removeDaemons,nameChangedEvent,nameChanged,focusLost,focusGained,fileRemoved,closeEvent,checkDaemons,addListener,undoStacked,showLine,show,setTooltip,setTooltip,setTextAt,setText,setSyntaxHighlightRules,setName,setFocus,setDirty,setCursorPosition,setClean,renew,removeDaemons,new,getTextAt,getText,getCursorPosition,focusLost,focusGained,dispose,closeOpenEditor,close,clearHighlights,addLineHighlight,addTerminates,addMultilineRule,addWordRule,dirty,editable,tooltip,name,hasCommandInterpreter,eventHandler,dispose,commandInterpreter,commandInterpreter,delete_client_check,delete_client,removeFromOwner,setOwner,addTo,allOwners,deleteRecursive,owner,getDefaultClipboardSource,delete_client_redirect,dispose,removeFromIdManager,disposeIdCollection,disposeCollection,disposeId,setId,id,globalMenu,elementTarget,buildGlobalMenu,setElement,element,element,setRightClickMenu,selfTarget,renewRightClickMenu,newRightClickMenu,globalMenu,globalMenu,globalMenu,clearRightClickMenu,clearRightClickMenu,buildMenuTreeFromRegistry,buildGlobalMenu,addRightClickMenuItems,addRightClickMenuItem,setMenuKey,menuKey,oldEdit,edit,getChildren,getChildrenSlots,orderSequence,removeDiagramListeners,getDiagramListeners,nodeEvent,getAvailableMappings,propertyTarget,slotMissing,synchronise,slotDenied,setProperty,setHotLoad,setDaemonsActive,setDaemons,set,renameSlot,removeStructuralFeature,removeDaemonsWithTarget,removeDaemonsWithId,removeDaemonNamed,removeDaemon,machineInit,initSlots,init,hotLoaded,hotLoad,hasSlot,hasProperty,getProperties,getProperty,get,hasStructuralFeature,getStructuralFeatureNames,hasDaemonWithTarget,hasDaemonWithIdAndTarget,hasDaemonWithId,hasDaemonNamed,fire,destroyDaemon,daemonWithIdAndTarget,daemonWithId,daemonNamed,daemonsActive,daemons,allDaemonsWithTarget,allDaemonsWithId,compositeValues,allCompositeValuesAndSelf,allCompositeValues,addStructuralFeature,addPersistentDaemon,addMultiDaemon,addDaemon,slots,addMissingSlot,slotMissing,applyMapping_client,changedOnDiagram,addDiagramListener,removeDiagramListener,getDiagramListenerNamed,orderSequence,calcChildrenSlots,getChildrenToolTips,observeBy,observeBy,observedBy,observedBy,ignoreBy,ignoreByAll,saveXTO,saveXTOFile,showDiagram,showAndLayoutDiagram,toSVG,graphVizNode,getChildren,showModelBrowserNode,invokeOp,edit_redirect,assignToGlobal,pasteFromClipboard,copyToClipboard,cutToClipboard,getDefaultClipboardSource,legalSlotChangeCheck,deployXML,selectDiagram,createDiagramType,createDiagram,doubleClick,slotAffectsLabel,labelString,pprint,pprint,pprint,pprintln,toType,writeXMLFile,writeXML,lift,toSnapshot,toSnapshot,allHTMLEntries,allHTMLPackages,toHTML,writeHTML,writeHTML,writeHTMLAllEntries,writeHTMLAllPackages,writeHTMLIndex,writeHTMLOverview,yield,toString,systemId,setRoleFillerDialog,setOf,send,save2,save,removeDaemon,removeDaemon,println,print,oclIsKindOf,oclIsTypeOf,setDelegation,noOperationFound,isTypeOf,isReallyKindOf,init,init,of,isKindOf,addTo,checkConstraints,copy,deleteRecursive,die,equals,error,ferror,hashCode,isWithinNameSpace,isProtected,isViewProtected,isDeleteProtected,nameString,doc,edit,createDiagramType,createDiagramType,showAndLayoutDiagram,legalSlotChangeCheck,legalNameChangeCheck,getDefaultClipboardTarget,cutToClipboard_transaction,copyToClipboard_transaction,assignToGlobal,browse_redirect,evaluateExpression,selectModelBrowserNode,browse,getChildrenToolTips,createTool,showDiagram,oldShowDiagram,populateGraphViz
Local(0): parserImport XOCL;
parserImport XMap;
import Clients;
import Diagrams;
import DiagramsMapping;
import ClassDiagrams;
import ClassMapping;
import Menus;
import IO;
context ClassMapping
@Class PackageXClassDiagram extends ElementXDiagram
@Attribute package : Package (?) end
@Attribute diagram : ClassDiagram (?) end
@Attribute classMaps : Seq(ClassXNode) (+,-) end
@Attribute packageMaps : Seq(PackageXNode) (+,-) end
@Attribute docMaps : Seq(DocXNote) (+,-) end
@Attribute elementMaps : Seq(ElementXNode) (+,-) end
@Attribute inheritanceMaps : Seq(ClassifierXInheritanceEdge) (+,-) end
@Attribute delegationMaps : Seq(DelegationXDelegationEdge) (+,-) end
@Attribute attributeMaps : Seq(AttributeXAttributeEdge) (+,-) end
@Attribute containerMaps : Seq(ContainerXContainsEdge) (+,-) end
@Attribute dependencyMaps : Seq(DependencyXDependencyEdge) (+,-) end
@Attribute associationMaps : Seq(AssociationXAssociationEdge)(+,-) end
@Attribute associationInstanceMaps : Seq(AssociationInstanceXAssociationInstanceEdge)(+,-) end
@Attribute intrinsicAssociationConstraintMaps : Seq(IntrinsicAssociationConstraintXIntrinsicAssociationConstraintEdge)(+,-) end
@Constructor(package,diagram,owner)
self.init(Seq{package,diagram})
end
@Constructor(package,diagram) !
// This assumes that we are starting with a package
// and generating the diagram.
diagram.setOwner(self);
self.setHotLoad(true);
self.registerWithDiagram(diagram);
self.checkDaemons();
self.setGlobalMenu(diagram,Set{Package,diagram.of()})
end
//@Constructor(package,diagram,classMaps) end
@Operation abstractClassMaps()
classMaps + packageMaps
end
@Operation actionAdded(handler)
// Add the action to the appropriate group in the palette...
let name = handler.getProperty("actionName",handler.name.toString());
icon = handler.getProperty("actionIcon","Tools/Activity.gif");
group = handler.getProperty("actionGroup","Actions")
in diagram.defineToolGroup(group);
diagram.defineActionHandler(group,name,name,icon,handler)
end
end
@Operation actionRemoved(handler)
"PackageXClassDiagram::actionRemoved not implemented".println()
end
@Operation add(element)
@TypeCase(element)
AssociationXAssociationEdge do
self.addAssociationMap(element)
end
IntrinsicAssociationConstraintXIntrinsicAssociationConstraintEdge do
self.addIntrinsicAssociationConstraintMap(element)
end
AssociationInstanceXAssociationInstanceEdge do
self.addAssociationInstanceMap(element)
end
AttributeXAttributeEdge do
self.addAttributeMap(element)
end
ClassifierXInheritanceEdge do
self.addInheritanceMap(element)
end
DelegationXDelegationEdge do
self.addDelegationMap(element)
end
DependencyXDependencyEdge do
self.addDependencyMap(element)
end
ClassXNode do
self.addClassMap(element)
end
ContainerXContainsEdge do
self.addContainerMap(element)
end
ElementXNode do
self.addElementMap(element)
end
Associations::Association do
self.associationAdded(element)
end
XCore::Package do
self.packageAdded(element)
end
XCore::Class do
self.classAdded(element)
end
PackageXNode do
self.addPackageMap(element)
end
DocXNote do
self.addDocMap(element)
end
else
self.elementAdded(element)
//else format(stdout,"PackageXClassDiagram::add: unknown element " + element.toString())
end
end
@Operation addCreationButton(class)
// Add a palette creation button for the class. Take appropriate action
// depending on the type of the class. In addition, if the class is a meta-class
// then add an extension point for displaying instances of the class...
let className = class.name.toString();
groupNames = diagram.getGroupNames() then
groupName = xmf.select("Select Group","Select a group for the button",groupNames,"",@Operation(x) x end);
metaHandler(x,y) = self.newClassNode(x,y,class.pathSeq());
classHandler = self.instantiateClassHandler(class,package,self);
attHandler(sourcePort,targetPort) = self.newAttributeEdge(sourcePort,targetPort,class.pathSeq())
in if not(groupName = "" or groupName = null)
then
if class.inheritsFrom(XCore::Attribute)
then
diagram.defineNewHandler(groupName,className,true,"XCore/Attribute.gif",attHandler);
// Perhaps this should be done via another menu item...
self.defineAttributeRegistryContributions(class)
elseif class.isMetaClass()
then
diagram.defineNewHandler(groupName,className,false,"XCore/Class.gif",metaHandler);
// Perhaps this should be done via another menu item...
self.defineMetaClassRegistryContributions(class)
else diagram.defineNewHandler(groupName,className,false,"XCore/Object.gif",classHandler)
end
end
end
end
@Operation addDropped(element)
@TypeCase(element)
XCore::Package do
self.packageDropped(element);
self.generateEdges()
end
XCore::Class do
self.classDropped(element);
self.generateEdges()
end
else format(stdout,"PackageXClassDiagram::addDropped: unknown element " + element.toString())
end
end
@Operation addAssociationMap(associationMap)
self.addToAssociationMaps(associationMap);
associationMap.setOwner(self)
end
@Operation addIntrinsicAssociationConstraintMap(intrinsicAssociationConstraintMap)
self.addToIntrinsicAssociationConstraintMaps(intrinsicAssociationConstraintMap);
intrinsicAssociationConstraintMap.setOwner(self)
end
@Operation addAssociationInstanceMap(associationInstanceMap)
self.addToAssociationInstanceMaps(associationInstanceMap);
associationInstanceMap.setOwner(self)
end
@Operation addAttributeMap(attributeMap)
self.attributeMaps := attributeMaps->prepend(attributeMap);
attributeMap.setOwner(self)
end
@Operation addAttribute(attribute)
// let acMaps = self.abstractClassMaps()
// in
// @Find(sourceMap,acMaps)
// when sourceMap.element() = attribute.owner
// do @Find(targetMap,acMaps)
// when targetMap.element() = attribute.underlyingType()
// do let
// edge = diagram.makeAttribute(sourceMap.node,targetMap.node,attribute.of().pathSeq());
// //type = attribute.type then
// //mult = if type.isKindOf(Set) then "*" elseif type.isKindOf(Seq) then "* <<ordered>>" else "" end
// mult = AttributeXAttributeEdge::calcMultLabelString(attribute.mult())
// in
// edge.setName(attribute.name.toString());
// edge.setMult(mult);
// let attributeEdgeMap = AttributeXAttributeEdge(attribute,edge)
// in
// self.add(attributeEdgeMap);
// self.diagram.add(edge)
// end
// end
// end
// end
// end
null
end
@Operation addClass(class)
let package =
if package.classes->includes(class)
then ""
else "(from " + class.owner.path() + ")"
end;
x = diagram.selectedX() + 100;
y = diagram.selectedY() + 100 then
node = ClassNode(class.name.toString(),package,class.isAbstract,class.of().pathSeq(),x,y,diagram.showAttributes(),diagram.showOperations(),diagram.showMetaslots()) then
map = ClassXNode(class,node,self)
in
@WithoutRendering(self.diagram)
self.addClassMap(map);
diagram.addNode(node);
node.new(diagram);
if class.isAbstract then
node.setIsAbstract(true)
end;
if node.showAttributes then
map.generateAttributes()
end;
if node.showOperations then
map.generateOperations()
end;
if node.showMetaslots then
map.generateMetaslots()
end;
if node.showOperationValues then
map.generateOperationValues()
end;
node
end
end
end
@Operation addClassMap(classMap)
self.classMaps := classMaps->prepend(classMap);
classMap.setOwner(self)
end
@Operation addContainerMap(containerMap)
self.addToContainerMaps(containerMap);
containerMap.setOwner(self)
end
/* @Operation addContentsChangedDaemon()
package.addContentDaemon(self,
@Operation(newContents,oldContents)
let
added = newContents - oldContents;
removed = oldContents - newContents
in
if not added->isEmpty then
@For value in added do
//if not value.isKindOf(Class) and not value.isKindOf(Package)
//then self.elementAdded(value)
if value.isKindOf(Associations::Association)
then self.associationAdded(value)
end
end
else
if not removed->isEmpty then
@For value in removed do
//if not value.isKindOf(Class) and not value.isKindOf(Package)
//then self.elementRemoved(value)
if value.isKindOf(Associations::Association)
then self.associationRemoved(value)
end
end
end
end
end
)
end */
@Operation addDependencyMap(dependencyMap)
self.addToDependencyMaps(dependencyMap);
dependencyMap.setOwner(self)
end
@Operation addDelegationMap(delegationMap)
self.addToDelegationMaps(delegationMap);
delegationMap.setOwner(self)
end
@Operation addDocMap(docMap)
self.addToDocMaps(docMap);
docMap.setOwner(self)
end
@Operation addElementMap(elementMap)
self.addToElementMaps(elementMap);
elementMap.setOwner(self)
end
@Operation addImportTrays()
@For i in package.imports when i.isReallyKindOf(Package) and not Seq{XCore,Root}->includes(i) do
// The imports of a package are available as buttons in the palette
// to create objects on the diagram. This allows type and instance
// to be mixed on a single diagram...
self.addImportTray(i)
end
end
@Operation addImportTray(package)
let name = package.name.toString();
map = self
in diagram.defineToolGroup(name);
@For class in package.classes when not(class.isAbstract) do
let handler(x,y) = map.add(class())
in diagram.defineNewHandler(name,class.name.toString(),false,"XCore/Object.gif",handler)
end
end
end
end
@Operation addInheritanceMap(inheritanceMap)
self.inheritanceMaps := inheritanceMaps->prepend(inheritanceMap);
inheritanceMap.setOwner(self)
end
@Operation addMetaTray()
if package.isMetaPackage()
then
let parents = package.allParents() then
contents = parents->iterate(p O=Set{} | O + p.contents()) then
classes = contents->select(o | o <> null and o.isKindOf(Class)) then
attributes = classes->select(c | c.inheritsFrom(Attribute));
associations = classes->select(c | c.inheritsFrom(Associations::Association)) then
classes = classes->including(Class)->excluding(Package)->excluding(Array)->excluding(Enum) then
metaclasses = classes->select(c | c.isMetaClass());
thePackage = package
in diagram.defineToolGroup("Meta Elements");
@For a in attributes do
diagram.defineNewHandler(
"Meta Elements",
a.name.toString() + "(subclass)",
false,
"XCore/Attribute.gif",
@Operation(x,y)
// Create a sub-class of a..
let class = Class(thePackage.newName(a.name.toString() + "Like"))
in class.addParent(a);
thePackage.add(class);
self.elementChanged()
end
end)
end;
@For a in associations do
diagram.defineNewHandler(
"Meta Elements",
a.name.toString() + "(subclass)",
false,
"XCore/Association.gif",
@Operation(x,y)
// Create a sub-class of a..
let class = Class(thePackage.newName(a.name.toString() + "Like"))
in class.addParent(a);
thePackage.add(class);
self.elementChanged()
end
end)
end;
@For metaclass in metaclasses do
diagram.defineNewHandler(
"Meta Elements",
metaclass.name.toString() + "(subclass)",
false,
"XCore/Class.gif",
@Operation(x,y)
// Create a new instance of the meta-class and make it inherit
// from Class (actually this should be selectable). Should get
// the node and move it...
let class = metaclass(thePackage.newName(metaclass.name.toString()))
in class.addParent(Class);
thePackage.add(class);
self.elementChanged()
end
end)
end
end
else self.deleteMetaTray()
end
end
@Operation addPackageMap(packageMap)
self.addToPackageMaps(packageMap);
packageMap.setOwner(self)
end
@Operation addPackage(package)
let owningPackage =
if self.package.packages->includes(package)
then ""
else "(from " + package.owner.path() + ")"
end then
node = PackageNode(package.name.toString(),owningPackage,package.of().pathSeq(),0,0)
in
@WithoutRendering(self.diagram)
self.add(PackageXNode(package,node,self));
diagram.add(node);
node.new(diagram)
end
end
end
@Operation associationInstanceAdded(associationInstance)
if not associationInstanceMaps->exists(map | map.associationInstance = associationInstance)
then
let acMaps = self.abstractClassMaps()
in
@Find(sourceMap,acMaps)
when sourceMap.element() = associationInstance.class1
do @Find(targetMap,acMaps)
when targetMap.element() = associationInstance.class2
do
let name_label = Label("instance of " + associationInstance.class1.of().getAttribute(associationInstance.name1).association.name,"",0,-16,true, Color(120,120,120),0+1) then
edge = AssociationInstanceEdge(name_label, sourceMap.node.ports().head(),targetMap.node.ports().head(),associationInstance.class1.of().getAttribute(associationInstance.name1).association.pathSeq())
in self.add(AssociationInstanceXAssociationInstanceEdge(associationInstance,edge));
edge.new(self.diagram);
self.diagram.add(edge)
end
end
end
end
end
end
@Operation intrinsicAssociationConstraintAdded(intrinsicAssociationConstraint)
if not intrinsicAssociationConstraintMaps->exists(map | map.intrinsicAssociationConstraint = intrinsicAssociationConstraint)
then
let acMaps = self.abstractClassMaps()
in
@Find(sourceMap,acMaps)
when sourceMap.element() = intrinsicAssociationConstraint.constraint1.owner
do @Find(targetMap,acMaps)
when targetMap.element() = intrinsicAssociationConstraint.constraint2.owner
do
let name_label = Label(intrinsicAssociationConstraint.refersTo.name,"",0,-16,true, Color(120,120,120),0+1) then
edge = IntrinsicAssociationConstraintEdge(name_label, sourceMap.node.ports().head(),targetMap.node.ports().head(),intrinsicAssociationConstraint.refersTo.pathSeq())
in self.add(IntrinsicAssociationConstraintXIntrinsicAssociationConstraintEdge(intrinsicAssociationConstraint,edge));
edge.new(self.diagram);
self.diagram.add(edge)
end
end
end
end
end
end
@Operation associationAdded(association)
if not associationMaps->exists(map | map.association = association)
then
let acMaps = self.abstractClassMaps()
in
@Find(sourceMap,acMaps)
when sourceMap.element() = association.end1.underlyingType()
do @Find(targetMap,acMaps)
when targetMap.element() = association.end2.underlyingType()
do let name = association.name.toString();
mult1 = Multiplicity(association.end1.mult.labelString(),"start");
mult2 = Multiplicity(association.end2.mult.labelString(),"end") then
// instLevel1 = Label("Ø", "start", 40, 40, true, true, Color(0,0,0));
instLevel1 = Label("Ø", "start", 40, 40, true, Color(0,0,0));
// instLevel2 = Label("Ø", "start", -40, -40, true, true, Color(0,0,0));
instLevel2 = Label("Ø", "start", -40, -40, true, Color(0,0,0));
varName1 = Label(association.end1.name.toString(),"start",10,10,true);
varName2 = Label(association.end2.name.toString(),"end",-10,-10,true);
displayName1 = Label("displayName1","",0,-16,true, Color(0,0,0),0+1);
displayName2 = Label("displayName2","",0, 16,true, Color(0,0,0),0-1) then
end1 = AssociationEnd(varName1,displayName1,mult1,instLevel1);
end2 = AssociationEnd(varName2,displayName2,mult2,instLevel2) then
edge = diagram.makeAssociation(name,end1,end2,sourceMap.node,targetMap.node,association.of().pathSeq())
in self.add(AssociationXAssociationEdge(association,edge));
self.diagram.add(edge)
end
end
end
end
end
end
@Operation attributeAdded(attribute)
// Processes the addition of an attribute wrt the supplied
// mappings. The accessors are used to map the maps to the
// underlying model elements.
if not attributeMaps->exists(map | map.attribute = attribute) and
not attribute.isKindOf(Associations::End)
then
self.addAttribute(attribute)
end
end
@Operation attributeDropped(attribute)
self.addAttribute(attribute)
end
@Operation associationEdgeAdded(associationEdge)
if self.validEdge(associationEdge)
then
if not associationMaps->exists(map | map.edge = associationEdge)
then
let acMaps = self.abstractClassMaps()
in
@Find(end1Map,acMaps)
when end1Map.node = associationEdge.sourceNode()
do @Find(end2Map,acMaps)
when end2Map.node = associationEdge.targetNode()
do let name = associationEdge.name; //package.newName("A");
class1 = end1Map.element();
class2 = end2Map.element() then
class1Name = class1.name.toString().lowerCaseInitialLetter();
class2Name = class2.name.toString().lowerCaseInitialLetter() then
end1Name = if class2.hasElement(class1Name) then class2.newName("a") else class1Name end;
end2Name = if class1.hasElement(class2Name) then class1.newName("b") else class2Name end;
metaClass = associationEdge.typePath->ref(Seq{Root,XCore,Associations}) then
association = metaClass(name);
end1 = Associations::End(end1Name,class1,Associations::One());
end2 = Associations::End(end2Name,class2,Associations::One())
in //associationEdge.setName(name);
associationEdge.end1.setName(end1Name);
associationEdge.end2.setName(end2Name);
association.setEnd1(end1);
association.setEnd2(end2);
self.add(AssociationXAssociationEdge(association,associationEdge));
package.add(association);
self.elementChanged();
association.init()
end
end
end
end
end
end
end
@Operation attributeEdgeAdded(attributeEdge)
if self.validEdge(attributeEdge)
then
if not attributeMaps->exists(map | map.edge = attributeEdge)
then
let acMaps = self.abstractClassMaps()
in
@Find(ownerMap,acMaps)
when ownerMap.node = attributeEdge.sourceNode()
do @Find(typeMap,acMaps)
when typeMap.node = attributeEdge.targetNode()
do let class = ownerMap.element();
type = typeMap.element() then
typeName = type.name.toString().lowerCaseInitialLetter() then
name = if class.hasElement(typeName) then class.newName("att") else typeName end;
metaClass = attributeEdge.typePath->ref(Seq{Root,XCore}) then
attribute = metaClass(name,type) then
attributeEdgeMap = AttributeXAttributeEdge(attribute,attributeEdge)
in attributeEdge.setName(name);
self.add(attributeEdgeMap);
class.add(attribute);
self.elementChanged()
end
end
end
end
end
end
end
@Operation associationEdgeRemoved(associationEdge)
@Find(associationMap,associationMaps)
when associationMap.edge = associationEdge
do self.remove(associationMap);
let association = associationMap.association
in association.remove();
association.owner.remove(association)
end
end
end
@Operation associationInstanceEdgeAdded(associationInstanceEdge)
if self.validEdge(associationInstanceEdge)
then
if not associationInstanceMaps->exists(map | map.edge = associationInstanceEdge)
then
let acMaps = self.abstractClassMaps()
in
@Find(class1Map,acMaps)
when class1Map.node = associationInstanceEdge.sourceNode()
do @Find(class2Map,acMaps)
when class2Map.node = associationInstanceEdge.targetNode()
do let name = associationInstanceEdge.name.text; //package.newName("A");
class1 = class1Map.class;
class2 = class2Map.class then
metaClass = associationInstanceEdge.typePath->ref(Seq{Root,package}) then
associationInstance = Associations::AssociationInstance(package.newName(metaClass.name+"Instance"))
in associationInstance.setSlot1(class1,metaClass.end2.name);
associationInstance.setSlot2(class2,metaClass.end1.name);
associationInstance.checkDaemons();
self.add(AssociationInstanceXAssociationInstanceEdge(associationInstance,associationInstanceEdge));
package.add(associationInstance);
self.elementChanged();
associationInstance.init()
end
end
end
end
end
end
end
@Operation associationInstanceEdgeRemoved(associationInstanceEdge)
@Find(associationInstanceMap,associationInstanceMaps)
when associationInstanceMap.edge = associationInstanceEdge
do self.remove(associationInstanceMap);
let associationInstance = associationInstanceMap.associationInstance
in associationInstance.remove();
associationInstance.owner.remove(associationInstance)
end
end
end
@Operation intrinsicAssociationConstraintEdgeAdded(intrinsicAssociationConstraintEdge)
if self.validEdge(intrinsicAssociationConstraintEdge)
then
if not intrinsicAssociationConstraintMaps->exists(map | map.edge = intrinsicAssociationConstraintEdge)
then
let acMaps = self.abstractClassMaps()
in
@Find(class1Map,acMaps)
when class1Map.node = intrinsicAssociationConstraintEdge.sourceNode()
do @Find(class2Map,acMaps)
when class2Map.node = intrinsicAssociationConstraintEdge.targetNode()
do let name = intrinsicAssociationConstraintEdge.name.text; //package.newName("A");
class1 = class1Map.class;
class2 = class2Map.class then
metaClass = intrinsicAssociationConstraintEdge.typePath->ref(Seq{Root,package}) then
intrinsicAssociationConstraint = Associations::IntrinsicAssociationConstraint(package.newName(metaClass.name+"Constraint"))
in intrinsicAssociationConstraint.setConstraint1(class1.newIntrinsicAssociationConstraint(metaClass.end1,class2));
intrinsicAssociationConstraint.setConstraint2(class2.newIntrinsicAssociationConstraint(metaClass.end2,class1));
intrinsicAssociationConstraint.setRefersTo(metaClass);
intrinsicAssociationConstraint.checkDaemons();
self.add(IntrinsicAssociationConstraintXIntrinsicAssociationConstraintEdge(intrinsicAssociationConstraint,intrinsicAssociationConstraintEdge));
package.add(intrinsicAssociationConstraint);
intrinsicAssociationConstraint.init()
end
end
end
end
end
end
end
@Operation intrinsicAssociationConstraintEdgeRemoved(intrinsicAssociationConstraintEdge)
@Find(intrinsicAssociationConstraintMap,intrinsicAssociationConstraintMaps)
when intrinsicAssociationConstraintMap.edge = intrinsicAssociationConstraintEdge
do self.remove(intrinsicAssociationConstraintMap);
let intrinsicAssociationConstraint = intrinsicAssociationConstraintMap.intrinsicAssociationConstraint
in intrinsicAssociationConstraint.remove();
intrinsicAssociationConstraint.owner.remove(intrinsicAssociationConstraint)
end
end
end
@Operation associationRemoved(association)
@Find(associationMap,associationMaps)
when associationMap.association = association
do
self.remove(associationMap);
associationMap.edge.delete()
end
end
@Operation associationInstanceRemoved(associationInstance)
@Find(associationInstanceMap,associationInstanceMaps)
when associationInstanceMap.associationInstance = associationInstance
do
self.remove(associationInstanceMap);
associationInstanceMap.edge.delete()
end
end
@Operation intrinsicAssociationConstraintRemoved(intrinsicAssociationConstraint)
@Find(intrinsicAssociationConstraintMap,intrinsicAssociationConstraintMaps)
when intrinsicAssociationConstraintMap.intrinsicAssociationConstraint = intrinsicAssociationConstraint
do
self.remove(intrinsicAssociationConstraintMap);
intrinsicAssociationConstraintMap.edge.delete()
end
end
@Operation delegationSourceChanged(delegationMap,newSourceNode,oldSourceNode)
@Find(oldClassMap,self.classMaps)
when oldClassMap.node = oldSourceNode do
@Find(newClassMap,self.classMaps)
when newClassMap.node = newSourceNode do
let oldClass = oldClassMap.class;
newClass = newClassMap.class
in
@WithoutDaemons(newClass)
newClass.delegatesTo := oldClass.delegatesTo
end;
@WithoutDaemons(oldClass)
oldClass.delegatesTo := null
end
end
end
end
end
@Operation delegationTargetChanged(delegationMap,newTargetNode,sourceNode)
@Find(sourceClassMap,self.classMaps)
when sourceClassMap.node = sourceNode do
@Find(newClassMap,self.classMaps)
when newClassMap.node = newTargetNode do
let sourceClass = sourceClassMap.class;
newClass = newClassMap.class
in
@WithoutDaemons(sourceClass)
sourceClass.delegatesTo := newClass
end
end
end
end
end
@Operation associationEnd1Changed(associationMap,newEnd1Node)
@Find(classMap,self.abstractClassMaps())
when classMap.node = newEnd1Node
do let association = associationMap.association then
end1 = association.end1
in end1.remove();
end1.type := classMap.element();
end1.init();
self.elementChanged()
end
end
end
@Operation associationEnd2Changed(associationMap,newEnd2Node)
@Find(classMap,self.abstractClassMaps())
when classMap.node = newEnd2Node
do let association = associationMap.association then
end2 = association.end2
in end2.remove();
end2.type := classMap.element();
end2.init();
self.elementChanged()
end
end
end
@Operation associationEdgeAddedDaemon(diagram,slot,associationEdge)
self.associationEdgeAdded(associationEdge)
end
@Operation associationEdgeRemovedDaemon(diagram,slot,associationEdge)
self.associationEdgeRemoved(associationEdge)
end
@Operation associationInstanceEdgeAddedDaemon(diagram,slot,associationInstanceEdge)
self.associationInstanceEdgeAdded(associationInstanceEdge)
end
@Operation associationInstanceEdgeRemovedDaemon(diagram,slot,associationInstanceEdge)
self.associationInstanceEdgeRemoved(associationInstanceEdge)
end
@Operation intrinsicAssociationConstraintEdgeAddedDaemon(diagram,slot,intrinsicAssociationConstraint)
self.intrinsicAssociationConstraintEdgeAdded(intrinsicAssociationConstraint)
end
@Operation intrinsicAssociationConstraintEdgeRemovedDaemon(diagram,slot,intrinsicAssociationConstraint)
self.intrinsicAssociationConstraintEdgeRemoved(intrinsicAssociationConstraint)
end
@Operation attributeEdgeAddedDaemon(diagram,slot,attributeEdge)
self.attributeEdgeAdded(attributeEdge)
end
@Operation attributeEdgeRemovedDaemon(diagram,slot,attributeEdge)
self.attributeEdgeRemoved(attributeEdge)
end
@Operation attributeEdgeRemoved(attributeEdge)
@Find(attributeMap,attributeMaps)
when attributeMap.edge = attributeEdge
do
self.remove(attributeMap);
let attribute = attributeMap.attribute
in attribute.owner.remove(attribute)
end
end
end
@Operation attributeOwnerChanged(attributeMap)
// If the owner changes then remove the attribute map
// and re-add the attribute only if the source of the
// attribute edge is not the current owner.
@Find(map,self.abstractClassMaps())
when map.element() = attributeMap.attribute.owner and
map.node = attributeMap.edge.source.owner
else self.remove(attributeMap);
attributeMap.edge.delete();
self.attributeAdded(attributeMap.attribute)
end
end
@Operation attributeRemoved(attribute)
@Find(attributeMap,attributeMaps)
when attributeMap.attribute = attribute
do
self.remove(attributeMap);
attributeMap.edge.delete()
end
end
@Operation attributeSourceChanged(attributeMap,newNode)
@Find(map,self.abstractClassMaps())
when map.node = newNode
do let attribute = attributeMap.attribute
in attribute.owner.remove(attribute);
map.element().add(attribute);
self.elementChanged()
end
else
attributeMap.edge.delete()
end
end
@Operation attributeTargetChanged(attributeMap,newClassNode)
@Find(map,self.abstractClassMaps())
when map.node = newClassNode
do let attribute = attributeMap.attribute;
mult = attributeMap.edge.mult();
class = map.element()
in attribute.type := class;
attribute.updateTypeFromMult();
self.elementChanged()
end
else
attributeMap.edge.delete()
end
end
@Operation attributeTypeChanged(attributeMap)
// Remove the attribute map and re-enter the attribute
// in the case where the edge does not have the type as
// a target.
let foundMap =
@Find(map,self.abstractClassMaps())
when map.element() = attributeMap.attribute.underlyingType() and
map.node = attributeMap.edge.target.owner
else null
end
in
if foundMap.isKindOf(Null)
then
self.remove(attributeMap);
attributeMap.edge.delete();
self.attributeAdded(attributeMap.attribute)
end
end
end
@Operation buildGlobalMenu(rightClickable)
let globalMenu = rightClickable.globalMenu(false)
in
self.buildGlobalMenuExtras(globalMenu);
globalMenu.new();
globalMenu
end
end
@Operation buildGlobalMenuExtras(globalMenu)
super(globalMenu);
globalMenu.add(MenuAction("Add Missing Package Contents to Diagram",RightClickableProxy::proxyTarget,Seq{},PackageXClassDiagram::addMissingContents));
//globalMenu.add(MenuAction("Inherit",RightClickableProxy::proxyTarget,Seq{},PackageXClassDiagram::inheritMenu));
self
end
@Operation checkDaemons()
// Check that the package and diagram have the
// appropriate daemons.
super();
self.checkPackageDaemons();
self.checkDiagramDaemons()
end
@Operation checkDiagramDaemons()
@SlotValueChanged multi once + PackageXClassDiagram::noteNodeAdded(diagram,"noteNodes") end;
@SlotValueChanged multi once - PackageXClassDiagram::noteNodeRemoved(diagram,"noteNodes") end;
@SlotValueChanged multi once + PackageXClassDiagram::classNodeAddedDaemon(diagram,"classNodes") end;
// @SlotValueChanged multi once - PackageXClassDiagram::classNodeRemovedDaemon(diagram,"classNodes") end;
@SlotValueChanged multi once + PackageXClassDiagram::packageNodeAddedDaemon(diagram,"packageNodes") end;
// @SlotValueChanged multi once - PackageXClassDiagram::packageNodeRemovedDaemon(diagram,"packageNodes") end;
@SlotValueChanged multi once - PackageXClassDiagram::elementNodeRemovedDaemon(diagram,"elementNodes") end;
@SlotValueChanged multi once + PackageXClassDiagram::inheritanceEdgeAddedDaemon(diagram,"inheritanceEdges") end;
// @SlotValueChanged multi once - PackageXClassDiagram::inheritanceEdgeRemovedDaemon(diagram,"inheritanceEdges") end;
@SlotValueChanged multi once + PackageXClassDiagram::containsEdgeAddedDaemon(diagram,"containsEdges") end;
@SlotValueChanged multi once - PackageXClassDiagram::containsEdgeRemovedDaemon(diagram,"containsEdges") end;
@SlotValueChanged multi once + PackageXClassDiagram::dependencyEdgeAddedDaemon(diagram,"dependencyEdges") end;
@SlotValueChanged multi once - PackageXClassDiagram::dependencyEdgeRemovedDaemon(diagram,"dependencyEdges") end;
@SlotValueChanged multi once + PackageXClassDiagram::delegationEdgeAddedDaemon(diagram,"delegationEdges") end;
@SlotValueChanged multi once - PackageXClassDiagram::delegationEdgeRemovedDaemon(diagram,"delegationEdges") end;
@SlotValueChanged multi once + PackageXClassDiagram::associationEdgeAddedDaemon(diagram,"associationEdges") end;
// @SlotValueChanged multi once - PackageXClassDiagram::associationEdgeRemovedDaemon(diagram,"associationEdges") end;
@SlotValueChanged multi once + PackageXClassDiagram::attributeEdgeAddedDaemon(diagram,"attributeEdges") end;
@SlotValueChanged multi once - PackageXClassDiagram::attributeEdgeRemovedDaemon(diagram,"attributeEdges") end;
@SlotValueChanged multi once + PackageXClassDiagram::associationInstanceEdgeAddedDaemon(diagram,"associationInstanceEdges") end;
@SlotValueChanged multi once - PackageXClassDiagram::associationInstanceEdgeRemovedDaemon(diagram,"associationInstanceEdges") end;
@SlotValueChanged multi once + PackageXClassDiagram::intrinsicAssociationConstraintEdgeAddedDaemon(diagram,"intrinsicAssociationConstraintEdges") end;
@SlotValueChanged multi once - PackageXClassDiagram::intrinsicAssociationConstraintEdgeRemovedDaemon(diagram,"intrinsicAssociationConstraintEdges") end
end