Skip to content

Commit

Permalink
Simplified modelChanged code
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 16, 2024
1 parent 9fd547e commit 5b20e84
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ OPPetriNetArcControllerTest >> testFigureRefresh [
label := controller diagramElement ownedElements first.
self assert: label roassalShape text equals: ''.
controller model name: 'new name'.
controller diagramElement modelChanged.
controller modelChanged.
self assert: label roassalShape text equals: 'new name'
]
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ OPPetriNetNodeController >> buildEditorForm: aForm [

(aForm addText: 'Name')
text: self model name;
whenTextChangedDo: [ :newValue |
whenTextChangedDo: [ :newValue |
self model name: newValue asString.
self diagramElement modelChanged ]
self modelChanged ]
]

{ #category : 'testing' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ OPPetriNetNodeControllerTest >> testFigureRefresh [
assert: (controller roassalShape propertyAt: #RSLabeled) text
equals: ''.
controller model name: 'new name'.
controller diagramElement modelChanged.
controller modelChanged.
text := (controller roassalShape propertyAt: #RSLabeled) text.
self assert:
((text last: 8) = 'new name' or: [ (text first: 8) = 'new name' ])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ OPPetriNetNormalArcControllerTest >> testFigureRefresh [
label := controller diagramElement ownedElements second.
self assert: label roassalShape text equals: ''.
controller model weight: 10.
controller diagramElement modelChanged.
controller modelChanged.
self assert: (label roassalShape text last: 2) equals: '10'
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OPPetriNetWeightedArcController >> buildEditorForm: aForm [
super buildEditorForm: aForm.
(aForm addTextInput: 'Weight')
text: self model weight asString;
whenTextChangedDo: [ :newValue |
whenTextChangedDo: [ :newValue |
self model weight: (newValue asString asInteger ifNil: [ 1 ]).
self diagramElement modelChanged ]
self modelChanged ]
]

0 comments on commit 5b20e84

Please sign in to comment.