diff --git a/src/Roassal-Inspector/SpRoassal3InspectorPresenter.class.st b/src/Roassal-Inspector/SpRoassal3InspectorPresenter.class.st index 14239ce8..427893b8 100644 --- a/src/Roassal-Inspector/SpRoassal3InspectorPresenter.class.st +++ b/src/Roassal-Inspector/SpRoassal3InspectorPresenter.class.st @@ -1,95 +1,14 @@ " -I am the default Roassal inspector presenter. I work with RSContextInteraction +This class is deprecated please use SpRoassalInspectorPresenter " Class { - #name : #SpRoassalInspectorPresenter, - #superclass : #SpPresenter, - #instVars : [ - 'canvas', - 'roassalMorph', - 'toolBar' - ], + #name : #SpRoassal3InspectorPresenter, + #superclass : #SpRoassalInspectorPresenter, #category : #'Roassal-Inspector-SP2' } -{ #category : #layout } -SpRoassalInspectorPresenter class >> defaultLayout [ - ^ SpBoxLayout newTopToBottom - add: #roassalMorph; - yourself -] - -{ #category : #ports } -SpRoassalInspectorPresenter >> activateOnDoubleClick [ -] - -{ #category : #ports } -SpRoassalInspectorPresenter >> activateOnSingleClick [ -] - -{ #category : #accessing } -SpRoassalInspectorPresenter >> canvas [ - ^ canvas -] - -{ #category : #accessing } -SpRoassalInspectorPresenter >> canvas: aRSCanvas [ - canvas := aRSCanvas. - roassalMorph morph: canvas createMorph -] - -{ #category : #enumerating } -SpRoassalInspectorPresenter >> createToolbarIfNecessary [ - | context interactions | - context := canvas inspectorContext. - interactions := context inspectorInteractions. - interactions ifEmpty: [ ^ self ]. - toolBar := SpBoxLayout newLeftToRight. - interactions do: [ :cls | | i | - i := cls new. - i canvas: canvas. - toolBar add: i newButton withConstraints: [ :constraints | - constraints - width: 20; - height: 20 ] ]. - self layout: (SpBoxLayout newTopToBottom - add: toolBar height: 25; - add: #roassalMorph; - yourself) -] - -{ #category : #ports } -SpRoassalInspectorPresenter >> defaultOutputPort [ - - ^ self outputSelectionPort -] - -{ #category : #initialization } -SpRoassalInspectorPresenter >> initializePresenters [ - roassalMorph := self newMorph. - toolBar := self newButton. - toolBar label: 'fooo' -] - -{ #category : #ports } -SpRoassalInspectorPresenter >> outputActivationPort [ - ^ SpActivationPort newPresenter: self -] - -{ #category : #ports } -SpRoassalInspectorPresenter >> outputSelectionPort [ - ^ SpActivationPort newPresenter: self -] - -{ #category : #enumerating } -SpRoassalInspectorPresenter >> whenActivatedDo: aBlock [ - | context | - self createToolbarIfNecessary. - context := canvas inspectorContext. - context presentation: aBlock. - canvas shapes @ context. - canvas - when: RSShapeAddedEvent - do: [ :evt | evt shape @ context ] - for: self +{ #category : #testing } +SpRoassal3InspectorPresenter class >> isDeprecated [ + "please use SpRoassalInspectorPresenter" + ^ true ] diff --git a/src/Roassal-Inspector/SpRoassalInspectorPresenter.class.st b/src/Roassal-Inspector/SpRoassalInspectorPresenter.class.st new file mode 100644 index 00000000..14239ce8 --- /dev/null +++ b/src/Roassal-Inspector/SpRoassalInspectorPresenter.class.st @@ -0,0 +1,95 @@ +" +I am the default Roassal inspector presenter. I work with RSContextInteraction +" +Class { + #name : #SpRoassalInspectorPresenter, + #superclass : #SpPresenter, + #instVars : [ + 'canvas', + 'roassalMorph', + 'toolBar' + ], + #category : #'Roassal-Inspector-SP2' +} + +{ #category : #layout } +SpRoassalInspectorPresenter class >> defaultLayout [ + ^ SpBoxLayout newTopToBottom + add: #roassalMorph; + yourself +] + +{ #category : #ports } +SpRoassalInspectorPresenter >> activateOnDoubleClick [ +] + +{ #category : #ports } +SpRoassalInspectorPresenter >> activateOnSingleClick [ +] + +{ #category : #accessing } +SpRoassalInspectorPresenter >> canvas [ + ^ canvas +] + +{ #category : #accessing } +SpRoassalInspectorPresenter >> canvas: aRSCanvas [ + canvas := aRSCanvas. + roassalMorph morph: canvas createMorph +] + +{ #category : #enumerating } +SpRoassalInspectorPresenter >> createToolbarIfNecessary [ + | context interactions | + context := canvas inspectorContext. + interactions := context inspectorInteractions. + interactions ifEmpty: [ ^ self ]. + toolBar := SpBoxLayout newLeftToRight. + interactions do: [ :cls | | i | + i := cls new. + i canvas: canvas. + toolBar add: i newButton withConstraints: [ :constraints | + constraints + width: 20; + height: 20 ] ]. + self layout: (SpBoxLayout newTopToBottom + add: toolBar height: 25; + add: #roassalMorph; + yourself) +] + +{ #category : #ports } +SpRoassalInspectorPresenter >> defaultOutputPort [ + + ^ self outputSelectionPort +] + +{ #category : #initialization } +SpRoassalInspectorPresenter >> initializePresenters [ + roassalMorph := self newMorph. + toolBar := self newButton. + toolBar label: 'fooo' +] + +{ #category : #ports } +SpRoassalInspectorPresenter >> outputActivationPort [ + ^ SpActivationPort newPresenter: self +] + +{ #category : #ports } +SpRoassalInspectorPresenter >> outputSelectionPort [ + ^ SpActivationPort newPresenter: self +] + +{ #category : #enumerating } +SpRoassalInspectorPresenter >> whenActivatedDo: aBlock [ + | context | + self createToolbarIfNecessary. + context := canvas inspectorContext. + context presentation: aBlock. + canvas shapes @ context. + canvas + when: RSShapeAddedEvent + do: [ :evt | evt shape @ context ] + for: self +]