diff --git a/repository/OpenPonk-FSM/OPFsmSimulator.class.st b/repository/OpenPonk-FSM/OPFsmSimulator.class.st index 3f0638f..8bce3b8 100644 --- a/repository/OpenPonk-FSM/OPFsmSimulator.class.st +++ b/repository/OpenPonk-FSM/OPFsmSimulator.class.st @@ -294,36 +294,51 @@ OPFsmSimulator >> stopButton [ { #category : 'events' } OPFsmSimulator >> watchRecognizer: aRecognizer [ - aRecognizer when: OPFsmRecognizerEvent do: [ :ann | - aRecognizer isInputEmpty ifFalse: [ - nextButton enable. - runButton enable ]. - aRecognizer isPathEmpty ifFalse: [ backButton enable ]. - (ann isKindOf: OPFsmRecognizerFailure) not & ann place isState - ifTrue: [ + aRecognizer + when: OPFsmRecognizerEvent + do: [ :ann | + aRecognizer isInputEmpty ifFalse: [ + nextButton enable. + runButton enable ]. + aRecognizer isPathEmpty ifFalse: [ backButton enable ]. + (ann isKindOf: OPFsmRecognizerFailure) not & ann place isState + ifTrue: [ + self letterPanel + changeBoxAt: aRecognizer inputPosition - 1 + to: #success ]. + ann place isTransition ifTrue: [ self letterPanel changeBoxAt: aRecognizer inputPosition - 1 - to: #success ]. - ann place isTransition ifTrue: [ + to: #processed ] ] + for: self. + aRecognizer + when: OPFsmRecognizerSuccess + do: [ :ann | + OPFsmFigureHighlighter + highlightNode: (diagramController roassalShapeForModel: ann place) + with: Color green ] + for: self. + aRecognizer + when: OPFsmRecognizerFailure + do: [ :ann | + OPFsmFigureHighlighter + highlightNode: (diagramController roassalShapeForModel: ann place) + with: Color red. self letterPanel changeBoxAt: aRecognizer inputPosition - 1 - to: #processed ] ]. - aRecognizer when: OPFsmRecognizerSuccess do: [ :ann | - OPFsmFigureHighlighter - highlightNode: (diagramController roassalShapeForModel: ann place) - with: Color green ]. - aRecognizer when: OPFsmRecognizerFailure do: [ :ann | - OPFsmFigureHighlighter - highlightNode: (diagramController roassalShapeForModel: ann place) - with: Color red. - self letterPanel - changeBoxAt: aRecognizer inputPosition - 1 - to: #failure ]. - aRecognizer when: OPFsmRecognizerLeave do: [ :ann | - OPFsmFigureHighlighter unhighlight: - (diagramController roassalShapeForModel: ann place) ]. - aRecognizer when: OPFsmRecognizerEnter do: [ :ann | - OPFsmFigureHighlighter - highlight: (diagramController roassalShapeForModel: ann place) - with: Color orange ] + to: #failure ] + for: self. + aRecognizer + when: OPFsmRecognizerLeave + do: [ :ann | + OPFsmFigureHighlighter unhighlight: + (diagramController roassalShapeForModel: ann place) ] + for: self. + aRecognizer + when: OPFsmRecognizerEnter + do: [ :ann | + OPFsmFigureHighlighter + highlight: (diagramController roassalShapeForModel: ann place) + with: Color orange ] + for: self ] diff --git a/repository/OpenPonk-FSM/OPFsmTerminalPanelAdapter.class.st b/repository/OpenPonk-FSM/OPFsmTerminalPanelAdapter.class.st index 79e5440..41e710d 100644 --- a/repository/OpenPonk-FSM/OPFsmTerminalPanelAdapter.class.st +++ b/repository/OpenPonk-FSM/OPFsmTerminalPanelAdapter.class.st @@ -28,7 +28,7 @@ OPFsmTerminalPanelAdapter >> buildWidget [ yourself. self model whenRecognizerStateChangedDo: [ :event | - morph changeBoxAt: event inputPosition to: event inputState ]; - whenDataChangedDo: [ :event | morph data: event data ]. + morph changeBoxAt: event inputPosition to: event inputState ] for: self; + whenDataChangedDo: [ :event | morph data: event data ] for: self. ^ morph ] diff --git a/repository/OpenPonk-FSM/OPFsmTerminalPanelPresenter.class.st b/repository/OpenPonk-FSM/OPFsmTerminalPanelPresenter.class.st index 055bb43..4876d8f 100644 --- a/repository/OpenPonk-FSM/OPFsmTerminalPanelPresenter.class.st +++ b/repository/OpenPonk-FSM/OPFsmTerminalPanelPresenter.class.st @@ -36,13 +36,19 @@ OPFsmTerminalPanelPresenter >> data: aString [ ] { #category : 'event handling' } -OPFsmTerminalPanelPresenter >> whenDataChangedDo: aBlock [ +OPFsmTerminalPanelPresenter >> whenDataChangedDo: aBlock for: aSubscriber [ - self announcer when: OPFsmTerminalDataChanged do: aBlock + self announcer + when: OPFsmTerminalDataChanged + do: aBlock + for: aSubscriber ] { #category : 'event handling' } -OPFsmTerminalPanelPresenter >> whenRecognizerStateChangedDo: aBlock [ +OPFsmTerminalPanelPresenter >> whenRecognizerStateChangedDo: aBlock for: aSubscriber [ - self announcer when: OPFsmTerminalRecognizerStateChanged do: aBlock + self announcer + when: OPFsmTerminalRecognizerStateChanged + do: aBlock + for: aSubscriber ]