Skip to content

Commit deaba54

Browse files
sync class attribute and association end, enlarge class for contents properly
1 parent 117966b commit deaba54

14 files changed

+90
-57
lines changed

repository/OpenPonk-ClassEditor/OPTUmlAutoAccomodatingShape.trait.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ OPTUmlAutoAccomodatingShape >> accomodateContents [
1313
encompassingRectangle.
1414
extentOfContents := self extentToFitContents max: self minExtent.
1515
self roassalShape extent: extentOfContents.
16-
(originalEncompassingRectangle height closeTo: extentOfContents y)
16+
(originalEncompassingRectangle height closeTo: extentOfContents y)
1717
ifTrue: [ ^ self ].
1818
self roassalShape translateTo: self roassalShape position x
1919
@

repository/OpenPonk-ClassEditor/OPTUmlBaseController.trait.st

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ OPTUmlBaseController >> descriptionAccessor: aSymbol [
1212
read: [ :me | me model perform: aSymbol ]
1313
write: [ :me :newValue |
1414
me model perform: (aSymbol , ':') asSymbol with: newValue.
15-
self diagramElement modelChanged ]
15+
self modelChanged ]
1616
]
1717

1818
{ #category : 'forms' }
@@ -22,18 +22,18 @@ OPTUmlBaseController >> descriptionComment [
2222
^ MAMemoDescription new
2323
required: false;
2424
accessor: (MAPluggableAccessor
25-
read: [ :me |
25+
read: [ :me |
2626
me model ownedComments
2727
ifEmpty: [ '' ]
2828
ifNotEmpty: [ :oc | oc first body asString ] ]
29-
write: [ :me :newValue |
29+
write: [ :me :newValue |
3030
newValue asString
3131
ifEmpty: [ me model ownedComments: OrderedCollection new ]
32-
ifNotEmpty: [
33-
me model ownedComments ifEmpty: [
32+
ifNotEmpty: [
33+
me model ownedComments ifEmpty: [
3434
me model ownedComments add: OPUMLComment new ].
3535
me model ownedComments first body: newValue asString ].
36-
self diagramElement modelChanged ]);
36+
self modelChanged ]);
3737
label: 'Comment';
3838
priority: 100;
3939
lineCount: 10;
@@ -66,7 +66,7 @@ OPTUmlBaseController >> descriptionVisibility [
6666

6767
<magritteDescription>
6868
^ MASingleOptionDescription new
69-
optionsAndLabels: {
69+
optionsAndLabels: {
7070
(nil -> '').
7171
(OPUMLVisibilityKind public -> 'public').
7272
(OPUMLVisibilityKind protected -> 'protected').
@@ -75,9 +75,9 @@ OPTUmlBaseController >> descriptionVisibility [
7575
reference: MAStringDescription new;
7676
accessor: (MAPluggableAccessor
7777
read: [ :me | me model visibility ]
78-
write: [ :me :newValue |
78+
write: [ :me :newValue |
7979
me model visibility: newValue.
80-
self diagramElement modelChanged ]);
80+
self modelChanged ]);
8181
label: 'Visibility';
8282
priority: 8;
8383
beSorted;

repository/OpenPonk-ClassEditor/OPTUmlStereotypedElementController.trait.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ OPTUmlStereotypedElementController >> descriptionStereotypeContent [
4444
applyStereotype:
4545
(stereotypes detect: [ :each | each name = newValue ])
4646
to: me model ].
47-
me diagramElement modelChanged ]);
47+
me modelChanged ]);
4848
label: 'Stereotype';
4949
priority: 4;
5050
yourself

repository/OpenPonk-ClassEditor/OPUmlAbstractAssociationController.class.st

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,30 @@ Class {
66
#tag : 'Controllers'
77
}
88

9+
{ #category : 'announcements' }
10+
OPUmlAbstractAssociationController >> classAttributeChanged [
11+
12+
super modelChanged
13+
]
14+
915
{ #category : 'accessing' }
1016
OPUmlAbstractAssociationController >> elementsToShowInside [
1117

1218
^ super elementsToShowInside , self model memberEnds
1319
]
1420

21+
{ #category : 'announcements' }
22+
OPUmlAbstractAssociationController >> modelChanged [
23+
24+
super modelChanged.
25+
self model memberEnds
26+
select: [ :each | each owningClass isNotNil ]
27+
thenDo: [ :each |
28+
self diagramController
29+
controllerForModel: each
30+
ifFound: [ :controller | controller associationChanged ] ]
31+
]
32+
1533
{ #category : 'accessing' }
1634
OPUmlAbstractAssociationController >> modelSource [
1735

repository/OpenPonk-ClassEditor/OPUmlAssociationController.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ OPUmlAssociationController >> descriptionActionSwitchSourceTarget [
2222
self canSwitchSourceAndTarget ifFalse: [ ^ self ].
2323
description := OPMAActionDescription new.
2424
description
25-
action: [
25+
action: [
2626
self switchSourceAndTarget.
2727
self diagramController editor openFormOn: self.
28-
self diagramElement modelChanged ];
28+
self modelChanged ];
2929
label: 'Switch source/target';
3030
priority: 9.05.
3131
^ description

repository/OpenPonk-ClassEditor/OPUmlAttributeController.class.st

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ OPUmlAttributeController >> addDiagramElementToOwner [
1515
self ownerDiagramElement addAttribute: self diagramElement
1616
]
1717

18+
{ #category : 'announcements' }
19+
OPUmlAttributeController >> associationChanged [
20+
21+
super modelChanged
22+
]
23+
1824
{ #category : 'figures' }
1925
OPUmlAttributeController >> createDiagramElement [
2026

@@ -63,7 +69,7 @@ OPUmlAttributeController >> descriptionDefaultValue [
6369
ifTrue: [
6470
me model defaultValue bodies:
6571
(newValue ifEmpty: [ { } ] ifNotEmpty: [ { newValue } ]) ].
66-
self diagramElement modelChanged ]);
72+
self modelChanged ]);
6773
label: 'Default Value';
6874
priority: 42;
6975
yourself
@@ -118,12 +124,12 @@ OPUmlAttributeController >> descriptionMultiplicity [
118124
options: #( '0..1' '1..1' '0..*' '1..*' );
119125
reference: MAStringDescription new;
120126
accessor: (MAPluggableAccessor
121-
read: [ :me |
127+
read: [ :me |
122128
me model lowerBound asString , '..'
123129
, me model upperBound asString ]
124-
write: [ :me :newValue |
130+
write: [ :me :newValue |
125131
self writeMultiplicityFrom: newValue to: me model.
126-
self diagramElement modelChanged ]);
132+
self modelChanged ]);
127133
label: 'Multiplicity';
128134
priority: 9;
129135
beSorted;
@@ -137,11 +143,11 @@ OPUmlAttributeController >> descriptionType [
137143
^ MAStringDescription new
138144
accessor: (MAPluggableAccessor
139145
read: [ :me | me model type ifNil: [ '' ] ifNotNil: #name ]
140-
write: [ :me :newValue |
146+
write: [ :me :newValue |
141147
newValue
142148
ifEmpty: [ me model type: nil ]
143149
ifNotEmpty: [ me model type: (self typeNamed: newValue) ].
144-
self diagramElement modelChanged ]);
150+
self modelChanged ]);
145151
label: 'Type';
146152
priority: 5;
147153
yourself
@@ -153,6 +159,16 @@ OPUmlAttributeController >> diagramElementClass [
153159
^ OPUmlAttributeLabel
154160
]
155161

162+
{ #category : 'announcements' }
163+
OPUmlAttributeController >> modelChanged [
164+
165+
super modelChanged.
166+
self model association ifNotNil: [ :association |
167+
self diagramController
168+
controllerForModel: association
169+
ifFound: [ :controller | controller classAttributeChanged ] ]
170+
]
171+
156172
{ #category : 'accessing' }
157173
OPUmlAttributeController >> modelClass [
158174
^ OPUMLProperty

repository/OpenPonk-ClassEditor/OPUmlClassController.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ OPUmlClassController >> createAttributeAdornmentBy: builder [
5959
self diagramController editor palette selectTool: tool.
6060
tool whenCreated: [ :ctrl |
6161
OPRenameElementCommand executeOn: ctrl.
62-
ctrl diagramElement modelChanged ].
62+
ctrl modelChanged ].
6363
tool selectedControllers: { self } ]
6464
]
6565

repository/OpenPonk-ClassEditor/OPUmlClassShape.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ OPUmlClassShape >> addAttribute: anAttributeShape [
3535
{ #category : 'rendering' }
3636
OPUmlClassShape >> addOperation: anOperationShape [
3737

38-
operations ifNil: [
38+
operations ifNil: [
3939
operations := OPUmlFeaturesListCompartment in: self.
4040

4141
self sortOwnedElements ].

repository/OpenPonk-ClassEditor/OPUmlClassifierController.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ OPUmlClassifierController >> descriptionName [
5050
| accessor |
5151
accessor := MAPluggableAccessor
5252
read: [ :me | me model name ]
53-
write: [ :me :newValue |
53+
write: [ :me :newValue |
5454
me model name: newValue.
55-
self diagramElement modelChanged ].
55+
self modelChanged ].
5656
^ MAMemoDescription new
5757
accessor: accessor;
5858
label: 'Name';

repository/OpenPonk-ClassEditor/OPUmlClassifierItemController.class.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ OPUmlClassifierItemController >> descriptionName [
3333
| text |
3434
text := newValue trim ifEmpty: [ self placeholderName ].
3535
me model name: text.
36-
self diagramElement modelChanged ].
36+
self modelChanged ].
3737
^ description
3838
]
3939

0 commit comments

Comments
 (0)