• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / MooseIDE / 22846894311

09 Mar 2026 09:28AM UTC coverage: 65.926% (+0.1%) from 65.785%
22846894311

push

github

web-flow
Merge pull request #1527 from moosetechnology/cousage-refactor

Cousage refactor

80 of 100 new or added lines in 5 files covered. (80.0%)

24 existing lines in 2 files now uncovered.

21848 of 33140 relevant lines covered (65.93%)

1.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

57.46
/src/MooseIDE-CoUsageMap/MiCoUsageMapVisualization.class.st
1
"
2
I use the MiCoUsageMapBuilder like a bridge for the browser
3
"
4
Class {
5
        #name : 'MiCoUsageMapVisualization',
6
        #superclass : 'MiAbstractVisualization',
7
        #instVars : [
8
                'specModel',
9
                'mapBuilder'
10
        ],
11
        #category : 'MooseIDE-CoUsageMap-Browser',
12
        #package : 'MooseIDE-CoUsageMap',
13
        #tag : 'Browser'
14
}
15

16
{ #category : 'running' }
17
MiCoUsageMapVisualization >> buildInCanvas: aCanvas [
2✔
18

2✔
19
        specModel currentMooseModel ifNil: [ ^ self ].
2✔
20

2✔
21
        aCanvas @ RSCanvasController new noLegend.
2✔
22

2✔
23
        mapBuilder
2✔
24
                container: aCanvas;
2✔
25
                build.
2✔
26

2✔
27
        ^ aCanvas
2✔
28
]
2✔
29

30
{ #category : 'brokerage' }
31
MiCoUsageMapVisualization >> consume: anItem [
2✔
32
        anItem isTag
2✔
33
                ifTrue: [ self consumeTag: anItem ]
2✔
34
                ifFalse: [ self consumeTagAssociation: anItem ]
2✔
35
]
2✔
36

37
{ #category : 'brokerage' }
38
MiCoUsageMapVisualization >> consumeTag: aTag [
2✔
39

2✔
40
        mapBuilder updateLegend
2✔
41
]
2✔
42

43
{ #category : 'brokerage' }
44
MiCoUsageMapVisualization >> consumeTagAssociation: aFamixTagAssociation [
2✔
45
        "search the box for the tagged entity with the right tag
2✔
46
         - if found nothing to do
2✔
47
         - else update the visualization"
2✔
48

2✔
49
        | entity tag |
2✔
50
        entity := aFamixTagAssociation entity.
2✔
51
        tag := aFamixTagAssociation tag.
2✔
52

2✔
53
        ((specModel containerBoxes , specModel innerBoxes) 
2✔
54
                anySatisfy: [ :each | (each mooseEntity = entity) and: [ each tag = tag ] ])
2✔
55
                ifTrue: [ ^ self ].
2✔
56

2✔
57
        mapBuilder updateShapeColors
2✔
58
]
2✔
59

60
{ #category : 'initialization' }
61
MiCoUsageMapVisualization >> initialize [
2✔
62

2✔
63
        super initialize.
2✔
64

2✔
65
        mapBuilder := MiCoUsageMapBuilder on: specModel
2✔
66
]
2✔
67

68
{ #category : 'brokerage' }
69
MiCoUsageMapVisualization >> itemsFor: aClass [
×
70
        | model |
×
71
        model := self owner containerEntities mooseModel.
×
72
        
×
73
        aClass = FamixTagAssociation ifTrue: [ ^ model allTagAssociations ].
×
74
        aClass = FamixTag ifTrue: [ ^ model allTags ].
×
75
        ^ #(  )
×
76
]
×
77

78
{ #category : 'private - testing' }
79
MiCoUsageMapVisualization >> mapBuilder [
2✔
80
        ^mapBuilder 
2✔
81
]
2✔
82

83
{ #category : 'accessing' }
84
MiCoUsageMapVisualization >> modelForShape: aShape [
2✔
85

2✔
86
        ^ aShape model mooseEntity
2✔
87
]
2✔
88

89
{ #category : 'brokerage' }
90
MiCoUsageMapVisualization >> remove: anObject [
2✔
91
        anObject class = FamixTag
2✔
92
                ifTrue: [ self removeTag: anObject ]
2✔
93
                ifFalse: [ self removeTagAssociation: anObject ].
2✔
94
        
2✔
95
]
2✔
96

97
{ #category : 'brokerage' }
98
MiCoUsageMapVisualization >> removeTag: aTag [
×
NEW
99

×
100
        | canvas legendTag |
×
101
        canvas := mapBuilder canvas.
×
102
        legendTag := mapBuilder legendTagBuilder.
×
NEW
103

×
104
        "updating legend"
×
NEW
105
        self tagsFromMooseModel: specModel currentMooseModel.
×
106
        legendTag build.
×
NEW
107

×
108
        mapBuilder menuManager removeTag: aTag.
×
NEW
109
        canvas signalUpdate
×
110
]
×
111

112
{ #category : 'brokerage' }
113
MiCoUsageMapVisualization >> removeTagAssociation: aFamixTagAssociation [
2✔
114

2✔
115
        | entity miCoObject |
2✔
116
        entity := aFamixTagAssociation entity.
2✔
117

2✔
118
        miCoObject := specModel containerBoxes , specModel innerBoxes 
2✔
119
                detect: [ :each | each mooseEntity = entity ]
2✔
120
                ifNone: [ ^ self ].
2✔
121

2✔
122
        mapBuilder updateShapeColors
2✔
123
]
2✔
124

125
{ #category : 'accessing' }
UNCOV
126
MiCoUsageMapVisualization >> selectedInnerEntity [
×
UNCOV
127
        ^specModel selectedEntity
×
UNCOV
128
]
×
129

130
{ #category : 'accessing' }
UNCOV
131
MiCoUsageMapVisualization >> selectedInnerEntity: aMooseEntity [
×
UNCOV
132
        specModel selectedEntity: aMooseEntity
×
UNCOV
133
]
×
134

135
{ #category : 'accessing' }
136
MiCoUsageMapVisualization >> selectedTag [
2✔
137
        ^specModel selectedTag
2✔
138
]
2✔
139

140
{ #category : 'accessing' }
141
MiCoUsageMapVisualization >> selectedTag: aTag [
×
142
        specModel selectedTag: aTag
×
143
]
×
144

145
{ #category : 'accessing - model' }
146
MiCoUsageMapVisualization >> setModelBeforeInitialization: aSpecModel [
2✔
147

2✔
148
        specModel := aSpecModel
2✔
149
]
2✔
150

151
{ #category : 'accessing' }
NEW
152
MiCoUsageMapVisualization >> settings [
×
UNCOV
153

×
NEW
154
        ^ specModel settings
×
UNCOV
155
]
×
156

157
{ #category : 'brokerage' }
158
MiCoUsageMapVisualization >> tagsFromMooseModel: aMooseModel [
×
NEW
159

×
NEW
160
        | legendBuilder |
×
NEW
161
        aMooseModel ifNil: [ ^ self ].
×
NEW
162

×
NEW
163
        legendBuilder := mapBuilder legendTagBuilder.
×
NEW
164
        legendBuilder removeOldLegend.
×
NEW
165

×
NEW
166
        (aMooseModel allTags sorted: #name ascending) do: [ :tag |
×
NEW
167
                legendBuilder addTag: tag asMiCoTag ]
×
UNCOV
168
]
×
169

170
{ #category : 'updating' }
171
MiCoUsageMapVisualization >> update: anObject [
×
172
        self consume: anObject
×
173
]
×
174

175
{ #category : 'update' }
176
MiCoUsageMapVisualization >> updateBoxColor: aMiCoBox fromTags: tags [
2✔
177

2✔
178
        mapBuilder updateBoxColor: aMiCoBox fromTags: tags
2✔
179
]
2✔
180

181
{ #category : 'update' }
182
MiCoUsageMapVisualization >> updateChildren [
×
183
        mapBuilder updateChildren
×
184
]
×
185

186
{ #category : 'update' }
187
MiCoUsageMapVisualization >> updateInnerBoxSize [
×
188
        mapBuilder updateInnerBoxSize
×
189
]
×
190

191
{ #category : 'update' }
UNCOV
192
MiCoUsageMapVisualization >> updateShapeLayout [
×
193
        mapBuilder updateShapeLayout
×
194
]
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc