Skip to content

Commit

Permalink
Create/remove attribute controller when association navigability is c…
Browse files Browse the repository at this point in the history
…hanged
  • Loading branch information
JanBliznicenko committed Nov 23, 2024
1 parent dab7b13 commit af67c8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,16 @@ OPUmlAssociationController >> writeMultiplicityFrom: aString to: aProperty [

{ #category : 'writing' }
OPUmlAssociationController >> writeNavigability: isNavigable to: aProperty [

isNavigable
ifTrue: [ aProperty owningClass: aProperty opposite type.
aProperty owningAssociation: nil ]
ifFalse: [ aProperty owningClass: nil.
aProperty owningAssociation: aProperty association ]
ifTrue: [
aProperty owningClass: aProperty opposite type.
aProperty owningAssociation: nil.
self diagramController showInDiagramModel: aProperty ]
ifFalse: [
aProperty owningClass: nil.
aProperty owningAssociation: aProperty association.
self diagramController
controllerForModel: aProperty
ifFound: [ :found | found removeControllerAndDiagramElement ] ]
]
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ OPUmlAssociationControllerTest >> testRemovalOfAssociationRemovesMemberEnds [

{ #category : 'tests' }
OPUmlAssociationControllerTest >> testWriteNavigabilityAssocOwnedToClassOwned [

| first second |
self prepareToShow.
controller diagramController: diagramController.
first := model memberEnds first.
second := model memberEnds second.
controller writeNavigability: true to: second.
Expand All @@ -83,6 +85,7 @@ OPUmlAssociationControllerTest >> testWriteNavigabilityAssocOwnedToClassOwned [
OPUmlAssociationControllerTest >> testWriteNavigabilityClassOwnedToAssocOwned [
| first |
self prepareToShow.
controller diagramController: diagramController.
first := model memberEnds first.
controller writeNavigability: false to: first.
self deny: first isNavigable.
Expand Down

0 comments on commit af67c8c

Please sign in to comment.