Skip to content

Commit

Permalink
Allow informing owning shapes of recursive child being rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 16, 2024
1 parent 714a80a commit 9d4b6b1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
8 changes: 4 additions & 4 deletions repository/OpenPonk-Core/OPController.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ OPController >> descriptionName [
read: [ :me | me model name ]
write: [ :me :newValue |
me model name: newValue.
self diagramElement modelChanged ].
self modelChanged ].
^ MAStringDescription new
accessor: accessor;
label: 'Name';
Expand Down Expand Up @@ -237,11 +237,11 @@ OPController >> parentWhenTargetFor: aCreatedController [
OPController >> refreshFigure [

self
deprecated: 'Use #diagramElement modelChanged instead'
deprecated: 'Use #modelChanged instead'
transformWith: '`@receiver refreshFigure'
-> '`@receiver diagramElement modelChanged'.
-> '`@receiver modelChanged'.

^ self diagramElement modelChanged
^ self modelChanged
]

{ #category : 'deprecated' }
Expand Down
17 changes: 11 additions & 6 deletions repository/OpenPonk-Core/OPDiagramElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -346,19 +346,18 @@ OPDiagramElement >> ownModelElement [

{ #category : 'initialization' }
OPDiagramElement >> ownedElement: aShape renderedIn: aCanvas [
"do nothing"


self recursivelyOwnedElement: aShape renderedIn: aCanvas
]

{ #category : 'initialization' }
OPDiagramElement >> ownedElement: aShape willRenderIn: aCanvas [

self isRendered ifTrue: [
self
assert: roassalShape canvas = aCanvas
description:
'Reusing same diagram element for 2 canvases not allowed' ].
^ self
assert: roassalShape canvas = aCanvas
description:
'Reusing same diagram element for 2 canvases not allowed' ].
self renderIn: aCanvas
]

Expand Down Expand Up @@ -414,6 +413,12 @@ OPDiagramElement >> pushFront [
self attachedShapesDo: [ :each | each pushFront ]
]

{ #category : 'initialization' }
OPDiagramElement >> recursivelyOwnedElement: aShape renderedIn: aCanvas [

self owningElement recursivelyOwnedElement: aShape renderedIn: aCanvas
]

{ #category : 'removing' }
OPDiagramElement >> remove [

Expand Down
7 changes: 7 additions & 0 deletions repository/OpenPonk-Core/OPNoShape.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ OPNoShape >> readSlotNamed: aName [
^ nil
]

{ #category : 'initialization' }
OPNoShape >> recursivelyOwnedElement: aShape renderedIn: aCanvas [
"do nothing"


]

{ #category : 'removing' }
OPNoShape >> remove [
"do nothing"
Expand Down
2 changes: 1 addition & 1 deletion repository/OpenPonk-Spec/OPDiagramExplorer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ OPDiagramExplorer >> showElement: aModelObject [
aModelObject.
diagramController enableRefresh.
existingCtrl ifNil: [ ^ self ].
ctrl diagramElement modelChanged
ctrl modelChanged
]

{ #category : 'actions' }
Expand Down

0 comments on commit 9d4b6b1

Please sign in to comment.