diff --git a/repository/OpenPonk-Core/OPAbstractDiagramControllerTest.class.st b/repository/OpenPonk-Core/OPAbstractDiagramControllerTest.class.st index 224a0a97..3867e665 100644 --- a/repository/OpenPonk-Core/OPAbstractDiagramControllerTest.class.st +++ b/repository/OpenPonk-Core/OPAbstractDiagramControllerTest.class.st @@ -17,7 +17,7 @@ OPAbstractDiagramControllerTest >> setUp [ super setUp. controller model: model. - controller diagramElement: OPDiagram new. + controller diagramElement: (OPOpenPonkDiagram forModelElement: model). controller canvasPresenter: (OPCanvasPresenter new canvas: RSCanvas new; yourself) diff --git a/repository/OpenPonk-Core/OPAbstractDirectionalRelationshipControllerTest.class.st b/repository/OpenPonk-Core/OPAbstractDirectionalRelationshipControllerTest.class.st index 66442025..9bb13d8f 100644 --- a/repository/OpenPonk-Core/OPAbstractDirectionalRelationshipControllerTest.class.st +++ b/repository/OpenPonk-Core/OPAbstractDirectionalRelationshipControllerTest.class.st @@ -235,14 +235,6 @@ OPAbstractDirectionalRelationshipControllerTest >> testCreateUsingAddAsTarget [ equals: self diagramElementClass ] -{ #category : 'tests - construction' } -OPAbstractDirectionalRelationshipControllerTest >> testFigureWasRendered [ - - self showInDiagram. - self assert: - (diagramController canvas lines includes: controller roassalShape) -] - { #category : 'tests' } OPAbstractDirectionalRelationshipControllerTest >> testRemovalOfSourceRemovesRelationship [ @@ -273,6 +265,14 @@ OPAbstractDirectionalRelationshipControllerTest >> testRemoveController [ hasSameElements: { } ] +{ #category : 'tests - construction' } +OPAbstractDirectionalRelationshipControllerTest >> testRoassalShapeWasRendered [ + + self showInDiagram. + self assert: + (diagramController canvas lines includes: controller roassalShape) +] + { #category : 'as yet unclassified' } OPAbstractDirectionalRelationshipControllerTest >> testSetupOfTheTest [ "tests mostly whether the creationTarget is really the same thing as source - in case it is not, it is probably fault of the test class itself" diff --git a/repository/OpenPonk-Core/OPAbstractElementControllerTest.class.st b/repository/OpenPonk-Core/OPAbstractElementControllerTest.class.st index 0de19d0f..cfee4af4 100644 --- a/repository/OpenPonk-Core/OPAbstractElementControllerTest.class.st +++ b/repository/OpenPonk-Core/OPAbstractElementControllerTest.class.st @@ -75,7 +75,8 @@ OPAbstractElementControllerTest >> setUp [ diagramController canvasPresenter: (OPCanvasPresenter new canvas: RSCanvas new; yourself). - diagramController diagramElement: OPDiagram new. + diagramController diagramElement: + (OPOpenPonkDiagram forModelElement: diagramController model). self setUpCreationTarget ] @@ -122,11 +123,142 @@ OPAbstractElementControllerTest >> testAddController [ self prepareToShow. diagramController addController: controller. self - assert: (diagramController controllerForModel: model) + assert: (diagramController controllerForModel: self model) equals: controller. self assert: controller diagramController equals: diagramController ] +{ #category : 'tests - ui interaction' } +OPAbstractElementControllerTest >> testBeingCopiedWithDiagram [ + + | diagram diagramElement diagramControllerOfCopy | + self assertEmpty: diagramController controllers. + self showInDiagram. + diagram := diagramController diagramElement. + diagramElement := controller diagramElement. + self assert: (diagramController hasControllerForModel: self model). + self + assertCollection: diagram allOwnedElements + includesAll: { diagramElement }. + self + assertCollection: diagramController controllers + includesAll: { controller }. + diagramControllerOfCopy := self diagramControllerClass new. + diagramControllerOfCopy model: diagramController model. + self + shouldnt: [ diagramControllerOfCopy diagramElement: diagram newCopy ] + raise: OPInvalidWarning. + diagramControllerOfCopy canvasPresenter: (OPCanvasPresenter new + canvas: RSCanvas new; + yourself). + diagramControllerOfCopy diagramFocused. + self + assertCollection: + (diagramControllerOfCopy diagram allOwnedElements collect: + #modelElement) + hasSameElements: + (diagramController diagram allOwnedElements collect: #modelElement). + self + assertCollection: + (diagramControllerOfCopy controllers collect: #model) + hasSameElements: (diagramController controllers collect: #model) +] + +{ #category : 'tests - ui interaction' } +OPAbstractElementControllerTest >> testBeingKeptWhenEditorFocusChanges [ + + self + assertCollection: diagramController controllers + hasSameElements: { }. + self showInDiagram. + self + assertCollection: diagramController controllers + includesAll: { controller }. + diagramController diagramFocused. + self + assertCollection: diagramController controllers + includesAll: { controller } +] + +{ #category : 'tests - ui interaction' } +OPAbstractElementControllerTest >> testBeingRemovedAfterModelRemovalWhenNotRendered [ + + | diagram diagramElement newDiagramControllerBlock diagramControllerOfCopy controllerOfCopy recreatedDiagramController | + self + denyCollection: diagramController controllers + includesAll: { controller }. + self showInDiagram. + diagram := diagramController diagramElement. + diagramElement := controller diagramElement. + self + assertCollection: diagram allOwnedElements + includesAll: { diagramElement }. + self + assertCollection: diagramController controllers + includesAll: { controller }. + self assert: diagramElement isRendered. + diagramController removeController. + self + assertCollection: diagram allOwnedElements + includesAll: { diagramElement }. + self deny: diagramElement isRendered. + self + denyCollection: diagramController controllers + includesAll: { controller }. + newDiagramControllerBlock := [ :copyOfDiagram | + | newDiagramController | + newDiagramController := self + diagramControllerClass + new. + newDiagramController model: + diagramController model. + newDiagramController diagramElement: + copyOfDiagram. + newDiagramController canvasPresenter: + (OPCanvasPresenter new + canvas: RSCanvas new; + yourself). + newDiagramController diagramFocused. + newDiagramController ]. + + + self + shouldnt: [ + diagramControllerOfCopy := newDiagramControllerBlock value: + diagram newCopy ] + raise: OPInvalidWarning. + controllerOfCopy := diagramControllerOfCopy controllerForModel: model. + controllerOfCopy removeModel. + recreatedDiagramController := newDiagramControllerBlock value: + diagram. + recreatedDiagramController validate. + self + denyCollection: diagram allOwnedElements + includesAll: { diagramElement }. + self deny: diagramElement isRendered. + self + denyCollection: recreatedDiagramController controllers + includesAll: { controller } +] + +{ #category : 'tests - ui interaction' } +OPAbstractElementControllerTest >> testBeingRemovedAfterModelRemovalWhenRendered [ + + self + denyCollection: diagramController controllers + includesAll: { controller }. + self showInDiagram. + self + assertCollection: diagramController controllers + includesAll: { controller }. + controller removeModel. + controller model: model. + diagramController diagramFocused. + self + denyCollection: diagramController controllers + includesAll: { controller } +] + { #category : 'tests' } OPAbstractElementControllerTest >> testClassSideModelClass [ @@ -145,7 +277,11 @@ OPAbstractElementControllerTest >> testCreateAndShow [ includesAll: { controller }. self assertCollection: diagramController canvas shapes - includesAll: { controller roassalShape } + includesAll: { controller roassalShape }. + self + assert: diagramController isRendered + description: + 'Diagram controller not showing as rendered when element is' ] { #category : 'tests' } @@ -223,27 +359,11 @@ OPAbstractElementControllerTest >> testDescriptionName [ diagramElement should receive modelChanged ] -{ #category : 'tests - controllers' } -OPAbstractElementControllerTest >> testFigureForModel [ - - self showInDiagram. - self - assert: (diagramController roassalShapeForModel: model) - equals: controller roassalShape -] - -{ #category : 'tests - construction' } -OPAbstractElementControllerTest >> testFigureWasRendered [ - - self showInDiagram. - self assert: - (diagramController canvas nodes includes: controller roassalShape) -] - { #category : 'tests' } OPAbstractElementControllerTest >> testIsSupported [ - self assert: (diagramController hasSupportForModel: model) + self assert: + (diagramController hasSupportForModel: self controllersByModelsKey) ] { #category : 'tests' } @@ -257,12 +377,13 @@ OPAbstractElementControllerTest >> testModelForFigure [ self showInDiagram. self assert: (diagramController modelForFigure: controller roassalShape) - equals: model + equals: self model ] { #category : 'tests - controllers' } -OPAbstractElementControllerTest >> testNewController [ - controller := diagramController newControllerFor: model. +OPAbstractElementControllerTest >> testNewControllerFor [ + + controller := diagramController newControllerFor: self controllersByModelsKey. self assert: controller class equals: self controllerClass ] @@ -321,6 +442,23 @@ OPAbstractElementControllerTest >> testRemoveModel [ self denyCollection: self allElements includesAll: { model } ] +{ #category : 'tests - controllers' } +OPAbstractElementControllerTest >> testRoassalShapeForModel [ + + self showInDiagram. + self + assert: (diagramController roassalShapeForModel: self model) + equals: controller roassalShape +] + +{ #category : 'tests - construction' } +OPAbstractElementControllerTest >> testRoassalShapeWasRendered [ + + self showInDiagram. + self assert: + (diagramController canvas nodes includes: controller roassalShape) +] + { #category : 'tests - construction' } OPAbstractElementControllerTest >> testShowInDiagram [ @@ -331,5 +469,5 @@ OPAbstractElementControllerTest >> testShowInDiagram [ controller roassalShape) equals: controller. self assert: (diagramController canvas shapes anySatisfy: [ :each | - each model isNotNil and: [ each model modelElement = model ] ]) + each model isNotNil and: [ each model modelElement = self model ] ]) ] diff --git a/repository/OpenPonk-Core/OPAbstractNodeTest.class.st b/repository/OpenPonk-Core/OPAbstractNodeTest.class.st index 0cbf1a5c..c666f5b6 100644 --- a/repository/OpenPonk-Core/OPAbstractNodeTest.class.st +++ b/repository/OpenPonk-Core/OPAbstractNodeTest.class.st @@ -10,7 +10,7 @@ Class { OPAbstractNodeTest >> testDoesNotMoveOnShapeCreation [ | diagram originalRoassalPosition movedRoassalPosition newShape | - diagram := OPDiagram new. + diagram := OPOpenPonkDiagram new. diagram renderIn: canvas. shape owningElement: diagram. shape modelElement: model. diff --git a/repository/OpenPonk-Core/OPAllFiguresDeselected.class.st b/repository/OpenPonk-Core/OPAllShapesDeselected.class.st similarity index 76% rename from repository/OpenPonk-Core/OPAllFiguresDeselected.class.st rename to repository/OpenPonk-Core/OPAllShapesDeselected.class.st index ea85fc45..b775a404 100644 --- a/repository/OpenPonk-Core/OPAllFiguresDeselected.class.st +++ b/repository/OpenPonk-Core/OPAllShapesDeselected.class.st @@ -1,7 +1,7 @@ -Class { - #name : 'OPAllFiguresDeselected', - #superclass : 'Announcement', - #category : 'OpenPonk-Core-Controllers', - #package : 'OpenPonk-Core', - #tag : 'Controllers' -} +Class { + #name : 'OPAllShapesDeselected', + #superclass : 'Announcement', + #category : 'OpenPonk-Core-Controllers', + #package : 'OpenPonk-Core', + #tag : 'Controllers' +} diff --git a/repository/OpenPonk-Core/OPBaseControllerTest.class.st b/repository/OpenPonk-Core/OPBaseControllerTest.class.st index 0799d635..4198e423 100644 --- a/repository/OpenPonk-Core/OPBaseControllerTest.class.st +++ b/repository/OpenPonk-Core/OPBaseControllerTest.class.st @@ -23,6 +23,18 @@ OPBaseControllerTest >> controllerClass [ ^ self subclassResponsibility ] +{ #category : 'accessing' } +OPBaseControllerTest >> controllersByModelsKey [ + + ^ self model +] + +{ #category : 'accessing' } +OPBaseControllerTest >> model [ + + ^ model +] + { #category : 'accessing' } OPBaseControllerTest >> modelClass [ ^ self subclassResponsibility diff --git a/repository/OpenPonk-Core/OPBoundaryControllerTest.class.st b/repository/OpenPonk-Core/OPBoundaryControllerTest.class.st index 325f6a52..683ac833 100644 --- a/repository/OpenPonk-Core/OPBoundaryControllerTest.class.st +++ b/repository/OpenPonk-Core/OPBoundaryControllerTest.class.st @@ -29,9 +29,3 @@ OPBoundaryControllerTest >> diagramModelClass [ ^ OPTestContainerModel ] - -{ #category : 'accessing' } -OPBoundaryControllerTest >> modelClass [ - - ^ self diagramElementClass -] diff --git a/repository/OpenPonk-Core/OPCommonElementController.class.st b/repository/OpenPonk-Core/OPCommonElementController.class.st index 7f45a6fe..658f098f 100644 --- a/repository/OpenPonk-Core/OPCommonElementController.class.st +++ b/repository/OpenPonk-Core/OPCommonElementController.class.st @@ -23,7 +23,7 @@ OPCommonElementController >> createModelIn: aParentModel [ "do nothing - common model elements are not part of any model" - ^ nil + ^ self model ] { #category : 'accessing' } @@ -45,6 +45,12 @@ OPCommonElementController >> isCommon [ ^ true ] +{ #category : 'testing' } +OPCommonElementController >> isDiagramOnly [ + + ^ true +] + { #category : 'testing' } OPCommonElementController >> isHideable [ @@ -59,8 +65,10 @@ OPCommonElementController >> model [ { #category : 'accessing' } OPCommonElementController >> model: aModel [ + "do nothing - common model elements do not have a model" - self diagramElement: aModel + self assert: + (aModel isNil or: [ aModel isKindOf: self diagramElementClass ]) ] { #category : 'accessing' } diff --git a/repository/OpenPonk-Core/OPController.class.st b/repository/OpenPonk-Core/OPController.class.st index 595564e3..5e3b1ee6 100644 --- a/repository/OpenPonk-Core/OPController.class.st +++ b/repository/OpenPonk-Core/OPController.class.st @@ -56,7 +56,7 @@ OPController >> canBeTargetFor: aController [ ^ false ] -{ #category : 'as yet unclassified' } +{ #category : 'accessing' } OPController >> commonModelClassPrefix [ ^ 'OP' ] @@ -128,7 +128,7 @@ OPController >> elementsToShowInside [ ^ #( ) ] -{ #category : 'as yet unclassified' } +{ #category : 'ui interaction' } OPController >> ensureDeselected [ self subclassResponsibility @@ -142,16 +142,6 @@ OPController >> ensureDiagramElement [ ^ self diagramElement ] -{ #category : 'figures' } -OPController >> figure [ - - self - deprecated: 'Use #roassalShape instead' - transformWith: '`@receiver figure' -> '`@receiver roassalShape'. - - ^ self roassalShape -] - { #category : 'canvas actions' } OPController >> hideSelectionFeedback [ @@ -328,17 +318,6 @@ OPController >> removeDiagramElement [ self diagramElement: nil ] -{ #category : 'destruction' } -OPController >> removeFigure [ - - self - deprecated: 'Use #removeDiagramElement instead' - transformWith: - '`@receiver removeFigure' -> '`@receiver removeDiagramElement'. - self ensureDeselected. - self figure remove -] - { #category : 'destruction' } OPController >> removeFromDiagramController [ @@ -350,15 +329,8 @@ OPController >> removeFromDiagramController [ { #category : 'destruction' } OPController >> removeModel [ - self diagramController elementRemoved -] - -{ #category : 'deprecated' } -OPController >> removeModelElement: aModelElement [ - "Remove self as target of aModelElement" - self deprecated: 'use #removeModel on the proper controller instead.'. - - (self diagramController controllerForModel: aModelElement) removeModel + self diagramController elementRemoved. + self model: nil ] { #category : 'destruction' } diff --git a/repository/OpenPonk-Core/OPControllerCache.class.st b/repository/OpenPonk-Core/OPControllerCache.class.st index b3f28197..87240920 100644 --- a/repository/OpenPonk-Core/OPControllerCache.class.st +++ b/repository/OpenPonk-Core/OPControllerCache.class.st @@ -23,7 +23,7 @@ OPControllerCache >> at: anObject [ ^ self at: anObject ifAbsent: [ diagramController controllers errorNotFound: - 'Controller of ' , anObject asString , ' not found' ] + 'Controller of ' , anObject asString ] ] { #category : 'accessing' } diff --git a/repository/OpenPonk-Core/OPDiagram.class.st b/repository/OpenPonk-Core/OPDiagram.class.st index 137aa0dc..17e83de2 100644 --- a/repository/OpenPonk-Core/OPDiagram.class.st +++ b/repository/OpenPonk-Core/OPDiagram.class.st @@ -94,6 +94,15 @@ OPDiagram >> ownedElement: aShape willRenderIn: aCanvas [ self canvas: aCanvas ] +{ #category : 'removing' } +OPDiagram >> removeRender [ + + self ownedElements do: [ :each | each removeRender ]. + roassalShape ifNil: [ ^ self ]. + self attachedShapesDo: [ :each | each remove ]. + roassalShape := nil +] + { #category : 'rendering' } OPDiagram >> renderBasicShape [ diff --git a/repository/OpenPonk-Core/OPDiagramController.class.st b/repository/OpenPonk-Core/OPDiagramController.class.st index a3ef494a..6081a065 100644 --- a/repository/OpenPonk-Core/OPDiagramController.class.st +++ b/repository/OpenPonk-Core/OPDiagramController.class.st @@ -8,18 +8,17 @@ Class { 'announcer', 'controllers', 'editor', - 'figureAdded', 'plugin', 'autosaveManager', - 'figureToControllerCache', 'modelToControllerCache', 'workbenchAnnouncer', 'layouter', - 'figuresBeingAdded', 'controllerFactory', - 'lastClickPosition', 'lastSelectionPosition', - 'canvasPresenter' + 'canvasPresenter', + 'roassalShapeToControllerCache', + 'roassalShapeAdded', + 'roassalShapesBeingAdded' ], #category : 'OpenPonk-Core-Controllers', #package : 'OpenPonk-Core', @@ -42,58 +41,38 @@ OPDiagramController >> addController: aController [ self controllers add: aController ] -{ #category : 'deprecated' } -OPDiagramController >> addModelElement: aModelElement [ - | controller figure | - self deprecated: 'Use createModelIn:andShowInDiagram: instead.'. -" self controllers detect: [ :ctrl | ctrl model = aModelElement ] ifFound: [ ^ self ]. - (self model has: aModelElement) - ifFalse: [ self model add: aModelElement ]. - controller := self createController: aModelElement. - controller diagramController: self. - self controllers add: controller. - (controller isKindOf: OPRelationshipController) - ifTrue: [ - | fromModel toModel fromCtrl toCtrl | - fromModel := aModelElement source. - toModel := aModelElement target. - fromCtrl := self controllers detect: [ :ctrl | ctrl model = fromModel ] ifNone: [ self addModelElement: fromModel ]. - toCtrl := self controllers detect: [ :ctrl | ctrl model = toModel ] ifNone: [ self addModelElement: toModel ]. - controller - source: fromCtrl; - target: toCtrl ]. - controller registerModelEvents: controller model. - figure := controller figure. - figure view ifNil: [ figure renderIn: self view ]. - self diagramController figureAdded: figure. - ^ controller" -] - -{ #category : 'accessing' } -OPDiagramController >> addMouseEventsFor: aFigure [ - - aFigure +{ #category : 'accessing' } +OPDiagramController >> addMouseEventsFor: aRoassalShape [ + + aRoassalShape when: RSMouseRightClick - do: [ :event | self figureContextClicked: event ] + do: [ :event | self roassalShapeContextClicked: event ] for: self. - aFigure + aRoassalShape when: RSMouseEnter do: [ :event | self hoverRoassalShape: event shape ] for: self ] -{ #category : 'rendering' } -OPDiagramController >> allShowableElements [ +{ #category : 'enumerating' } +OPDiagramController >> allModelElementsWithController [ + "Should return all elements that could be directly hidden on diagram but are currently shown" + + ^ self controllers collect: [ :each | each model ] +] + +{ #category : 'enumerating' } +OPDiagramController >> allModelElementsWithPossibleController [ "all elements that could be directly hidden on diagram" ^ (Set with: self model) , self elementsToShowInside ] -{ #category : 'as yet unclassified' } -OPDiagramController >> allVisibleShowableElements [ - "Should return all elements that could be directly hidden on diagram but are currently shown" +{ #category : 'enumerating' } +OPDiagramController >> allModelElementsWithPossibleDiagramElement [ + "all model elements that can have diagram elements (even if cannot have controller)" - ^ self controllers collect: [ :each | each model ] + ^ self allModelElementsWithPossibleController ] { #category : 'accessing' } @@ -143,15 +122,15 @@ OPDiagramController >> cachedControllerForModel: aModel ifNone: aNoneBlock [ ] { #category : 'controllers management' } -OPDiagramController >> cachedControllerForRoassalShape: aFigure [ +OPDiagramController >> cachedControllerForRoassalShape: aRoassalShape [ - ^ figureToControllerCache at: aFigure + ^ roassalShapeToControllerCache at: aRoassalShape ] { #category : 'controllers management' } -OPDiagramController >> cachedControllerForRoassalShape: aFigure ifNone: aBlock [ +OPDiagramController >> cachedControllerForRoassalShape: aRoassalShape ifNone: aBlock [ - ^ figureToControllerCache at: aFigure ifAbsent: aBlock + ^ roassalShapeToControllerCache at: aRoassalShape ifAbsent: aBlock ] { #category : 'connecting' } @@ -270,7 +249,7 @@ OPDiagramController >> createController: aModel [ { #category : 'protocol-canvas' } OPDiagramController >> deselectAll [ - self announcer announce: OPAllFiguresDeselected new + self announcer announce: OPAllShapesDeselected new ] { #category : 'accessing' } @@ -305,7 +284,8 @@ OPDiagramController >> diagramController: aController [ { #category : 'rebuilding' } OPDiagramController >> diagramFocused [ - self isRendered ifTrue: [ ^ self updateAfterDiagramFocused ]. + self updateAfterDiagramFocused. + self isRendered ifTrue: [ ^ self ]. self diagramElement canvas: self canvas. self diagramElement ownedElements do: [ :each | @@ -329,7 +309,7 @@ OPDiagramController >> editor: anEditor [ editor := anEditor ] -{ #category : 'as yet unclassified' } +{ #category : 'destruction' } OPDiagramController >> elementRemoved [ self editor ifNotNil: [ :foundEditor | @@ -353,7 +333,7 @@ OPDiagramController >> ensureControllerFor: aModel [ ^ controller ] -{ #category : 'as yet unclassified' } +{ #category : 'ui interaction' } OPDiagramController >> ensureDeselected [ self deselectAll @@ -363,27 +343,13 @@ OPDiagramController >> ensureDeselected [ OPDiagramController >> figureAdded: aFigure [ self - deprecated: 'Use addedFigureFor: instead' + deprecated: 'Use rendered: instead' transformWith: '`@receiver figureAdded: `@statements1' -> - '`@receiver addedFigureFor: (`@receiver controllerForFigure: `@statements1)'. + '`@receiver rendered: (`@receiver controllerForRoassalShape: `@statements1)'. ^ self rendered: (self controllerForRoassalShape: aFigure) ] -{ #category : 'accessing' } -OPDiagramController >> figureContextClicked: anEvent [ - - | shapes menu | - shapes := (self selectedElements includes: anEvent shape) - ifTrue: [ self selectedElements ] - ifFalse: [ { anEvent shape } ]. - menu := CmdContextMenuActivation - buildContextMenuFor: self canvasPresenter - inContext: - (OPDiagramFigureContext for: self canvasPresenter of: shapes). - menu popUpInWorld -] - { #category : 'ui interaction' } OPDiagramController >> form [ @@ -391,18 +357,18 @@ OPDiagramController >> form [ ] { #category : 'controllers management' } -OPDiagramController >> hasControllerForFigure: aFigure [ +OPDiagramController >> hasControllerForModel: aModel [ - ^ aFigure = self canvas or: [ - self cachedControllerForRoassalShape: aFigure ifNone: [ ^ false ]. + ^ aModel = self model or: [ + self cachedControllerForModel: aModel ifNone: [ ^ false ]. true ] ] { #category : 'controllers management' } -OPDiagramController >> hasControllerForModel: aModel [ +OPDiagramController >> hasControllerForRoassalShape: aRoassalShape [ - ^ aModel = self model or: [ - self cachedControllerForModel: aModel ifNone: [ ^ false ]. + ^ aRoassalShape = self canvas or: [ + self cachedControllerForRoassalShape: aRoassalShape ifNone: [ ^ false ]. true ] ] @@ -443,9 +409,9 @@ OPDiagramController >> hoverController: aController [ ] { #category : 'protocol-canvas' } -OPDiagramController >> hoverRoassalShape: aFigure [ +OPDiagramController >> hoverRoassalShape: aRoassalShape [ - self hoverController: (self controllerForRoassalShape: aFigure) + self hoverController: (self controllerForRoassalShape: aRoassalShape) ] { #category : 'ui interaction' } @@ -459,12 +425,12 @@ OPDiagramController >> incompatiblePaletteItemNames [ OPDiagramController >> initialize [ super initialize. - figureAdded := [ :figure | ]. + roassalShapeAdded := [ :roassalShape | ]. controllerFactory := self controllerFactory. diagramController := self. - figuresBeingAdded := Set new. + roassalShapesBeingAdded := Set new. modelToControllerCache := OPModelToControllerCache for: self. - figureToControllerCache := OPRoassalShapeToControllerCache for: self + roassalShapeToControllerCache := OPRoassalShapeToControllerCache for: self ] { #category : 'ui interaction' } @@ -508,7 +474,18 @@ OPDiagramController >> modelClass [ { #category : 'accessing' } OPDiagramController >> modelForFigure: aFigure [ - ^ (self controllerForRoassalShape: aFigure) model + self + deprecated: 'use #modelForRoassalShape: instead' + transformWith: + '`@receiver modelForFigure: `@argument' + -> '`@receiver modelForRoassalShape: `@argument'. + + ^ self modelForRoassalShape: aFigure +] + +{ #category : 'accessing' } +OPDiagramController >> modelForRoassalShape: aRoassalShape [ + ^ (self controllerForRoassalShape: aRoassalShape) model ] { #category : 'accessing' } @@ -525,7 +502,7 @@ OPDiagramController >> modelsWithController [ ^ self controllers collect: #model ] -{ #category : 'as yet unclassified' } +{ #category : 'accessing' } OPDiagramController >> nameOfTypeForModel: aModel [ self deprecated: 'use #name on typeOfModel: instead' @@ -601,7 +578,7 @@ OPDiagramController >> removeControllerOf: aModelElement [ ] { #category : 'destruction' } -OPDiagramController >> removeFromCanvas: aFigure [ +OPDiagramController >> removeFromCanvas: aRoassalShape [ self deprecated: 'use removeModelOfRoassalShape: instead' @@ -636,19 +613,21 @@ OPDiagramController >> removeModelElement: aModelElement [ ] { #category : 'destruction' } -OPDiagramController >> removeModelOfRoassalShape: aFigure [ - aFigure ifNil: [ ^ self ]. - (self controllerForRoassalShape: aFigure) removeControllerAndModel +OPDiagramController >> removeModelOfRoassalShape: aRoassalShape [ + + aRoassalShape ifNil: [ ^ self ]. + (self controllerForRoassalShape: aRoassalShape) + removeControllerAndModel ] { #category : 'accessing' } OPDiagramController >> rendered: aController [ - (figuresBeingAdded includes: aController) + (roassalShapesBeingAdded includes: aController) ifFalse: [ self traceCr: 'DiagramController>>#addedFigureFor: added figure not previously marked as being added' ] - ifTrue: [ figuresBeingAdded remove: aController ]. + ifTrue: [ roassalShapesBeingAdded remove: aController ]. lastSelectionPosition ifNotNil: [ @@ -658,17 +637,24 @@ OPDiagramController >> rendered: aController [ self addMouseEventsFor: aController roassalShape ] -{ #category : 'testing' } -OPDiagramController >> requiresControllerToShowDiagramElement: aDiagramElement [ +{ #category : 'accessing' } +OPDiagramController >> roassalShape [ - ^ aDiagramElement ownModelElement isNotNil and: [ - (aDiagramElement isKindOf: OPEdgeLabel) not ] + ^ self canvas ] { #category : 'accessing' } -OPDiagramController >> roassalShape [ +OPDiagramController >> roassalShapeContextClicked: anEvent [ - ^ self canvas + | shapes menu | + shapes := (self selectedElements includes: anEvent shape) + ifTrue: [ self selectedElements ] + ifFalse: [ { anEvent shape } ]. + menu := CmdContextMenuActivation + buildContextMenuFor: self canvasPresenter + inContext: + (OPRoassalShapeContext for: self canvasPresenter of: shapes). + menu popUpInWorld ] { #category : 'accessing' } @@ -711,7 +697,7 @@ OPDiagramController >> selectedShapes: shapes onPosition: aPoint [ OPDiagramController >> showAllElements [ self disableRefresh. - self allShowableElements do: [ :each | + self allModelElementsWithPossibleController do: [ :each | self showWithoutDependentInDiagramModel: each ]. self enableRefresh ] @@ -719,23 +705,22 @@ OPDiagramController >> showAllElements [ { #category : 'rebuilding' } OPDiagramController >> showDiagramElement: aDiagramElement [ - (self requiresControllerToShowDiagramElement: aDiagramElement) - ifTrue: [ - | controller | - controller := self - controllerForModel: aDiagramElement ownModelElement - ifFound: [ :ctrl | - ctrl isRendered ifTrue: [ - aDiagramElement isRendered ifTrue: [ ^ ctrl ]. - ^ self error: - 'Controller is already rendered by a different diagram element' ]. - ctrl ] - ifNone: [ - self newControllerFor: - aDiagramElement ownModelElement ]. - controller - diagramElement: aDiagramElement; - showWithoutDependentInDiagram: self ]. + aDiagramElement shouldHaveController ifTrue: [ + | controller | + controller := self + controllerForModel: aDiagramElement ownModelElement + ifFound: [ :ctrl | + ctrl isRendered ifTrue: [ + aDiagramElement isRendered ifTrue: [ ^ ctrl ]. + ^ self error: + 'Controller is already rendered by a different diagram element' ]. + ctrl ] + ifNone: [ + self newControllerFor: + aDiagramElement ownModelElement ]. + controller + diagramElement: aDiagramElement; + showWithoutDependentInDiagram: self ]. aDiagramElement ownedElements do: [ :each | self showDiagramElement: each ] ] @@ -766,7 +751,7 @@ OPDiagramController >> showWithoutDependentInDiagramModel: aModel [ yourself ] -{ #category : 'as yet unclassified' } +{ #category : 'accessing' } OPDiagramController >> typeOfModel: aModel [ ^ OPModelObjectType named: @@ -783,12 +768,21 @@ OPDiagramController >> undo [ { #category : 'event handling' } OPDiagramController >> updateAfterDiagramFocused [ - | showableElements | - showableElements := self allShowableElements asIdentitySet. - self controllers do: [ :each | - (showableElements includes: each model) - ifTrue: [ each updateAfterDiagramFocused ] - ifFalse: [ each removeControllerAndDiagramElement ] ] + | modelElementsToKeep | + modelElementsToKeep := self + allModelElementsWithPossibleDiagramElement + asIdentitySet. + self controllers + reject: [ :each | each isDiagramOnly ] + thenDo: [ :each | + (modelElementsToKeep includes: each model) + ifTrue: [ each updateAfterDiagramFocused ] + ifFalse: [ each removeControllerAndDiagramElement ] ]. + self diagramElement allOwnedElements asIdentitySet + reject: [ :each | + each isDiagramOnly or: [ + modelElementsToKeep includes: each modelElement ] ] + thenDo: [ :each | each remove ] ] { #category : 'userinterface' } @@ -825,7 +819,7 @@ OPDiagramController >> view [ { #category : 'accessing' } OPDiagramController >> visibleElements [ - ^ self allShowableElements + ^ self allModelElementsWithPossibleController select: [ :el | self isVisibleInDiagram: el ] ] @@ -837,7 +831,7 @@ OPDiagramController >> visibleElements: aCollection [ executor hideAll. executor showElements: - (self allShowableElements + (self allModelElementsWithPossibleController select: [ :each | aCollection anySatisfy: [ :any | any = each ] ]) ] @@ -850,20 +844,20 @@ OPDiagramController >> when: anEvent do: aBlock for: aSubscriber [ { #category : 'protocol-events' } OPDiagramController >> whenAllDeselectedDo: aBlock for: aSubscriber [ - self when: OPAllFiguresDeselected do: aBlock for: aSubscriber + self when: OPAllShapesDeselected do: aBlock for: aSubscriber ] { #category : 'protocol-events' } OPDiagramController >> whenFigureAdded: aBlock [ - figureAdded := aBlock ifNil: [ [ :figure | ] ] + roassalShapeAdded := aBlock ifNil: [ [ :figure | ] ] ] { #category : 'accessing' } OPDiagramController >> willRender: aController [ - (figuresBeingAdded includes: aController) ifTrue: [ + (roassalShapesBeingAdded includes: aController) ifTrue: [ self notify: 'Same controller is already being added' ]. - figuresBeingAdded add: aController + roassalShapesBeingAdded add: aController ] { #category : 'accessing' } diff --git a/repository/OpenPonk-Core/OPDiagramElement.class.st b/repository/OpenPonk-Core/OPDiagramElement.class.st index ac373398..4bcd196e 100644 --- a/repository/OpenPonk-Core/OPDiagramElement.class.st +++ b/repository/OpenPonk-Core/OPDiagramElement.class.st @@ -182,6 +182,12 @@ OPDiagramElement >> attachedShapesDo: aBlock [ thenDo: aBlock ] +{ #category : 'accessing' } +OPDiagramElement >> canHaveController [ + + ^ true +] + { #category : 'accessing' } OPDiagramElement >> canvas [ @@ -264,6 +270,12 @@ OPDiagramElement >> initialize [ oppositeSlot: #target ] +{ #category : 'testing' } +OPDiagramElement >> isDiagramOnly [ + + ^ false +] + { #category : 'testing' } OPDiagramElement >> isPositionableByUser [ @@ -358,6 +370,13 @@ OPDiagramElement >> movesWithOtherShape [ ^ false ] +{ #category : 'accessing' } +OPDiagramElement >> orOwningElementWithPossibleController [ + + self canHaveController ifTrue: [ ^ self ]. + ^ owningElement orOwningElementWithPossibleController +] + { #category : 'accessing' } OPDiagramElement >> ownModelElement [ @@ -417,6 +436,12 @@ OPDiagramElement >> owningElement: aDiagramElement [ to: aDiagramElement ] +{ #category : 'accessing' } +OPDiagramElement >> owningElementWithPossibleController [ + + ^ self owningElement orOwningElementWithPossibleController +] + { #category : 'actions' } OPDiagramElement >> pushBack [ @@ -459,8 +484,8 @@ OPDiagramElement >> removeLocalStylePropertyNamed: aName [ OPDiagramElement >> removeRender [ self ownedElements do: [ :each | each removeRender ]. - self attachedShapesDo: [ :each | each remove ]. roassalShape ifNil: [ ^ self ]. + self attachedShapesDo: [ :each | each remove ]. roassalShape remove. roassalShape := nil ] @@ -594,6 +619,12 @@ OPDiagramElement >> shouldBeSelectable [ self selectableInteraction class ~= OPRSNoInteraction ] ] +{ #category : 'accessing' } +OPDiagramElement >> shouldHaveController [ + + ^ self canHaveController and: [ self ownModelElement isNotNil ] +] + { #category : 'accessing' } OPDiagramElement >> sourceEdges [ ^ sourceEdges diff --git a/repository/OpenPonk-Core/OPDiagramInvalid.class.st b/repository/OpenPonk-Core/OPDiagramInvalid.class.st index 1a86d554..844eaa47 100644 --- a/repository/OpenPonk-Core/OPDiagramInvalid.class.st +++ b/repository/OpenPonk-Core/OPDiagramInvalid.class.st @@ -1,6 +1,6 @@ Class { #name : 'OPDiagramInvalid', - #superclass : 'Warning', + #superclass : 'OPInvalidWarning', #category : 'OpenPonk-Core-Controllers', #package : 'OpenPonk-Core', #tag : 'Controllers' diff --git a/repository/OpenPonk-Core/OPDiagramOnlyControllerTest.class.st b/repository/OpenPonk-Core/OPDiagramOnlyControllerTest.class.st index 9f206201..510dcd5e 100644 --- a/repository/OpenPonk-Core/OPDiagramOnlyControllerTest.class.st +++ b/repository/OpenPonk-Core/OPDiagramOnlyControllerTest.class.st @@ -15,7 +15,43 @@ OPDiagramOnlyControllerTest class >> isAbstract [ { #category : 'accessing' } OPDiagramOnlyControllerTest >> allElements [ - ^ super allElements asSet copyWith: model + ^ super allElements copyWith: self model +] + +{ #category : 'accessing' } +OPDiagramOnlyControllerTest >> controllersByModelsKey [ + + ^ self diagramElementClass new +] + +{ #category : 'accessing' } +OPDiagramOnlyControllerTest >> model [ + + ^ controller ifNotNil: [ :ctrl | ctrl diagramElement ] +] + +{ #category : 'accessing' } +OPDiagramOnlyControllerTest >> modelClass [ + + ^ self diagramElementClass +] + +{ #category : 'instance creation' } +OPDiagramOnlyControllerTest >> newModel [ + + ^ nil +] + +{ #category : 'tests - ui interaction' } +OPDiagramOnlyControllerTest >> testBeingRemovedAfterModelRemovalWhenNotRendered [ + + self skip +] + +{ #category : 'tests - ui interaction' } +OPDiagramOnlyControllerTest >> testBeingRemovedAfterModelRemovalWhenRendered [ + + self skip ] { #category : 'tests - construction' } diff --git a/repository/OpenPonk-Core/OPDiagramOnlyShape.class.st b/repository/OpenPonk-Core/OPDiagramOnlyShape.class.st index 6aa31d1d..8016ed02 100644 --- a/repository/OpenPonk-Core/OPDiagramOnlyShape.class.st +++ b/repository/OpenPonk-Core/OPDiagramOnlyShape.class.st @@ -1,6 +1,8 @@ Class { #name : 'OPDiagramOnlyShape', #superclass : 'OPBoundNode', + #traits : 'TComparable', + #classTraits : 'TComparable classTrait', #instVars : [ 'uuid', 'announcer' @@ -39,12 +41,34 @@ OPDiagramOnlyShape class >> stonAllInstVarNames [ ^ super stonAllInstVarNames , #( #uuid ) ] +{ #category : 'comparing' } +OPDiagramOnlyShape >> < aComparable [ + "Answer whether the receiver is less than the argument." + + ^ aComparable class = self class and: [ self uuid < aComparable uuid ] +] + +{ #category : 'comparing' } +OPDiagramOnlyShape >> = aComparable [ + "Compare the receiver with the argument and answer with true if the + receiver is equal to the argument. Otherwise answer false." + + ^ aComparable class = self class and: [ self uuid = aComparable uuid ] +] + { #category : 'accessing' } OPDiagramOnlyShape >> announcer [ ^ announcer ifNil: [ announcer := Announcer new ] ] +{ #category : 'comparing' } +OPDiagramOnlyShape >> hash [ + "Hash must be redefined whenever = is redefined." + + ^ self uuid hash +] + { #category : 'initialization' } OPDiagramOnlyShape >> initialize [ @@ -52,6 +76,12 @@ OPDiagramOnlyShape >> initialize [ uuid := UUID new ] +{ #category : 'testing' } +OPDiagramOnlyShape >> isDiagramOnly [ + + ^ true +] + { #category : 'accessing' } OPDiagramOnlyShape >> modelElements [ diff --git a/repository/OpenPonk-Core/OPDirectionalRelationshipController.class.st b/repository/OpenPonk-Core/OPDirectionalRelationshipController.class.st index 93925ef8..2dd8812a 100644 --- a/repository/OpenPonk-Core/OPDirectionalRelationshipController.class.st +++ b/repository/OpenPonk-Core/OPDirectionalRelationshipController.class.st @@ -27,12 +27,6 @@ OPDirectionalRelationshipController >> createDiagramElement [ yourself ] -{ #category : 'hooks' } -OPDirectionalRelationshipController >> createLineFrom: fromElement to: toElement [ - - self deprecated: 'This is responsibility of DI shapes now'. -] - { #category : 'construction' } OPDirectionalRelationshipController >> dependingOnElements [ @@ -47,13 +41,6 @@ OPDirectionalRelationshipController >> dependingOnElements [ self error: 'There is no target of ' , self model asString ])) ] -{ #category : 'hooks' } -OPDirectionalRelationshipController >> edgeBuilder [ - - self deprecated: - 'Depracated without replacement - use Roassal directly or define own figures' -] - { #category : 'construction' } OPDirectionalRelationshipController >> ensureShownDependenciesInDiagram: aDiagramController [ diff --git a/repository/OpenPonk-Core/OPElementController.class.st b/repository/OpenPonk-Core/OPElementController.class.st index 41d9ff98..b0635625 100644 --- a/repository/OpenPonk-Core/OPElementController.class.st +++ b/repository/OpenPonk-Core/OPElementController.class.st @@ -10,37 +10,6 @@ Class { #tag : 'Controllers' } -{ #category : 'deprecated' } -OPElementController >> attach [ - self deprecated: 'Use createInModel:andShowInDiagram: instead.'. -" self registerModelEvents: model. - self attachFigure" -] - -{ #category : 'deprecated' } -OPElementController >> attachFigure [ - "add figure to the view" - - self deprecated: 'Use createInModel:andShowInDiagram: instead.' - " - | newFigure | - newFigure := self figure. - newFigure view ifNil: [ newFigure renderIn: self diagramController view ]. - self diagramController figureAdded: newFigure. - self refreshFigure" -] - -{ #category : 'deprecated' } -OPElementController >> attachTo: aDiagramController [ - self deprecated: 'Use createInModel:andShowInDiagram: instead.'. - "self diagramController: aDiagramController. - aDiagramController controllers add: self. - - self loadModel. - self registerModelEvents: model. - self attachFigure" -] - { #category : 'construction' } OPElementController >> createDiagramElement [ @@ -49,18 +18,6 @@ OPElementController >> createDiagramElement [ forModelElement: self model) ] -{ #category : 'deprecated' } -OPElementController >> createFigure [ - - self deprecated: 'Use renderFigureIn: instead.' -] - -{ #category : 'deprecated' } -OPElementController >> createModel [ - self deprecated: 'Use createModelIn: instead.' -" ^ self model ifNil: [ self modelClass new ]" -] - { #category : 'construction' } OPElementController >> createModelIn: aParentModel [ @@ -89,6 +46,12 @@ OPElementController >> diagramElementClass [ ^ self subclassResponsibility ] +{ #category : 'diagram elements' } +OPElementController >> diagramElementOwnerWithPossibleController [ + + ^ self diagramElement owningElementWithPossibleController +] + { #category : 'as yet unclassified' } OPElementController >> ensureDeselected [ @@ -153,6 +116,12 @@ OPElementController >> isCommon [ ^ false ] +{ #category : 'testing' } +OPElementController >> isDiagramOnly [ + + ^ false +] + { #category : 'testing' } OPElementController >> isHideable [ diff --git a/repository/OpenPonk-Core/OPInvalidWarning.class.st b/repository/OpenPonk-Core/OPInvalidWarning.class.st new file mode 100644 index 00000000..2227ca17 --- /dev/null +++ b/repository/OpenPonk-Core/OPInvalidWarning.class.st @@ -0,0 +1,7 @@ +Class { + #name : 'OPInvalidWarning', + #superclass : 'Warning', + #category : 'OpenPonk-Core-Controllers', + #package : 'OpenPonk-Core', + #tag : 'Controllers' +} diff --git a/repository/OpenPonk-Core/OPLabel.class.st b/repository/OpenPonk-Core/OPLabel.class.st index aff37523..b837e6f3 100644 --- a/repository/OpenPonk-Core/OPLabel.class.st +++ b/repository/OpenPonk-Core/OPLabel.class.st @@ -17,6 +17,12 @@ OPLabel class >> stonAllInstVarNames [ ^ super stonAllInstVarNames , #( #text ) ] +{ #category : 'accessing' } +OPLabel >> canHaveController [ + + ^ false +] + { #category : 'accessing' } OPLabel >> defaultFontColor [ diff --git a/repository/OpenPonk-Core/OPModelInvalid.class.st b/repository/OpenPonk-Core/OPModelInvalid.class.st index b1f8c955..86ed65ff 100644 --- a/repository/OpenPonk-Core/OPModelInvalid.class.st +++ b/repository/OpenPonk-Core/OPModelInvalid.class.st @@ -1,6 +1,6 @@ Class { #name : 'OPModelInvalid', - #superclass : 'Warning', + #superclass : 'OPInvalidWarning', #category : 'OpenPonk-Core-Controllers', #package : 'OpenPonk-Core', #tag : 'Controllers' diff --git a/repository/OpenPonk-Core/OPNoShape.class.st b/repository/OpenPonk-Core/OPNoShape.class.st index 223d3d8e..1be8cc0e 100644 --- a/repository/OpenPonk-Core/OPNoShape.class.st +++ b/repository/OpenPonk-Core/OPNoShape.class.st @@ -76,6 +76,12 @@ OPNoShape >> modelElement [ ^ nil ] +{ #category : 'accessing' } +OPNoShape >> orOwningElementWithPossibleController [ + + ^ self +] + { #category : 'initialization' } OPNoShape >> ownedElement: anOPPetriNetPTPlaceShape renderedIn: aRSCanvas [ "do nothing" @@ -96,6 +102,12 @@ OPNoShape >> ownedElements [ ^ OrderedCollection empty ] +{ #category : 'accessing' } +OPNoShape >> owningElementWithPossibleController [ + + ^ self +] + { #category : 'introspection' } OPNoShape >> readSlotNamed: aName [ diff --git a/repository/OpenPonk-Core/OPNote.class.st b/repository/OpenPonk-Core/OPNote.class.st index 11caf1b9..a27dc3b2 100644 --- a/repository/OpenPonk-Core/OPNote.class.st +++ b/repository/OpenPonk-Core/OPNote.class.st @@ -49,7 +49,7 @@ OPNote >> attachedElementShapes [ { #category : 'accessing' } OPNote >> attachedShapes [ - ^ super attachedShapes , self attachedElementShapes , lines + ^ super attachedShapes , self attachedElementShapes , self lines ] { #category : 'creating - subelements' } @@ -149,6 +149,12 @@ OPNote >> initialize [ to: self ] +{ #category : 'accessing' } +OPNote >> lines [ + + ^ lines ifNil: [ OrderedCollection new ] +] + { #category : 'printing' } OPNote >> printOn: aStream [ @@ -181,7 +187,7 @@ OPNote >> removeRender [ leftFillBox := nil. bottomFillBox := nil. triangle := nil. - lines removeAll. + self lines removeAll ] { #category : 'rendering' } diff --git a/repository/OpenPonk-Core/OPNoteControllerTest.class.st b/repository/OpenPonk-Core/OPNoteControllerTest.class.st index 7554d997..5a35581a 100644 --- a/repository/OpenPonk-Core/OPNoteControllerTest.class.st +++ b/repository/OpenPonk-Core/OPNoteControllerTest.class.st @@ -29,9 +29,3 @@ OPNoteControllerTest >> diagramModelClass [ ^ OPTestContainerModel ] - -{ #category : 'accessing' } -OPNoteControllerTest >> modelClass [ - - ^ self diagramElementClass -] diff --git a/repository/OpenPonk-Core/OPOpenPonkDiagram.class.st b/repository/OpenPonk-Core/OPOpenPonkDiagram.class.st index 49175d10..dbf44d56 100644 --- a/repository/OpenPonk-Core/OPOpenPonkDiagram.class.st +++ b/repository/OpenPonk-Core/OPOpenPonkDiagram.class.st @@ -60,13 +60,6 @@ OPOpenPonkDiagram >> newCopy [ serializer materializeDiagramOf: self modelElement from: s ] ] -{ #category : 'removing' } -OPOpenPonkDiagram >> removeRender [ - - self ownedElements do: #removeRender. - roassalShape := nil -] - { #category : 'as yet unclassified' } OPOpenPonkDiagram >> updateFromRender [ diff --git a/repository/OpenPonk-Core/OPProjectController.class.st b/repository/OpenPonk-Core/OPProjectController.class.st index a6dd7af1..e6051aa1 100644 --- a/repository/OpenPonk-Core/OPProjectController.class.st +++ b/repository/OpenPonk-Core/OPProjectController.class.st @@ -387,7 +387,7 @@ OPProjectController >> selectInDiagram: aModelElement [ palette selectSelectionTool selectedTool selectedTargetControllers: { ctrl }. dctrl editor canvasPresenter roassalView canvas camera - translateTo: ctrl figure position. + translateTo: ctrl roassalShape position. ^ self ] ] ] ] @@ -401,12 +401,12 @@ OPProjectController >> spApplication [ OPProjectController >> updateDiagram: aDiagram [ | focusedController | - controllers do: [ :each | each validate ]. focusedController := workbench focusedEditor ifNotNil: [ :editor | editor diagramController ]. controllers detect: [ :ctrl | ctrl diagramElement = aDiagram ] ifFound: [ :ctrl | + ctrl validate. aDiagram isOpen: true. aDiagram isRendered ifTrue: [ aDiagram updateFromRender ]. aDiagram isSelected: ctrl = focusedController ] diff --git a/repository/OpenPonk-Core/OPTestAbstractModel.class.st b/repository/OpenPonk-Core/OPTestAbstractModel.class.st index 4dcff3f3..a210a010 100644 --- a/repository/OpenPonk-Core/OPTestAbstractModel.class.st +++ b/repository/OpenPonk-Core/OPTestAbstractModel.class.st @@ -18,7 +18,7 @@ OPTestAbstractModel >> = other [ { #category : 'accessing' } OPTestAbstractModel >> name [ - ^ 'container' + ^ 'model' ] { #category : 'subscription' } @@ -30,9 +30,7 @@ OPTestAbstractModel >> unsubscribe: anOPTestDiagramController [ { #category : 'accessing' } OPTestAbstractModel >> uuid [ - ^ uuid ifNil: [ - uuid := '6875c7ff-b858-0d00-9c00-4775' - , self hash printStringHex asLowercase ] + ^ uuid ifNil: [ uuid := UUID new ] ] { #category : 'accessing' } @@ -42,6 +40,12 @@ OPTestAbstractModel >> uuid: aStringOrUUID [ ifFalse: [ aStringOrUUID ] ] +{ #category : 'accessing' } +OPTestAbstractModel >> when: anAnnouncement do: aBlock for: aSubscriber [ + + ^ self announcer when: anAnnouncement do: aBlock for: aSubscriber +] + { #category : 'announcer' } OPTestAbstractModel >> when: anAnnouncementClass send: aSelector to: aReceiver [ diff --git a/repository/OpenPonk-Core/OPTestContainerModel.class.st b/repository/OpenPonk-Core/OPTestContainerModel.class.st index ca305f65..1b2ab767 100644 --- a/repository/OpenPonk-Core/OPTestContainerModel.class.st +++ b/repository/OpenPonk-Core/OPTestContainerModel.class.st @@ -3,11 +3,9 @@ I am a mock representing a tree inner node entity. " Class { #name : 'OPTestContainerModel', - #superclass : 'Model', + #superclass : 'OPTestAbstractModel', #instVars : [ - 'entities', - 'uuid', - 'name' + 'entities' ], #category : 'OpenPonk-Core-Controllers-Tests', #package : 'OpenPonk-Core', @@ -41,34 +39,3 @@ OPTestContainerModel >> initialize [ OPTestContainerModel >> name [ ^ 'container' ] - -{ #category : 'subscription' } -OPTestContainerModel >> unsubscribe: anOPTestDiagramController [ - - self announcer unsubscribe: anOPTestDiagramController -] - -{ #category : 'accessing' } -OPTestContainerModel >> uuid [ - ^ uuid ifNil: [ uuid := UUID new ] -] - -{ #category : 'accessing' } -OPTestContainerModel >> uuid: anObject [ - uuid := anObject -] - -{ #category : 'accessing' } -OPTestContainerModel >> when: anAnnouncement do: aBlock for: aSubscriber [ - - ^ self announcer when: anAnnouncement do: aBlock for: aSubscriber -] - -{ #category : 'accessing' } -OPTestContainerModel >> when: anAnnouncementClass send: aSelector to: aReceiver [ - - ^ self announcer - when: anAnnouncementClass - send: aSelector - to: aReceiver -] diff --git a/repository/OpenPonk-Core/OPTestEdge.class.st b/repository/OpenPonk-Core/OPTestEdge.class.st index 11868d06..09d57d5f 100644 --- a/repository/OpenPonk-Core/OPTestEdge.class.st +++ b/repository/OpenPonk-Core/OPTestEdge.class.st @@ -9,5 +9,8 @@ Class { { #category : 'rendering' } OPTestEdge >> renderBasicShape [ - ^ RSLine new + ^ RSPolyline new + from: self source roassalShape; + to: self target roassalShape; + yourself ] diff --git a/repository/OpenPonk-Spec/HandMorph.extension.st b/repository/OpenPonk-Spec/HandMorph.extension.st index 3740d419..146bc9e4 100644 --- a/repository/OpenPonk-Spec/HandMorph.extension.st +++ b/repository/OpenPonk-Spec/HandMorph.extension.st @@ -5,7 +5,7 @@ HandMorph >> sendKeyboardEvent: anEvent [ self flag: 'Part of ugly hack to find out if ctrl is currently pressed'. - OPDiagramRemoveFigureCommand lastEvent: anEvent. + OPRemoveModelOfRoassalShapeCommand lastEvent: anEvent. self flag: 'Original method below'. @@ -22,7 +22,7 @@ HandMorph >> sendMouseEvent: anEvent [ self flag: 'Part of ugly hack to find out if ctrl is currently pressed'. - OPDiagramRemoveFigureCommand lastEvent: anEvent. + OPRemoveModelOfRoassalShapeCommand lastEvent: anEvent. self flag: 'Original method below'. diff --git a/repository/OpenPonk-Spec/OPCanvasPresenter.class.st b/repository/OpenPonk-Spec/OPCanvasPresenter.class.st index 38d8718e..4f28048e 100644 --- a/repository/OpenPonk-Spec/OPCanvasPresenter.class.st +++ b/repository/OpenPonk-Spec/OPCanvasPresenter.class.st @@ -49,7 +49,7 @@ OPCanvasPresenter >> createCommandContext [ OPCanvasPresenter >> createCommandContextForSelection: selectedItems [ "simple context has no information about selected items" - ^ OPDiagramFigureContext for: self of: selectedItems + ^ OPRoassalShapeContext for: self of: selectedItems ] { #category : 'accessing' } diff --git a/repository/OpenPonk-Spec/OPCherryPickShowHidePresenter.class.st b/repository/OpenPonk-Spec/OPCherryPickShowHidePresenter.class.st index a838382f..cb80aa26 100644 --- a/repository/OpenPonk-Spec/OPCherryPickShowHidePresenter.class.st +++ b/repository/OpenPonk-Spec/OPCherryPickShowHidePresenter.class.st @@ -14,7 +14,7 @@ OPCherryPickShowHidePresenter >> childrenFor: aModelObject [ { #category : 'defaults' } OPCherryPickShowHidePresenter >> findSelectedItems [ - ^ diagramController allVisibleShowableElements + ^ diagramController allModelElementsWithController ifNotEmpty: [ :newElements | newElements copyWith: diagramController model ] ] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureBlackFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureBlackFontColorCommand.class.st index 990af629..5a86a219 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureBlackFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureBlackFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureBlackFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureBlackStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureBlackStrokeColorCommand.class.st index 6ac602f3..3cade7e6 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureBlackStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureBlackStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureBlackStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureBlueFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureBlueFillColorCommand.class.st index d890e555..8337106f 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureBlueFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureBlueFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureBlueFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureBlueFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureBlueFontColorCommand.class.st index e0740bd6..a91d6dd7 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureBlueFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureBlueFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureBlueFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureBlueStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureBlueStrokeColorCommand.class.st index 080cfe2b..6dfa4bc3 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureBlueStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureBlueStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureBlueStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureContext.class.st b/repository/OpenPonk-Spec/OPDiagramFigureContext.class.st deleted file mode 100644 index ffdf8b99..00000000 --- a/repository/OpenPonk-Spec/OPDiagramFigureContext.class.st +++ /dev/null @@ -1,85 +0,0 @@ -Class { - #name : 'OPDiagramFigureContext', - #superclass : 'CmdToolContext', - #instVars : [ - 'figure', - 'model', - 'figures', - 'controllers' - ], - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'instance creation' } -OPDiagramFigureContext class >> for: aPresenter of: figures [ - ^ (self for: aPresenter) figures: figures -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> canvas [ - ^ self tool canvas -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> controllers [ - ^ controllers -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> diagramController [ - ^ self tool diagramController -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> diagramElements [ - ^ self controllers collect: #diagramElement -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> figures [ - ^ figures -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> figures: aCollection [ - - figures := aCollection. - controllers := figures collect: [ :each | - self diagramController controllerForRoassalShape: each ] -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> models [ - ^ self controllers collect: #model -] - -{ #category : 'accessing' } -OPDiagramFigureContext >> plugin [ - ^ self diagramController plugin -] - -{ #category : 'testing' } -OPDiagramFigureContext >> representsControllers: aCollection [ - figures ifEmpty: [ ^ false ]. - ^ self controllers - allSatisfy: [ :each | aCollection anySatisfy: [ :cls | each isKindOf: cls ] ] -] - -{ #category : 'testing' } -OPDiagramFigureContext >> representsModel: aModelClass [ - figures ifEmpty: [ ^ false ]. - ^ self models allSatisfy: [ :each | each isKindOf: aModelClass ] -] - -{ #category : 'testing' } -OPDiagramFigureContext >> representsModels: aCollection [ - figures ifEmpty: [ ^ false ]. - ^ self models allSatisfy: [ :each | aCollection anySatisfy: [ :cls | each isKindOf: cls ] ] -] - -{ #category : 'testing' } -OPDiagramFigureContext >> representsSimpleAnnotationUser: aToolClass [ - ^ tool isKindOf: aToolClass -] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureDefaultFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureDefaultFillColorCommand.class.st index 8662e843..0455d335 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureDefaultFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureDefaultFillColorCommand.class.st @@ -1,11 +1,11 @@ Class { #name : 'OPDiagramFigureDefaultFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #traits : 'OPTDiagramFigureDefaultColorCommand', - #classTraits : 'OPTDiagramFigureDefaultColorCommand classTrait', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #traits : 'OPTRoassalShapeDefaultColorCommand', + #classTraits : 'OPTRoassalShapeDefaultColorCommand classTrait', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'accessing' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureDefaultFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureDefaultFontColorCommand.class.st index c1d444ef..3a7d781a 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureDefaultFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureDefaultFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureDefaultFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #traits : 'OPTDiagramFigureDefaultColorCommand', - #classTraits : 'OPTDiagramFigureDefaultColorCommand classTrait', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #traits : 'OPTRoassalShapeDefaultColorCommand', + #classTraits : 'OPTRoassalShapeDefaultColorCommand classTrait', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureDefaultStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureDefaultStrokeColorCommand.class.st index 9a915065..771ac758 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureDefaultStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureDefaultStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureDefaultStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #traits : 'OPTDiagramFigureDefaultColorCommand', - #classTraits : 'OPTDiagramFigureDefaultColorCommand classTrait', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #traits : 'OPTRoassalShapeDefaultColorCommand', + #classTraits : 'OPTRoassalShapeDefaultColorCommand classTrait', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureDevCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureDevCommand.class.st deleted file mode 100644 index e28bfcbe..00000000 --- a/repository/OpenPonk-Spec/OPDiagramFigureDevCommand.class.st +++ /dev/null @@ -1,23 +0,0 @@ -Class { - #name : 'OPDiagramFigureDevCommand', - #superclass : 'OPDiagramFigureCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'activation' } -OPDiagramFigureDevCommand class >> canBeExecutedInContext: aToolContext [ - ^ OPWorkbench isDevelopmentMode -] - -{ #category : 'activation' } -OPDiagramFigureDevCommand class >> contextMenuActivation [ - - ^ CmdContextMenuActivation byItemOf: OPDiagramFigureDevMenuGroup for: OPCanvasPresenter -] - -{ #category : 'testing' } -OPDiagramFigureDevCommand class >> isAbstract [ - ^ self = OPDiagramFigureDevCommand -] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureDevMenuGroup.class.st b/repository/OpenPonk-Spec/OPDiagramFigureDevMenuGroup.class.st deleted file mode 100644 index 317dd112..00000000 --- a/repository/OpenPonk-Spec/OPDiagramFigureDevMenuGroup.class.st +++ /dev/null @@ -1,12 +0,0 @@ -Class { - #name : 'OPDiagramFigureDevMenuGroup', - #superclass : 'CmdMenuGroup', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'accessing' } -OPDiagramFigureDevMenuGroup >> name [ - ^'Development Only' -] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureFillColorCommand.class.st index 171e3e91..73ded99f 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureFillColorCommand', - #superclass : 'OPDiagramFigureColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #superclass : 'OPRoassalShapeColorCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'accessing' } @@ -17,7 +17,7 @@ OPDiagramFigureFillColorCommand class >> contextMenuActivation [ ^ CmdContextMenuActivation - byItemOf: OPFigureFillColorMenuGroup + byItemOf: OPRoassalShapeFillColorMenuGroup for: OPCanvasPresenter ] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureFontColorCommand.class.st index 2bf6594b..229630fe 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureFontColorCommand', - #superclass : 'OPDiagramFigureColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #superclass : 'OPRoassalShapeColorCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'accessing' } @@ -17,7 +17,7 @@ OPDiagramFigureFontColorCommand class >> contextMenuActivation [ ^ CmdContextMenuActivation - byItemOf: OPFigureFontColorMenuGroup + byItemOf: OPRoassalShapeFontColorMenuGroup for: OPCanvasPresenter ] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureGrayFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureGrayFillColorCommand.class.st index c353f410..1aa0e5b1 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureGrayFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureGrayFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureGrayFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureGrayFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureGrayFontColorCommand.class.st index 6ecf7142..76e90fee 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureGrayFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureGrayFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureGrayFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureGrayStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureGrayStrokeColorCommand.class.st index b422fc09..203a45dd 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureGrayStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureGrayStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureGrayStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureGreenFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureGreenFillColorCommand.class.st index f86ca263..3ddd9ca3 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureGreenFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureGreenFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureGreenFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureGreenFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureGreenFontColorCommand.class.st index d7a4d9c0..66836347 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureGreenFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureGreenFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureGreenFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureGreenStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureGreenStrokeColorCommand.class.st index 1584bbc0..542a06b8 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureGreenStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureGreenStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureGreenStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureMagentaFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureMagentaFillColorCommand.class.st index cd2fe397..8579b729 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureMagentaFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureMagentaFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureMagentaFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureMagentaFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureMagentaFontColorCommand.class.st index 5d8d3ca9..db6ecadc 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureMagentaFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureMagentaFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureMagentaFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureMagentaStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureMagentaStrokeColorCommand.class.st index 7a8a6fe0..bb1b3065 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureMagentaStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureMagentaStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureMagentaStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureOrangeFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureOrangeFillColorCommand.class.st index e03c8939..dd14b3fd 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureOrangeFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureOrangeFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureOrangeFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureOrangeFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureOrangeFontColorCommand.class.st index 896d572d..cbb46d51 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureOrangeFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureOrangeFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureOrangeFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureOrangeStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureOrangeStrokeColorCommand.class.st index 87722f87..ad47f442 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureOrangeStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureOrangeStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureOrangeStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureRedFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureRedFillColorCommand.class.st index abced8ee..2ea63f47 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureRedFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureRedFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureRedFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureRedFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureRedFontColorCommand.class.st index d95f46c1..6090911b 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureRedFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureRedFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureRedFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureRedStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureRedStrokeColorCommand.class.st index 260bf145..b318003c 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureRedStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureRedStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureRedStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureStrokeColorCommand.class.st index d7e0d33a..899c78b6 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureStrokeColorCommand', - #superclass : 'OPDiagramFigureColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #superclass : 'OPRoassalShapeColorCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'accessing' } @@ -17,7 +17,7 @@ OPDiagramFigureStrokeColorCommand class >> contextMenuActivation [ ^ CmdContextMenuActivation - byItemOf: OPFigureStrokeColorMenuGroup + byItemOf: OPRoassalShapeStrokeColorMenuGroup for: OPCanvasPresenter ] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureTransparentFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureTransparentFillColorCommand.class.st index 4ac87060..25f24d4d 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureTransparentFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureTransparentFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureTransparentFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureWhiteFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureWhiteFillColorCommand.class.st index 12c79a93..38871200 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureWhiteFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureWhiteFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureWhiteFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureWhiteFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureWhiteFontColorCommand.class.st index 8cc8f6f3..ab450764 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureWhiteFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureWhiteFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureWhiteFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureWhiteStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureWhiteStrokeColorCommand.class.st index 8607c2a5..445f0499 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureWhiteStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureWhiteStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureWhiteStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureYellowFillColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureYellowFillColorCommand.class.st index 0c905cd9..2da1030b 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureYellowFillColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureYellowFillColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureYellowFillColorCommand', #superclass : 'OPDiagramFigureFillColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureYellowFontColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureYellowFontColorCommand.class.st index a9b0db7b..f6023e97 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureYellowFontColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureYellowFontColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureYellowFontColorCommand', #superclass : 'OPDiagramFigureFontColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramFigureYellowStrokeColorCommand.class.st b/repository/OpenPonk-Spec/OPDiagramFigureYellowStrokeColorCommand.class.st index 3004c5e2..0c4939e7 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureYellowStrokeColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPDiagramFigureYellowStrokeColorCommand.class.st @@ -1,9 +1,9 @@ Class { #name : 'OPDiagramFigureYellowStrokeColorCommand', #superclass : 'OPDiagramFigureStrokeColorCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } diff --git a/repository/OpenPonk-Spec/OPDiagramInspectFigureCommand.class.st b/repository/OpenPonk-Spec/OPDiagramInspectFigureCommand.class.st deleted file mode 100644 index 44e13849..00000000 --- a/repository/OpenPonk-Spec/OPDiagramInspectFigureCommand.class.st +++ /dev/null @@ -1,30 +0,0 @@ -Class { - #name : 'OPDiagramInspectFigureCommand', - #superclass : 'OPDiagramFigureDevCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'accessing' } -OPDiagramInspectFigureCommand >> defaultMenuIconName [ - - ^ #glamorousInspect -] - -{ #category : 'accessing' } -OPDiagramInspectFigureCommand >> defaultMenuItemName [ - - | basicName | - basicName := 'Inspect figure'. - figures ifNil: [ ^ basicName ]. - figures size = 1 ifTrue: [ ^ basicName ]. - ^ GRInflector pluralize: basicName -] - -{ #category : 'execution' } -OPDiagramInspectFigureCommand >> execute [ - - figures size = 1 ifTrue: [ ^ figures anyOne inspect ]. - ^ figures inspect -] diff --git a/repository/OpenPonk-Spec/OPDiagramsList.class.st b/repository/OpenPonk-Spec/OPDiagramsList.class.st index 3afbc1bf..7ca801a9 100644 --- a/repository/OpenPonk-Spec/OPDiagramsList.class.st +++ b/repository/OpenPonk-Spec/OPDiagramsList.class.st @@ -82,12 +82,17 @@ OPDiagramsList >> contextMenu: aMenuPresenter for: aDiagram [ { #category : 'actions' } OPDiagramsList >> copyDiagram: aView [ + | name newView | - [ name := UIManager default - request: 'Copy diagram "' , (self displayFor: aView) , '". New name: ' - initialAnswer: aView name - title: 'Copy' ] - doWhileTrue: [ name isNotNil and: [ name isEmpty or: [ name = aView name ] ] ]. + name := nil. + [ + name := UIManager default + request: + 'Copy diagram "' , (self displayFor: aView) + , '". New name: ' + initialAnswer: 'Copy of ' , aView name + title: 'Copy' ] doWhileTrue: [ + name isNotNil and: [ name isEmpty or: [ name = aView name ] ] ]. name ifNil: [ ^ self ]. self workbench projectController updateDiagrams. newView := project copyDiagram: aView. diff --git a/repository/OpenPonk-Spec/OPFigureFontColorMenuGroup.class.st b/repository/OpenPonk-Spec/OPFigureFontColorMenuGroup.class.st deleted file mode 100644 index 25792cd1..00000000 --- a/repository/OpenPonk-Spec/OPFigureFontColorMenuGroup.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'OPFigureFontColorMenuGroup', - #superclass : 'OPFigureColorMenuGroup', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'as yet unclassified' } -OPFigureFontColorMenuGroup class >> colors [ - - ^ OPFigureStrokeColorMenuGroup colors -] - -{ #category : 'as yet unclassified' } -OPFigureFontColorMenuGroup class >> styleAttribute [ - - ^ #fontColor -] - -{ #category : 'accessing' } -OPFigureFontColorMenuGroup >> name [ - - ^ 'Font color' -] diff --git a/repository/OpenPonk-Spec/OPHideDependentFigureCommand.class.st b/repository/OpenPonk-Spec/OPHideDependentFigureCommand.class.st deleted file mode 100644 index 6257514c..00000000 --- a/repository/OpenPonk-Spec/OPHideDependentFigureCommand.class.st +++ /dev/null @@ -1,15 +0,0 @@ -Class { - #name : 'OPHideDependentFigureCommand', - #superclass : 'OPToggleFigureCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'execution' } -OPHideDependentFigureCommand >> basicExecute [ - - controllers - select: #isHideable - thenDo: [ :each | executor hideDependentFor: each model ] -] diff --git a/repository/OpenPonk-Spec/OPHideDependentRoassalShapesCommand.class.st b/repository/OpenPonk-Spec/OPHideDependentRoassalShapesCommand.class.st new file mode 100644 index 00000000..e24220c1 --- /dev/null +++ b/repository/OpenPonk-Spec/OPHideDependentRoassalShapesCommand.class.st @@ -0,0 +1,15 @@ +Class { + #name : 'OPHideDependentRoassalShapesCommand', + #superclass : 'OPToggleRoassalShapeCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', + #package : 'OpenPonk-Spec', + #tag : 'Diagram-RoassalShape-Commands' +} + +{ #category : 'execution' } +OPHideDependentRoassalShapesCommand >> basicExecute [ + + controllers + select: #isHideable + thenDo: [ :each | executor hideDependentFor: each model ] +] diff --git a/repository/OpenPonk-Spec/OPHideFigureCommand.class.st b/repository/OpenPonk-Spec/OPHideFigureCommand.class.st deleted file mode 100644 index 2f9bc126..00000000 --- a/repository/OpenPonk-Spec/OPHideFigureCommand.class.st +++ /dev/null @@ -1,20 +0,0 @@ -Class { - #name : 'OPHideFigureCommand', - #superclass : 'OPToggleFigureCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'testing' } -OPHideFigureCommand class >> canvasShortcutActivation [ - - ^ CmdShortcutActivation by: $h meta for: OPCanvasPresenter -] - -{ #category : 'execution' } -OPHideFigureCommand >> basicExecute [ - - executor hideElements: - (controllers select: #isHideable thenCollect: #model) -] diff --git a/repository/OpenPonk-Spec/OPHideRoassalShapeCommand.class.st b/repository/OpenPonk-Spec/OPHideRoassalShapeCommand.class.st new file mode 100644 index 00000000..37d3a9e9 --- /dev/null +++ b/repository/OpenPonk-Spec/OPHideRoassalShapeCommand.class.st @@ -0,0 +1,20 @@ +Class { + #name : 'OPHideRoassalShapeCommand', + #superclass : 'OPToggleRoassalShapeCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', + #package : 'OpenPonk-Spec', + #tag : 'Diagram-RoassalShape-Commands' +} + +{ #category : 'testing' } +OPHideRoassalShapeCommand class >> canvasShortcutActivation [ + + ^ CmdShortcutActivation by: $h meta for: OPCanvasPresenter +] + +{ #category : 'execution' } +OPHideRoassalShapeCommand >> basicExecute [ + + executor hideElements: + (controllers select: #isHideable thenCollect: #model) +] diff --git a/repository/OpenPonk-Spec/OPDiagramInspectControllerFigureCommand.class.st b/repository/OpenPonk-Spec/OPInspectControllerOfRoassalShapeCommand.class.st similarity index 52% rename from repository/OpenPonk-Spec/OPDiagramInspectControllerFigureCommand.class.st rename to repository/OpenPonk-Spec/OPInspectControllerOfRoassalShapeCommand.class.st index a64c60fe..b238b06a 100644 --- a/repository/OpenPonk-Spec/OPDiagramInspectControllerFigureCommand.class.st +++ b/repository/OpenPonk-Spec/OPInspectControllerOfRoassalShapeCommand.class.st @@ -1,36 +1,36 @@ -Class { - #name : 'OPDiagramInspectControllerFigureCommand', - #superclass : 'OPDiagramFigureDevCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'testing' } -OPDiagramInspectControllerFigureCommand class >> canvasShortcutActivation [ - - ^ CmdShortcutActivation by: $i shift meta for: OPCanvasPresenter -] - -{ #category : 'accessing' } -OPDiagramInspectControllerFigureCommand >> defaultMenuIconName [ - - ^ #glamorousInspect -] - -{ #category : 'accessing' } -OPDiagramInspectControllerFigureCommand >> defaultMenuItemName [ - - | basicName | - basicName := 'Inspect controller'. - controllers ifNil: [ ^ basicName ]. - controllers size = 1 ifTrue: [ ^ basicName ]. - ^ GRInflector pluralize: basicName -] - -{ #category : 'execution' } -OPDiagramInspectControllerFigureCommand >> execute [ - - controllers size = 1 ifTrue: [ ^ controllers anyOne inspect ]. - ^ controllers inspect -] +Class { + #name : 'OPInspectControllerOfRoassalShapeCommand', + #superclass : 'OPRoassalShapeDevCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', + #package : 'OpenPonk-Spec', + #tag : 'Diagram-RoassalShape-Commands' +} + +{ #category : 'testing' } +OPInspectControllerOfRoassalShapeCommand class >> canvasShortcutActivation [ + + ^ CmdShortcutActivation by: $i shift meta for: OPCanvasPresenter +] + +{ #category : 'accessing' } +OPInspectControllerOfRoassalShapeCommand >> defaultMenuIconName [ + + ^ #glamorousInspect +] + +{ #category : 'accessing' } +OPInspectControllerOfRoassalShapeCommand >> defaultMenuItemName [ + + | basicName | + basicName := 'Inspect controller'. + controllers ifNil: [ ^ basicName ]. + controllers size = 1 ifTrue: [ ^ basicName ]. + ^ GRInflector pluralize: basicName +] + +{ #category : 'execution' } +OPInspectControllerOfRoassalShapeCommand >> execute [ + + controllers size = 1 ifTrue: [ ^ controllers anyOne inspect ]. + ^ controllers inspect +] diff --git a/repository/OpenPonk-Spec/OPDiagramInspectDiagramElementCommand.class.st b/repository/OpenPonk-Spec/OPInspectDiagramElementCommand.class.st similarity index 55% rename from repository/OpenPonk-Spec/OPDiagramInspectDiagramElementCommand.class.st rename to repository/OpenPonk-Spec/OPInspectDiagramElementCommand.class.st index a5085b58..9660b678 100644 --- a/repository/OpenPonk-Spec/OPDiagramInspectDiagramElementCommand.class.st +++ b/repository/OpenPonk-Spec/OPInspectDiagramElementCommand.class.st @@ -1,19 +1,19 @@ Class { - #name : 'OPDiagramInspectDiagramElementCommand', - #superclass : 'OPDiagramFigureDevCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #name : 'OPInspectDiagramElementCommand', + #superclass : 'OPRoassalShapeDevCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'accessing' } -OPDiagramInspectDiagramElementCommand >> defaultMenuIconName [ +OPInspectDiagramElementCommand >> defaultMenuIconName [ ^ #glamorousInspect ] { #category : 'accessing' } -OPDiagramInspectDiagramElementCommand >> defaultMenuItemName [ +OPInspectDiagramElementCommand >> defaultMenuItemName [ | basicName | basicName := 'Inspect diagram element'. @@ -23,7 +23,7 @@ OPDiagramInspectDiagramElementCommand >> defaultMenuItemName [ ] { #category : 'execution' } -OPDiagramInspectDiagramElementCommand >> execute [ +OPInspectDiagramElementCommand >> execute [ diagramElements size = 1 ifTrue: [ ^ diagramElements anyOne inspect ]. ^ diagramElements inspect diff --git a/repository/OpenPonk-Spec/OPDiagramInspectModelFigureCommand.class.st b/repository/OpenPonk-Spec/OPInspectModelOfRoassalShapeCommand.class.st similarity index 52% rename from repository/OpenPonk-Spec/OPDiagramInspectModelFigureCommand.class.st rename to repository/OpenPonk-Spec/OPInspectModelOfRoassalShapeCommand.class.st index 88fc3fdb..4346eba7 100644 --- a/repository/OpenPonk-Spec/OPDiagramInspectModelFigureCommand.class.st +++ b/repository/OpenPonk-Spec/OPInspectModelOfRoassalShapeCommand.class.st @@ -1,36 +1,36 @@ -Class { - #name : 'OPDiagramInspectModelFigureCommand', - #superclass : 'OPDiagramFigureCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'testing' } -OPDiagramInspectModelFigureCommand class >> canvasShortcutActivation [ - - ^ CmdShortcutActivation by: $i meta for: OPCanvasPresenter -] - -{ #category : 'accessing' } -OPDiagramInspectModelFigureCommand >> defaultMenuIconName [ - - ^ #glamorousInspect -] - -{ #category : 'accessing' } -OPDiagramInspectModelFigureCommand >> defaultMenuItemName [ - - | basicName | - basicName := 'Inspect model'. - models ifNil: [ ^ basicName ]. - models size = 1 ifTrue: [ ^ basicName ]. - ^ GRInflector pluralize: basicName -] - -{ #category : 'execution' } -OPDiagramInspectModelFigureCommand >> execute [ - - models size = 1 ifTrue: [ ^ models anyOne inspect ]. - ^ models inspect -] +Class { + #name : 'OPInspectModelOfRoassalShapeCommand', + #superclass : 'OPRoassalShapeCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', + #package : 'OpenPonk-Spec', + #tag : 'Diagram-RoassalShape-Commands' +} + +{ #category : 'testing' } +OPInspectModelOfRoassalShapeCommand class >> canvasShortcutActivation [ + + ^ CmdShortcutActivation by: $i meta for: OPCanvasPresenter +] + +{ #category : 'accessing' } +OPInspectModelOfRoassalShapeCommand >> defaultMenuIconName [ + + ^ #glamorousInspect +] + +{ #category : 'accessing' } +OPInspectModelOfRoassalShapeCommand >> defaultMenuItemName [ + + | basicName | + basicName := 'Inspect model'. + models ifNil: [ ^ basicName ]. + models size = 1 ifTrue: [ ^ basicName ]. + ^ GRInflector pluralize: basicName +] + +{ #category : 'execution' } +OPInspectModelOfRoassalShapeCommand >> execute [ + + models size = 1 ifTrue: [ ^ models anyOne inspect ]. + ^ models inspect +] diff --git a/repository/OpenPonk-Spec/OPInspectRoassalShapeCommand.class.st b/repository/OpenPonk-Spec/OPInspectRoassalShapeCommand.class.st new file mode 100644 index 00000000..085f1ea4 --- /dev/null +++ b/repository/OpenPonk-Spec/OPInspectRoassalShapeCommand.class.st @@ -0,0 +1,30 @@ +Class { + #name : 'OPInspectRoassalShapeCommand', + #superclass : 'OPRoassalShapeDevCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', + #package : 'OpenPonk-Spec', + #tag : 'Diagram-RoassalShape-Commands' +} + +{ #category : 'accessing' } +OPInspectRoassalShapeCommand >> defaultMenuIconName [ + + ^ #glamorousInspect +] + +{ #category : 'accessing' } +OPInspectRoassalShapeCommand >> defaultMenuItemName [ + + | basicName | + basicName := 'Inspect figure'. + roassalShapes ifNil: [ ^ basicName ]. + roassalShapes size = 1 ifTrue: [ ^ basicName ]. + ^ GRInflector pluralize: basicName +] + +{ #category : 'execution' } +OPInspectRoassalShapeCommand >> execute [ + + roassalShapes size = 1 ifTrue: [ ^ roassalShapes anyOne inspect ]. + ^ roassalShapes inspect +] diff --git a/repository/OpenPonk-Spec/OPDiagramRemoveFigureCommand.class.st b/repository/OpenPonk-Spec/OPRemoveModelOfRoassalShapeCommand.class.st similarity index 66% rename from repository/OpenPonk-Spec/OPDiagramRemoveFigureCommand.class.st rename to repository/OpenPonk-Spec/OPRemoveModelOfRoassalShapeCommand.class.st index dfd5a88c..c49c8dcd 100644 --- a/repository/OpenPonk-Spec/OPDiagramRemoveFigureCommand.class.st +++ b/repository/OpenPonk-Spec/OPRemoveModelOfRoassalShapeCommand.class.st @@ -1,141 +1,141 @@ -Class { - #name : 'OPDiagramRemoveFigureCommand', - #superclass : 'OPDiagramFigureCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', - #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' -} - -{ #category : 'testing' } -OPDiagramRemoveFigureCommand class >> canBeExecutedInContext: aToolContext [ - - ^ (super canBeExecutedInContext: aToolContext) and: [ - aToolContext figures anySatisfy: [ :any | any canvas ~= any ] ] -] - -{ #category : 'testing' } -OPDiagramRemoveFigureCommand class >> canvasShortcutActivation [ - - - ^ CmdShortcutActivation - by: (KMKeyCombinationChoice withShortcuts: { - (KMSingleKeyCombination new key: - (KeyboardKey new withValue: 16rffff andName: #delete)). - ((KMSingleKeyCombination new key: - (KeyboardKey new withValue: 16rffff andName: #delete)) - modifiedBy: self skipConfirmationModifier) }) - for: OPCanvasPresenter -] - -{ #category : 'accessing' } -OPDiagramRemoveFigureCommand class >> lastEvent [ - - self flag: - 'Part of ugly hack to find out if the modifier key was pressed'. - - ^ lastEvent -] - -{ #category : 'accessing' } -OPDiagramRemoveFigureCommand class >> lastEvent: anEvent [ - - self flag: - 'Part of ugly hack to find out if the modifier key was pressed'. - - lastEvent := anEvent -] - -{ #category : 'constants' } -OPDiagramRemoveFigureCommand class >> skipConfirmationModifier [ - - ^ KMModifier shift -] - -{ #category : 'accessing' } -OPDiagramRemoveFigureCommand >> defaultMenuIconName [ - - ^ #glamorousTrash -] - -{ #category : 'accessing' } -OPDiagramRemoveFigureCommand >> defaultMenuItemName [ - - ^ (models isNil or: [ models size = 1 ]) - ifTrue: [ 'Remove from model' ] - ifFalse: [ 'Remove all ' , models size asString , ' from model' ] -] - -{ #category : 'utilities' } -OPDiagramRemoveFigureCommand >> doAndReturnFocus: aBlock [ - - | result window wasActive | - window := diagramController canvasPresenter window window. - wasActive := window isActive. - result := aBlock value. - window activate. - ^ result -] - -{ #category : 'execution' } -OPDiagramRemoveFigureCommand >> execute [ - - self class lastEvent ifNotNil: [ :lastEvent | - (self class skipConfirmationModifier matchesEvent: lastEvent) - ifTrue: [ ^ self executeWithoutConfirmation ] ]. - self executeWithConfirmation -] - -{ #category : 'execution' } -OPDiagramRemoveFigureCommand >> executeWithConfirmation [ - - | result | - result := self doAndReturnFocus: [ - UIManager default - proceed: - 'Permanently remove from model? (to skip this confirmation, hold ' - , self class skipConfirmationModifier name - , ' next time)' - title: 'Remove?' ]. - result ifNil: [ ^ self ]. - result ifFalse: [ ^ self ]. - self executeWithoutConfirmation -] - -{ #category : 'execution' } -OPDiagramRemoveFigureCommand >> executeWithoutConfirmation [ - - | allShown | - allShown := self showDependentAndReturnOriginallyShown. - - figures do: [ :each | - (diagramController hasControllerForFigure: each) ifTrue: [ - diagramController removeModelOfRoassalShape: each ] ]. - - self removeAllNotOriginallyShown: allShown. - - canvas signalUpdate -] - -{ #category : 'execution' } -OPDiagramRemoveFigureCommand >> removeAllNotOriginallyShown: allShown [ - - diagramController allVisibleShowableElements - reject: [ :any | allShown includes: any ] - thenDo: [ :each | - diagramController - controllerForModel: each - ifFound: [ :controller | - controller removeControllerAndDiagramElement ] ] -] - -{ #category : 'execution' } -OPDiagramRemoveFigureCommand >> showDependentAndReturnOriginallyShown [ - - | executor allShown dependent | - executor := OPDiagramExplorer on: diagramController. - allShown := diagramController allVisibleShowableElements asSet. - dependent := models flatCollect: [ :each | - executor dependentFor: each ]. - executor showElements: dependent. - ^ allShown -] +Class { + #name : 'OPRemoveModelOfRoassalShapeCommand', + #superclass : 'OPRoassalShapeCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', + #package : 'OpenPonk-Spec', + #tag : 'Diagram-RoassalShape-Commands' +} + +{ #category : 'testing' } +OPRemoveModelOfRoassalShapeCommand class >> canBeExecutedInContext: aToolContext [ + + ^ (super canBeExecutedInContext: aToolContext) and: [ + aToolContext roassalShapes anySatisfy: [ :any | any canvas ~= any ] ] +] + +{ #category : 'testing' } +OPRemoveModelOfRoassalShapeCommand class >> canvasShortcutActivation [ + + + ^ CmdShortcutActivation + by: (KMKeyCombinationChoice withShortcuts: { + (KMSingleKeyCombination new key: + (KeyboardKey new withValue: 16rffff andName: #delete)). + ((KMSingleKeyCombination new key: + (KeyboardKey new withValue: 16rffff andName: #delete)) + modifiedBy: self skipConfirmationModifier) }) + for: OPCanvasPresenter +] + +{ #category : 'accessing' } +OPRemoveModelOfRoassalShapeCommand class >> lastEvent [ + + self flag: + 'Part of ugly hack to find out if the modifier key was pressed'. + + ^ lastEvent +] + +{ #category : 'accessing' } +OPRemoveModelOfRoassalShapeCommand class >> lastEvent: anEvent [ + + self flag: + 'Part of ugly hack to find out if the modifier key was pressed'. + + lastEvent := anEvent +] + +{ #category : 'constants' } +OPRemoveModelOfRoassalShapeCommand class >> skipConfirmationModifier [ + + ^ KMModifier shift +] + +{ #category : 'accessing' } +OPRemoveModelOfRoassalShapeCommand >> defaultMenuIconName [ + + ^ #glamorousTrash +] + +{ #category : 'accessing' } +OPRemoveModelOfRoassalShapeCommand >> defaultMenuItemName [ + + ^ (models isNil or: [ models size = 1 ]) + ifTrue: [ 'Remove from model' ] + ifFalse: [ 'Remove all ' , models size asString , ' from model' ] +] + +{ #category : 'utilities' } +OPRemoveModelOfRoassalShapeCommand >> doAndReturnFocus: aBlock [ + + | result window wasActive | + window := diagramController canvasPresenter window window. + wasActive := window isActive. + result := aBlock value. + window activate. + ^ result +] + +{ #category : 'execution' } +OPRemoveModelOfRoassalShapeCommand >> execute [ + + self class lastEvent ifNotNil: [ :lastEvent | + (self class skipConfirmationModifier matchesEvent: lastEvent) + ifTrue: [ ^ self executeWithoutConfirmation ] ]. + self executeWithConfirmation +] + +{ #category : 'execution' } +OPRemoveModelOfRoassalShapeCommand >> executeWithConfirmation [ + + | result | + result := self doAndReturnFocus: [ + UIManager default + proceed: + 'Permanently remove from model? (to skip this confirmation, hold ' + , self class skipConfirmationModifier name + , ' next time)' + title: 'Remove?' ]. + result ifNil: [ ^ self ]. + result ifFalse: [ ^ self ]. + self executeWithoutConfirmation +] + +{ #category : 'execution' } +OPRemoveModelOfRoassalShapeCommand >> executeWithoutConfirmation [ + + | allShown | + allShown := self showDependentAndReturnOriginallyShown. + + roassalShapes do: [ :each | + (diagramController hasControllerForRoassalShape: each) ifTrue: [ + diagramController removeModelOfRoassalShape: each ] ]. + + self removeAllNotOriginallyShown: allShown. + + canvas signalUpdate +] + +{ #category : 'execution' } +OPRemoveModelOfRoassalShapeCommand >> removeAllNotOriginallyShown: allShown [ + + diagramController allModelElementsWithController + reject: [ :any | allShown includes: any ] + thenDo: [ :each | + diagramController + controllerForModel: each + ifFound: [ :controller | + controller removeControllerAndDiagramElement ] ] +] + +{ #category : 'execution' } +OPRemoveModelOfRoassalShapeCommand >> showDependentAndReturnOriginallyShown [ + + | executor allShown dependent | + executor := OPDiagramExplorer on: diagramController. + allShown := diagramController allModelElementsWithController asSet. + dependent := models flatCollect: [ :each | + executor dependentFor: each ]. + executor showElements: dependent. + ^ allShown +] diff --git a/repository/OpenPonk-Spec/OPDiagramFigureColorCommand.class.st b/repository/OpenPonk-Spec/OPRoassalShapeColorCommand.class.st similarity index 65% rename from repository/OpenPonk-Spec/OPDiagramFigureColorCommand.class.st rename to repository/OpenPonk-Spec/OPRoassalShapeColorCommand.class.st index bb616a6c..6a407f85 100644 --- a/repository/OpenPonk-Spec/OPDiagramFigureColorCommand.class.st +++ b/repository/OpenPonk-Spec/OPRoassalShapeColorCommand.class.st @@ -1,13 +1,13 @@ Class { - #name : 'OPDiagramFigureColorCommand', - #superclass : 'OPDiagramFigureCommand', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #name : 'OPRoassalShapeColorCommand', + #superclass : 'OPRoassalShapeCommand', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'testing' } -OPDiagramFigureColorCommand class >> canBeExecutedInContext: aToolContext [ +OPRoassalShapeColorCommand class >> canBeExecutedInContext: aToolContext [ ^ (super canBeExecutedInContext: aToolContext) and: [ aToolContext controllers anySatisfy: [ :any | @@ -15,25 +15,25 @@ OPDiagramFigureColorCommand class >> canBeExecutedInContext: aToolContext [ ] { #category : 'accessing' } -OPDiagramFigureColorCommand class >> color [ +OPRoassalShapeColorCommand class >> color [ ^ self subclassResponsibility ] { #category : 'accessing' } -OPDiagramFigureColorCommand class >> colorAttribute [ +OPRoassalShapeColorCommand class >> colorAttribute [ ^ self subclassResponsibility ] { #category : 'accessing' } -OPDiagramFigureColorCommand class >> colorFor: aDiagramElement [ +OPRoassalShapeColorCommand class >> colorFor: aDiagramElement [ ^ self color ] { #category : 'accessing' } -OPDiagramFigureColorCommand class >> currentColorOf: aDiagramElement [ +OPRoassalShapeColorCommand class >> currentColorOf: aDiagramElement [ ^ aDiagramElement stylePropertyNamed: self colorAttribute @@ -41,13 +41,13 @@ OPDiagramFigureColorCommand class >> currentColorOf: aDiagramElement [ ] { #category : 'accessing' } -OPDiagramFigureColorCommand class >> defaultColorOf: aDiagramElement [ +OPRoassalShapeColorCommand class >> defaultColorOf: aDiagramElement [ ^ self subclassResponsibility ] { #category : 'accessing' } -OPDiagramFigureColorCommand class >> defaultColorsOfDiagramElements: diagramElements [ +OPRoassalShapeColorCommand class >> defaultColorsOfDiagramElements: diagramElements [ ^ (diagramElements select: [ :each | each supportsColorChangeOfType: self colorAttribute ]) @@ -56,20 +56,20 @@ OPDiagramFigureColorCommand class >> defaultColorsOfDiagramElements: diagramElem ] { #category : 'testing' } -OPDiagramFigureColorCommand class >> isAbstract [ +OPRoassalShapeColorCommand class >> isAbstract [ - ^ self = OPDiagramFigureColorCommand or: [ - self superclass = OPDiagramFigureColorCommand ] + ^ self = OPRoassalShapeColorCommand or: [ + self superclass = OPRoassalShapeColorCommand ] ] { #category : 'accessing' } -OPDiagramFigureColorCommand >> color [ +OPRoassalShapeColorCommand >> color [ ^ self class color ] { #category : 'accessing' } -OPDiagramFigureColorCommand >> colorName [ +OPRoassalShapeColorCommand >> colorName [ | colorName | colorName := self color name. @@ -78,7 +78,7 @@ OPDiagramFigureColorCommand >> colorName [ ] { #category : 'accessing - defaults' } -OPDiagramFigureColorCommand >> currentColors [ +OPRoassalShapeColorCommand >> currentColors [ ^ (diagramElements select: [ :each | each supportsColorChangeOfType: self class colorAttribute ]) @@ -87,13 +87,13 @@ OPDiagramFigureColorCommand >> currentColors [ ] { #category : 'accessing - defaults' } -OPDiagramFigureColorCommand >> defaultColors [ +OPRoassalShapeColorCommand >> defaultColors [ ^ self class defaultColorsOfDiagramElements: diagramElements ] { #category : 'accessing' } -OPDiagramFigureColorCommand >> defaultMenuIconFormSet [ +OPRoassalShapeColorCommand >> defaultMenuIconFormSet [ ^ FormSet form: (Morph new color: self color; @@ -101,7 +101,7 @@ OPDiagramFigureColorCommand >> defaultMenuIconFormSet [ ] { #category : 'accessing' } -OPDiagramFigureColorCommand >> defaultMenuItemName [ +OPRoassalShapeColorCommand >> defaultMenuItemName [ | isDefault isCurrent | isDefault := self defaultColors allSatisfy: [ :each | @@ -115,7 +115,7 @@ OPDiagramFigureColorCommand >> defaultMenuItemName [ ] { #category : 'execution' } -OPDiagramFigureColorCommand >> execute [ +OPRoassalShapeColorCommand >> execute [ diagramElements select: [ :each | @@ -125,7 +125,7 @@ OPDiagramFigureColorCommand >> execute [ ] { #category : 'execution' } -OPDiagramFigureColorCommand >> executeOn: aDiagramElement [ +OPRoassalShapeColorCommand >> executeOn: aDiagramElement [ aDiagramElement stylePropertyNamed: self class colorAttribute diff --git a/repository/OpenPonk-Spec/OPFigureColorMenuGroup.class.st b/repository/OpenPonk-Spec/OPRoassalShapeColorMenuGroup.class.st similarity index 77% rename from repository/OpenPonk-Spec/OPFigureColorMenuGroup.class.st rename to repository/OpenPonk-Spec/OPRoassalShapeColorMenuGroup.class.st index bd575904..880e34fb 100644 --- a/repository/OpenPonk-Spec/OPFigureColorMenuGroup.class.st +++ b/repository/OpenPonk-Spec/OPRoassalShapeColorMenuGroup.class.st @@ -1,26 +1,26 @@ Class { - #name : 'OPFigureColorMenuGroup', + #name : 'OPRoassalShapeColorMenuGroup', #superclass : 'CmdMenuGroup', - #category : 'OpenPonk-Spec-Diagram-Figure-Commands', + #category : 'OpenPonk-Spec-Diagram-RoassalShape-Commands', #package : 'OpenPonk-Spec', - #tag : 'Diagram-Figure-Commands' + #tag : 'Diagram-RoassalShape-Commands' } { #category : 'as yet unclassified' } -OPFigureColorMenuGroup class >> colors [ +OPRoassalShapeColorMenuGroup class >> colors [ ^ self subclassResponsibility ] { #category : 'as yet unclassified' } -OPFigureColorMenuGroup class >> generateAllColorCommands [ +OPRoassalShapeColorMenuGroup class >> generateAllColorCommands [