Skip to content

Commit

Permalink
Add uses relationships as composition in FamixUMLRoassalBackend
Browse files Browse the repository at this point in the history
  • Loading branch information
anquetil committed Jun 11, 2024
1 parent 8c7cc68 commit 0c383d0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Famix-UMLDocumentor/FamixUMLRoassalBackend.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ FamixUMLRoassalBackend >> canvas [

{ #category : #api }
FamixUMLRoassalBackend >> export: famixUMLEntities [

"note: formating is described in #modelDescriptor:"
| builder |

builder := RSUMLClassBuilder new.
builder modelDescriptor: (FamixUMLRoassalDescriptor new umlModel: famixUMLEntities ; yourself).

builder classes: (famixUMLEntities select: [:e | e class = FamixUMLClass]).
builder build.

Expand Down
20 changes: 19 additions & 1 deletion src/Famix-UMLDocumentor/FamixUMLRoassalDescriptor.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
"
Used by Roassal (`RSUMLClassBuilder`) to get informations about classes to put in the visualization
""Formating"" is in #initialize
The other methods or mainly helpers
API:
- aggregations -- returns all aggregations in the model
- compositions -- used to represent class-use-trait relationships
"
Class {
#name : #FamixUMLRoassalDescriptor,
Expand Down Expand Up @@ -28,6 +36,16 @@ FamixUMLRoassalDescriptor >> aggregations [
(self umlClassNamed: aggreg source) -> (self umlClassNamed: aggreg target) ])
]

{ #category : #accessing }
FamixUMLRoassalDescriptor >> compositions [

^(umlModel
select: [ :umlEntity | umlEntity class = FamixUMLUse ]
thenCollect: [ :use |
(self umlClassNamed: use target) -> (self umlClassNamed: use source) ])

]

{ #category : #initialization }
FamixUMLRoassalDescriptor >> initialize [

Expand All @@ -39,7 +57,7 @@ FamixUMLRoassalDescriptor >> initialize [
instVars: [ :famixUMLClass | famixUMLClass properties sorted: #name ascending ] ;
methods: [ :famixUMLClass | #() ] ;
instVarSelector: #name ;
methodsLimit: SmallInteger maxVal ;
"methodSelector: #name ;"
isAbstract: [ :famixUMLClass | famixUMLClass isStub ]
]

Expand Down

0 comments on commit 0c383d0

Please sign in to comment.