Skip to content

Commit

Permalink
Add read-only flags to add and remove propositions
Browse files Browse the repository at this point in the history
  • Loading branch information
hellerve committed Nov 4, 2024
1 parent 581e79c commit 28e836e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 24 deletions.
32 changes: 20 additions & 12 deletions src/GToolkit-WardleyMap/GtWardleyMapAddProposition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ Class {
#instVars : [
'acceptAction',
'rejectAction',
'parent'
'parent',
'isReadOnly'
],
#category : #'GToolkit-WardleyMap-! Models - Decorators'
}

{ #category : #'as yet unclassified' }
GtWardleyMapAddProposition >> beReadOnly [
isReadOnly := true
]

{ #category : #'api - wardley map decorator model' }
GtWardleyMapAddProposition >> decorateEdgeElementInContext: anEdgeDecoratorContext [
| anEdgeViewModel aCanvasElement aFromNodeElement aToNodeElement aPropositionElement |
Expand All @@ -32,24 +38,26 @@ GtWardleyMapAddProposition >> decorateEdgeElementInContext: anEdgeDecoratorConte
relatedTo: aFromNodeElement).

aCanvasElement addChild: aPropositionElement.

acceptAction decorateEdgeElementInContext: anEdgeDecoratorContext.
rejectAction decorateEdgeElementInContext: anEdgeDecoratorContext

isReadOnly
ifFalse: [ acceptAction decorateEdgeElementInContext: anEdgeDecoratorContext.
rejectAction decorateEdgeElementInContext: anEdgeDecoratorContext ]
]

{ #category : #accessing }
GtWardleyMapAddProposition >> decorateNodeElementInContext: aNodeDecoratorContext [
| aHighlightElement |
aHighlightElement := GtWardleyMapNodePropositionElement new
beAddProposition;
wardleyMapNodeViewModel: aNodeDecoratorContext nodeViewModel;
wardleyMapDecoratorViewModel: aNodeDecoratorContext decoratorViewModel;
nodeElement: aNodeDecoratorContext nodeElement.
beAddProposition;
wardleyMapNodeViewModel: aNodeDecoratorContext nodeViewModel;
wardleyMapDecoratorViewModel: aNodeDecoratorContext decoratorViewModel;
nodeElement: aNodeDecoratorContext nodeElement.

aNodeDecoratorContext canvasElement addChild: aHighlightElement.

acceptAction decorateNodeElementInContext: aNodeDecoratorContext.
rejectAction decorateNodeElementInContext: aNodeDecoratorContext

isReadOnly
ifFalse: [ acceptAction decorateNodeElementInContext: aNodeDecoratorContext.
rejectAction decorateNodeElementInContext: aNodeDecoratorContext ]
]

{ #category : #initialization }
Expand Down
32 changes: 20 additions & 12 deletions src/GToolkit-WardleyMap/GtWardleyMapRemoveProposition.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ Class {
#instVars : [
'acceptAction',
'rejectAction',
'parent'
'parent',
'isReadOnly'
],
#category : #'GToolkit-WardleyMap-! Models - Decorators'
}

{ #category : #'as yet unclassified' }
GtWardleyMapRemoveProposition >> beReadOnly [
isReadOnly := true
]

{ #category : #'api - wardley map decorator model' }
GtWardleyMapRemoveProposition >> decorateEdgeElementInContext: anEdgeDecoratorContext [
| anEdgeViewModel aCanvasElement aFromNodeElement aToNodeElement aPropositionElement |
Expand All @@ -32,24 +38,26 @@ GtWardleyMapRemoveProposition >> decorateEdgeElementInContext: anEdgeDecoratorCo
relatedTo: aFromNodeElement).

aCanvasElement addChild: aPropositionElement.

acceptAction decorateEdgeElementInContext: anEdgeDecoratorContext.
rejectAction decorateEdgeElementInContext: anEdgeDecoratorContext

isReadOnly
ifFalse: [ acceptAction decorateEdgeElementInContext: anEdgeDecoratorContext.
rejectAction decorateEdgeElementInContext: anEdgeDecoratorContext ]
]

{ #category : #accessing }
GtWardleyMapRemoveProposition >> decorateNodeElementInContext: aNodeDecoratorContext [
| aHighlightElement |
aHighlightElement := GtWardleyMapNodePropositionElement new
beRemoveProposition;
wardleyMapNodeViewModel: aNodeDecoratorContext nodeViewModel;
wardleyMapDecoratorViewModel: aNodeDecoratorContext decoratorViewModel;
nodeElement: aNodeDecoratorContext nodeElement.
beRemoveProposition;
wardleyMapNodeViewModel: aNodeDecoratorContext nodeViewModel;
wardleyMapDecoratorViewModel: aNodeDecoratorContext decoratorViewModel;
nodeElement: aNodeDecoratorContext nodeElement.

aNodeDecoratorContext canvasElement addChild: aHighlightElement.

acceptAction decorateNodeElementInContext: aNodeDecoratorContext.
rejectAction decorateNodeElementInContext: aNodeDecoratorContext

isReadOnly
ifFalse: [ acceptAction decorateNodeElementInContext: aNodeDecoratorContext.
rejectAction decorateNodeElementInContext: aNodeDecoratorContext ]
]

{ #category : #initialization }
Expand Down

0 comments on commit 28e836e

Please sign in to comment.