diff --git a/repository/OpenPonk-ClassEditor/OPTUmlAutoAccomodatingShape.trait.st b/repository/OpenPonk-ClassEditor/OPTUmlAutoAccomodatingShape.trait.st index b36f90ac..7209b1a1 100644 --- a/repository/OpenPonk-ClassEditor/OPTUmlAutoAccomodatingShape.trait.st +++ b/repository/OpenPonk-ClassEditor/OPTUmlAutoAccomodatingShape.trait.st @@ -13,7 +13,7 @@ OPTUmlAutoAccomodatingShape >> accomodateContents [ encompassingRectangle. extentOfContents := self extentToFitContents max: self minExtent. self roassalShape extent: extentOfContents. - (originalEncompassingRectangle height closeTo: extentOfContents y) + (originalEncompassingRectangle height closeTo: extentOfContents y) ifTrue: [ ^ self ]. self roassalShape translateTo: self roassalShape position x @ diff --git a/repository/OpenPonk-ClassEditor/OPTUmlBaseController.trait.st b/repository/OpenPonk-ClassEditor/OPTUmlBaseController.trait.st index ebc7ca27..cef7a188 100644 --- a/repository/OpenPonk-ClassEditor/OPTUmlBaseController.trait.st +++ b/repository/OpenPonk-ClassEditor/OPTUmlBaseController.trait.st @@ -12,7 +12,7 @@ OPTUmlBaseController >> descriptionAccessor: aSymbol [ read: [ :me | me model perform: aSymbol ] write: [ :me :newValue | me model perform: (aSymbol , ':') asSymbol with: newValue. - self diagramElement modelChanged ] + self modelChanged ] ] { #category : 'forms' } @@ -22,18 +22,18 @@ OPTUmlBaseController >> descriptionComment [ ^ MAMemoDescription new required: false; accessor: (MAPluggableAccessor - read: [ :me | + read: [ :me | me model ownedComments ifEmpty: [ '' ] ifNotEmpty: [ :oc | oc first body asString ] ] - write: [ :me :newValue | + write: [ :me :newValue | newValue asString ifEmpty: [ me model ownedComments: OrderedCollection new ] - ifNotEmpty: [ - me model ownedComments ifEmpty: [ + ifNotEmpty: [ + me model ownedComments ifEmpty: [ me model ownedComments add: OPUMLComment new ]. me model ownedComments first body: newValue asString ]. - self diagramElement modelChanged ]); + self modelChanged ]); label: 'Comment'; priority: 100; lineCount: 10; @@ -66,7 +66,7 @@ OPTUmlBaseController >> descriptionVisibility [ ^ MASingleOptionDescription new - optionsAndLabels: { + optionsAndLabels: { (nil -> ''). (OPUMLVisibilityKind public -> 'public'). (OPUMLVisibilityKind protected -> 'protected'). @@ -75,9 +75,9 @@ OPTUmlBaseController >> descriptionVisibility [ reference: MAStringDescription new; accessor: (MAPluggableAccessor read: [ :me | me model visibility ] - write: [ :me :newValue | + write: [ :me :newValue | me model visibility: newValue. - self diagramElement modelChanged ]); + self modelChanged ]); label: 'Visibility'; priority: 8; beSorted; diff --git a/repository/OpenPonk-ClassEditor/OPTUmlStereotypedElementController.trait.st b/repository/OpenPonk-ClassEditor/OPTUmlStereotypedElementController.trait.st index 8ddce087..273a39fd 100644 --- a/repository/OpenPonk-ClassEditor/OPTUmlStereotypedElementController.trait.st +++ b/repository/OpenPonk-ClassEditor/OPTUmlStereotypedElementController.trait.st @@ -44,7 +44,7 @@ OPTUmlStereotypedElementController >> descriptionStereotypeContent [ applyStereotype: (stereotypes detect: [ :each | each name = newValue ]) to: me model ]. - me diagramElement modelChanged ]); + me modelChanged ]); label: 'Stereotype'; priority: 4; yourself diff --git a/repository/OpenPonk-ClassEditor/OPUmlAbstractAssociationController.class.st b/repository/OpenPonk-ClassEditor/OPUmlAbstractAssociationController.class.st index 71df2000..ce19975c 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlAbstractAssociationController.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlAbstractAssociationController.class.st @@ -6,12 +6,30 @@ Class { #tag : 'Controllers' } +{ #category : 'announcements' } +OPUmlAbstractAssociationController >> classAttributeChanged [ + + super modelChanged +] + { #category : 'accessing' } OPUmlAbstractAssociationController >> elementsToShowInside [ ^ super elementsToShowInside , self model memberEnds ] +{ #category : 'announcements' } +OPUmlAbstractAssociationController >> modelChanged [ + + super modelChanged. + self model memberEnds + select: [ :each | each owningClass isNotNil ] + thenDo: [ :each | + self diagramController + controllerForModel: each + ifFound: [ :controller | controller associationChanged ] ] +] + { #category : 'accessing' } OPUmlAbstractAssociationController >> modelSource [ diff --git a/repository/OpenPonk-ClassEditor/OPUmlAssociationController.class.st b/repository/OpenPonk-ClassEditor/OPUmlAssociationController.class.st index dfd4d7a1..9cf06b61 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlAssociationController.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlAssociationController.class.st @@ -22,10 +22,10 @@ OPUmlAssociationController >> descriptionActionSwitchSourceTarget [ self canSwitchSourceAndTarget ifFalse: [ ^ self ]. description := OPMAActionDescription new. description - action: [ + action: [ self switchSourceAndTarget. self diagramController editor openFormOn: self. - self diagramElement modelChanged ]; + self modelChanged ]; label: 'Switch source/target'; priority: 9.05. ^ description diff --git a/repository/OpenPonk-ClassEditor/OPUmlAttributeController.class.st b/repository/OpenPonk-ClassEditor/OPUmlAttributeController.class.st index 87f24f07..5576d89a 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlAttributeController.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlAttributeController.class.st @@ -15,6 +15,12 @@ OPUmlAttributeController >> addDiagramElementToOwner [ self ownerDiagramElement addAttribute: self diagramElement ] +{ #category : 'announcements' } +OPUmlAttributeController >> associationChanged [ + + super modelChanged +] + { #category : 'figures' } OPUmlAttributeController >> createDiagramElement [ @@ -63,7 +69,7 @@ OPUmlAttributeController >> descriptionDefaultValue [ ifTrue: [ me model defaultValue bodies: (newValue ifEmpty: [ { } ] ifNotEmpty: [ { newValue } ]) ]. - self diagramElement modelChanged ]); + self modelChanged ]); label: 'Default Value'; priority: 42; yourself @@ -118,12 +124,12 @@ OPUmlAttributeController >> descriptionMultiplicity [ options: #( '0..1' '1..1' '0..*' '1..*' ); reference: MAStringDescription new; accessor: (MAPluggableAccessor - read: [ :me | + read: [ :me | me model lowerBound asString , '..' , me model upperBound asString ] - write: [ :me :newValue | + write: [ :me :newValue | self writeMultiplicityFrom: newValue to: me model. - self diagramElement modelChanged ]); + self modelChanged ]); label: 'Multiplicity'; priority: 9; beSorted; @@ -137,11 +143,11 @@ OPUmlAttributeController >> descriptionType [ ^ MAStringDescription new accessor: (MAPluggableAccessor read: [ :me | me model type ifNil: [ '' ] ifNotNil: #name ] - write: [ :me :newValue | + write: [ :me :newValue | newValue ifEmpty: [ me model type: nil ] ifNotEmpty: [ me model type: (self typeNamed: newValue) ]. - self diagramElement modelChanged ]); + self modelChanged ]); label: 'Type'; priority: 5; yourself @@ -153,6 +159,16 @@ OPUmlAttributeController >> diagramElementClass [ ^ OPUmlAttributeLabel ] +{ #category : 'announcements' } +OPUmlAttributeController >> modelChanged [ + + super modelChanged. + self model association ifNotNil: [ :association | + self diagramController + controllerForModel: association + ifFound: [ :controller | controller classAttributeChanged ] ] +] + { #category : 'accessing' } OPUmlAttributeController >> modelClass [ ^ OPUMLProperty diff --git a/repository/OpenPonk-ClassEditor/OPUmlClassController.class.st b/repository/OpenPonk-ClassEditor/OPUmlClassController.class.st index 29e43333..212a09c2 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlClassController.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlClassController.class.st @@ -59,7 +59,7 @@ OPUmlClassController >> createAttributeAdornmentBy: builder [ self diagramController editor palette selectTool: tool. tool whenCreated: [ :ctrl | OPRenameElementCommand executeOn: ctrl. - ctrl diagramElement modelChanged ]. + ctrl modelChanged ]. tool selectedControllers: { self } ] ] diff --git a/repository/OpenPonk-ClassEditor/OPUmlClassShape.class.st b/repository/OpenPonk-ClassEditor/OPUmlClassShape.class.st index ca0d8e08..8f8e5e63 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlClassShape.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlClassShape.class.st @@ -35,7 +35,7 @@ OPUmlClassShape >> addAttribute: anAttributeShape [ { #category : 'rendering' } OPUmlClassShape >> addOperation: anOperationShape [ - operations ifNil: [ + operations ifNil: [ operations := OPUmlFeaturesListCompartment in: self. self sortOwnedElements ]. diff --git a/repository/OpenPonk-ClassEditor/OPUmlClassifierController.class.st b/repository/OpenPonk-ClassEditor/OPUmlClassifierController.class.st index d311c16a..f47e0611 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlClassifierController.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlClassifierController.class.st @@ -50,9 +50,9 @@ OPUmlClassifierController >> descriptionName [ | accessor | accessor := MAPluggableAccessor read: [ :me | me model name ] - write: [ :me :newValue | + write: [ :me :newValue | me model name: newValue. - self diagramElement modelChanged ]. + self modelChanged ]. ^ MAMemoDescription new accessor: accessor; label: 'Name'; diff --git a/repository/OpenPonk-ClassEditor/OPUmlClassifierItemController.class.st b/repository/OpenPonk-ClassEditor/OPUmlClassifierItemController.class.st index 737cb593..c363dfdc 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlClassifierItemController.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlClassifierItemController.class.st @@ -33,7 +33,7 @@ OPUmlClassifierItemController >> descriptionName [ | text | text := newValue trim ifEmpty: [ self placeholderName ]. me model name: text. - self diagramElement modelChanged ]. + self modelChanged ]. ^ description ] diff --git a/repository/OpenPonk-ClassEditor/OPUmlCompartmentableShape.class.st b/repository/OpenPonk-ClassEditor/OPUmlCompartmentableShape.class.st index e42c860d..edb0044d 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlCompartmentableShape.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlCompartmentableShape.class.st @@ -92,12 +92,11 @@ OPUmlCompartmentableShape >> layoutSeparators [ ] { #category : 'as yet unclassified' } -OPUmlCompartmentableShape >> ownedElement: aShape renderedIn: aCanvas [ +OPUmlCompartmentableShape >> recursivelyOwnedElement: aShape renderedIn: aCanvas [ - | wasRendered | - wasRendered := self isRenderedWithOwnedElements. - super ownedElement: aShape renderedIn: aCanvas. - wasRendered ifTrue: [ self updateRenderFromModel ] + super recursivelyOwnedElement: aShape renderedIn: aCanvas. + self isRenderedWithOwnedElements ifTrue: [ + self updateRenderFromModel ] ] { #category : 'removing' } diff --git a/repository/OpenPonk-ClassEditor/OPUmlPackageDiagramController.class.st b/repository/OpenPonk-ClassEditor/OPUmlPackageDiagramController.class.st index a6f15f7e..0d4bcff6 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlPackageDiagramController.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlPackageDiagramController.class.st @@ -136,7 +136,7 @@ OPUmlPackageDiagramController >> descriptionAppliedProfiles [ OPUMLProfileApplication new appliedProfile: each yourself ]). self rebuildPalette. - self diagramElement modelChanged ]); + self modelChanged ]); label: 'Applied Profiles'; priority: 10; beSorted; @@ -308,47 +308,47 @@ OPUmlPackageDiagramController >> initializePalette: aPalette [ OPUmlPackageDiagramController >> initializeProfile: aProfile palette: aPalette [ | stereotypes elements relationships isForRelationship isForClass | - stereotypes := (aProfile ownedStereotype reject: #isAbstract) + stereotypes := (aProfile ownedStereotype reject: #isAbstract) sorted: [ :a :b | a name < b name ]. - isForRelationship := [ :attr | + isForRelationship := [ :attr | (OPUMLXMISpecsStorage metaClassNamed: - attr type name) allParents anySatisfy: [ + attr type name) allParents anySatisfy: [ :parent | parent name = 'Relationship' ] ]. - isForClass := [ :attr | + isForClass := [ :attr | | metaclass | metaclass := OPUMLXMISpecsStorage metaClassNamed: attr type name. - metaclass name = 'Class' or: [ - metaclass allParents anySatisfy: [ :parent | + metaclass name = 'Class' or: [ + metaclass allParents anySatisfy: [ :parent | parent name = 'Class' ] ] ]. - elements := stereotypes select: [ :each | - each allAttributes anySatisfy: [ :attr | - (attr name beginsWith: 'base_') and: [ + elements := stereotypes select: [ :each | + each allAttributes anySatisfy: [ :attr | + (attr name beginsWith: 'base_') and: [ isForClass value: attr ] ] ]. - relationships := stereotypes select: [ :each | - each allAttributes anySatisfy: [ :attr | - (attr name beginsWith: 'base_') and: [ + relationships := stereotypes select: [ :each | + each allAttributes anySatisfy: [ :attr | + (attr name beginsWith: 'base_') and: [ isForRelationship value: attr ] ] ]. elements ifNotEmpty: [ aPalette newSeparator ]. - elements do: [ :stereotype | + elements do: [ :stereotype | (aPalette newCreationEntry: [ OPUmlClassController new ]) label: stereotype name; icon: OPUmlIcons classIcon; - whenCreated: [ :ctrl | + whenCreated: [ :ctrl | ctrl model applyStereotype: stereotype implementationClass new. ctrl model name: stereotype name. - ctrl diagramElement modelChanged. + ctrl modelChanged. OPInitialSetElementCommand executeOn: ctrl. - ctrl diagramElement modelChanged ] ]. + ctrl modelChanged ] ]. relationships ifNotEmpty: [ aPalette newSeparator ]. - relationships do: [ :stereotype | - (aPalette newConnectionCreationEntry: [ + relationships do: [ :stereotype | + (aPalette newConnectionCreationEntry: [ OPUmlAssociationController new ]) label: stereotype name; icon: OPUmlIcons directedAssociationIcon; - whenCreated: [ :ctrl | + whenCreated: [ :ctrl | ctrl model applyStereotype: stereotype implementationClass new. - ctrl diagramElement modelChanged ] ] + ctrl modelChanged ] ] ] { #category : 'palette' } diff --git a/repository/OpenPonk-ClassEditor/OPUmlPropertyMagritteDescriptions.class.st b/repository/OpenPonk-ClassEditor/OPUmlPropertyMagritteDescriptions.class.st index 51d72b5b..e6c1d810 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlPropertyMagritteDescriptions.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlPropertyMagritteDescriptions.class.st @@ -29,7 +29,7 @@ OPUmlPropertyMagritteDescriptions >> descriptionAccessor: aSymbol [ (reader value: me) perform: (aSymbol , ':') asSymbol with: newValue. - me ifNotNil: [ me diagramElement modelChanged ] ] + me ifNotNil: [ me modelChanged ] ] ] { #category : 'descriptions' } @@ -99,9 +99,9 @@ OPUmlPropertyMagritteDescriptions >> descriptionIsNavigable [ ^ MABooleanDescription new accessor: (MAPluggableAccessor read: [ :me | (reader value: me) isNavigable ] - write: [ :me :newValue | + write: [ :me :newValue | me writeNavigability: newValue to: (reader value: me). - me diagramElement modelChanged ]); + me modelChanged ]); label: 'Is Navigable'; priority: 10; yourself @@ -156,12 +156,12 @@ OPUmlPropertyMagritteDescriptions >> descriptionMultiplicity [ options: #( '0..1' '1..1' '0..*' '1..*' ); reference: MAStringDescription new; accessor: (MAPluggableAccessor - read: [ :me | + read: [ :me | (reader value: me) lowerBound asString , '..' , (reader value: me) upperBound asString ] - write: [ :me :newValue | + write: [ :me :newValue | me writeMultiplicityFrom: newValue to: (reader value: me). - me diagramElement modelChanged ]); + me modelChanged ]); label: 'Multiplicity'; priority: 9; beSorted; diff --git a/repository/OpenPonk-ClassEditor/OPUmlStereotypeDescriptions.class.st b/repository/OpenPonk-ClassEditor/OPUmlStereotypeDescriptions.class.st index 4ed2a0d9..84114d85 100644 --- a/repository/OpenPonk-ClassEditor/OPUmlStereotypeDescriptions.class.st +++ b/repository/OpenPonk-ClassEditor/OPUmlStereotypeDescriptions.class.st @@ -21,7 +21,7 @@ OPUmlStereotypeDescriptions >> accessorFor: anAttribute of: aStereotype [ aStereotype perform: (anAttribute name , ':') asSymbol with: newValue. - controller diagramElement modelChanged ] + controller modelChanged ] ] { #category : 'adding' }