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

moosetechnology / MooseIDE / 19644436433

24 Nov 2025 06:09PM UTC coverage: 65.854%. First build
19644436433

push

github

web-flow
Merge pull request #1534 from moosetechnology/issue-1482

fix: finding shapes in DSM from their model

0 of 5 new or added lines in 1 file covered. (0.0%)

21361 of 32437 relevant lines covered (65.85%)

1.32 hits per line

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

69.23
/src/MooseIDE-DSM/MiDSMVisualization.class.st
1
"
2
A visualization of a RSDSM inside a MooseIDE browser
3
"
4
Class {
5
        #name : 'MiDSMVisualization',
6
        #superclass : 'MiAbstractVisualization',
7
        #instVars : [
8
                'lastSCCShapes',
9
                'lastHighlighted',
10
                'lastUnhighlighted',
11
                'specModel'
12
        ],
13
        #category : 'MooseIDE-DSM',
14
        #package : 'MooseIDE-DSM'
15
}
16

17
{ #category : 'initialization' }
18
MiDSMVisualization >> buildInCanvas: aRSCanvas [
2✔
19
        | dsm |
2✔
20

2✔
21
        specModel orderedNodesX ifEmpty: [ ^self ].
2✔
22
        specModel orderedNodesY ifEmpty: [ ^self ].
2✔
23
        
2✔
24
        aRSCanvas addInteraction: RSCanvasController new.
2✔
25
        dsm := MiRSDSM new.
2✔
26
        dsm owner: self.
2✔
27
        dsm setShouldFeedX.
2✔
28
        dsm labelShapeX textBlock: [ :dependingNode | specModel displayValueForNode: dependingNode].
2✔
29
        dsm labelShapeY textBlock: [ :dependedNode | specModel displayValueForNode: dependedNode ].
2✔
30
        dsm container: aRSCanvas.
2✔
31
        dsm objectsX: specModel orderedNodesX.
2✔
32
        dsm objectsY: specModel orderedNodesY.
2✔
33
        dsm color: [ :tuple | self cellColor: tuple ].
2✔
34

2✔
35
        dsm build.
2✔
36

2✔
37
        self setInteractions: dsm.
2✔
38

2✔
39
]
2✔
40

41
{ #category : 'coloring' }
42
MiDSMVisualization >> cellColor: tuple [
2✔
43
        ^specModel colorForTuple: tuple
2✔
44
]
2✔
45

46
{ #category : 'coloring' }
47
MiDSMVisualization >> cellShowSCCColor: tuple [
×
48
        ^specModel showSCCColorForTuple: tuple
×
49
]
×
50

51
{ #category : 'private' }
NEW
52
MiDSMVisualization >> deepShapesFromModels: aCollection [
×
NEW
53

×
NEW
54
        ^currentCanvas privateShapes select: [ :c | c isComposite and: [ aCollection includes: c model ] ]
×
NEW
55
]
×
56

57
{ #category : 'accessing' }
58
MiDSMVisualization >> getTupleDependencyWeight: tuple [
2✔
59
        ^ specModel getTupleDependencyWeight: tuple
2✔
60
]
2✔
61

62
{ #category : 'initialization' }
63
MiDSMVisualization >> initialize [
2✔
64

2✔
65
        super initialize.
2✔
66

2✔
67
        "optimization cache"
2✔
68
        lastSCCShapes := nil -> #(  )
2✔
69
]
2✔
70

71
{ #category : 'accessing' }
72
MiDSMVisualization >> listTupleDependencies: tuple [
2✔
73
        ^ specModel listTupleDependencies: tuple
2✔
74
]
2✔
75

76
{ #category : 'private' }
77
MiDSMVisualization >> sccShapesIncluding: aRSShape [
×
78

×
79
        "Returns all shapes involved in the same cycle as aRSShape.
×
80
         lastSCCShapes is an optimization cache.
×
81
         if aRSShape is part of the lastSSCShapes, do nothing. Otherwise, get all shapes of the tuples involved in a cycle with aRSShape model."
×
82
        
×
83
        (lastSCCShapes key = aRSShape model key) ifFalse: [ 
×
84
                "Transcript show: ' - NOT found' ; cr."
×
NEW
85
                lastSCCShapes := aRSShape model key -> (self deepShapesFromModels:
×
86
                        (specModel sccTuplesForTuple: aRSShape model)) ]
×
87
                "ifTrue: [ Transcript show: ' - found' ; cr ]".
×
88
        ^ lastSCCShapes value
×
89
]
×
90

91
{ #category : 'initialization' }
92
MiDSMVisualization >> setInteractions: dsm [
2✔
93
        |   |
2✔
94
        dsm shapes @ (RSPopup text: [:tuple | specModel displayValueForTuple: tuple ]).
2✔
95

2✔
96
        "sccHighlight := RSHighlightable new.
2✔
97
        sccHighlight
2✔
98
                when: RSHighlightEvent do: [ :evt | evt shape color: (self cellHighlightColor: evt shape model) ].
2✔
99
        sccHighlight
2✔
100
                when: RSUnHighlightEvent do: [ :evt | evt shape color: (self cellColor: evt shape model) ].
2✔
101
        sccHighlight highlightShapes: [ :shape | self sccShapesIncluding: shape ].
2✔
102
        currentCanvas @ sccHighlight"
2✔
103
        
2✔
104
        "RSInspectableInteraction reset.
2✔
105
        inspect := RSInspectableInteraction new.
2✔
106
        ""highligtable := inspectable highlightable.
2✔
107
        highligtable highlightColor: Color green.""
2✔
108
        inspect inspectShapeBlock: [ :tuple | viewModel selected: tuple ].
2✔
109
        dsm shapes @ inspect"
2✔
110
]
2✔
111

112
{ #category : 'utilities' }
113
MiDSMVisualization >> shapeFor: tuple [
×
114
        currentCanvas deepShapeFromModel: tuple
×
115
]
×
116

117
{ #category : 'coloring' }
118
MiDSMVisualization >> showSCC: aCollection [
×
119
        aCollection do: [ :tuple |
×
120
                (self shapeFor: tuple) color: (specModel showSCCColorForTuple: tuple)
×
121
        ]
×
122
]
×
123

124
{ #category : 'accessing' }
125
MiDSMVisualization >> specModel [
2✔
126
        ^ specModel
2✔
127
]
2✔
128

129
{ #category : 'accessing' }
130
MiDSMVisualization >> specModel: aDSMModel [
2✔
131
        specModel := aDSMModel
2✔
132
]
2✔
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