Skip to content

Commit

Permalink
Merge pull request #168 from TelescopeSt/development
Browse files Browse the repository at this point in the history
v2.3.0
  • Loading branch information
jecisc authored Dec 7, 2020
2 parents 9dc050b + 00c290e commit e18dca7
Show file tree
Hide file tree
Showing 15 changed files with 453 additions and 29 deletions.
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
<!--
git log --pretty="*%s ([%h](https://github.com/TelescopeSt/Telescope/commit/%H))" v2.2.2...HEAD --grep="Merge pull"
git log --pretty="*%s ([%h](https://github.com/TelescopeSt/Telescope/commit/%H))" v2.3.0...HEAD --grep="Merge pull"
('Content' copyWithRegex: 'Merge pull request #[0-9]+ from [^/]+/[0-9]*' matchesReplacedWith: '') copyReplaceAll: '-' with: ' '
-->

# [v2.3.0](https://github.com/TelescopeSt/Telescope/compare/v2.2.3...v2.3.0) (2020-12-07)

## New Features

* Add an action to create connections with entity ([abc4ff1](https://github.com/TelescopeSt/Telescope/commit/abc4ff1ac8bfa3871fa116c78d1f3f428c6c191d))
* Create a matrix visualization template ([86243ea](https://github.com/TelescopeSt/Telescope/commit/86243ea51a0119d5a3133ecaf79d833dfade7913))

## Enhancement

* Add modularity in cycle dependecies visualization template ([8b48cfc](https://github.com/TelescopeSt/Telescope/commit/8b48cfc31edd73770ea19ee0b7f7c530479d7e56))

## Bug fixes

* Groups are not correctly removed from supergroups ([45ba104](https://github.com/TelescopeSt/Telescope/commit/45ba104aca254c088730e8f58e2b8866b3909461))

## Infrastructure

* Depend on PharoBackwardCompatibility ([7bfd884](https://github.com/TelescopeSt/Telescope/commit/7bfd884fe6bc7655d275188a86133b4811dfb793))

# [v2.2.3](https://github.com/TelescopeSt/Telescope/compare/v2.2.2...v2.2.3) (2020-06-03)

## Enhancement
Expand Down
16 changes: 8 additions & 8 deletions src/BaselineOfTelescope/BaselineOfTelescope.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ BaselineOfTelescope >> baseline: spec [
deepTraverser: spec;
mocketry: spec;
mooseAlgo: spec;
pharoBackwardCompatibility: spec;
styleSheet: spec;
materialColors: spec.

"Packages"
spec
package: 'Telescope-Core' with: [ spec requires: #('Stylesheet' 'Telescope-Layouts' 'MaterialColors') ];
package: 'Telescope-Core' with: [ spec requires: #('Stylesheet' 'Telescope-Layouts' 'MaterialColors' 'PharoBackwardCompatibility') ];
package: 'Telescope-VisualizationTemplates' with: [ spec requires: #('Telescope-Core' 'MooseAlgos' 'DeepTraverser') ];
package: 'Telescope-Demo' with: [ spec requires: #('Telescope-Core' 'Telescope-VisualizationTemplates') ];
package: 'Telescope-Layouts';
Expand All @@ -39,13 +40,7 @@ BaselineOfTelescope >> baseline: spec [
group: 'layout' with: #('Telescope-Layouts' 'Telescope-Layouts-Tests');
group: 'layout-core' with: #('Telescope-Layouts');
group: 'minimal' with: #('Telescope-Core');
group: 'tests' with: #('Telescope-Core-Tests' 'Telescope-Layouts-Tests' 'Telescope-VisualizationTemplates-Tests') ].

spec
for: #(#'pharo6.x' #'pharo7.x')
do: [ spec
package: 'Telescope-Pharo8-Compatibility';
package: 'Telescope-Core' with: [ spec requires: #('Telescope-Pharo8-Compatibility') ] ]
group: 'tests' with: #('Telescope-Core-Tests' 'Telescope-Layouts-Tests' 'Telescope-VisualizationTemplates-Tests') ]
]

{ #category : #dependencies }
Expand Down Expand Up @@ -80,6 +75,11 @@ BaselineOfTelescope >> mooseAlgo: spec [
repository: 'github://moosetechnology/MooseAlgos:v1.x.x/src' ]
]

{ #category : #dependencies }
BaselineOfTelescope >> pharoBackwardCompatibility: spec [
spec baseline: 'PharoBackwardCompatibility' with: [ spec repository: 'github://jecisc/PharoBackwardCompatibility:v1.x.x/src' ]
]

{ #category : #accessing }
BaselineOfTelescope >> projectClass [
^ [ self class environment at: #MetacelloCypressBaselineProject ]
Expand Down
36 changes: 36 additions & 0 deletions src/Telescope-Core-Tests/TLConnectActionTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Class {
#name : #TLConnectActionTest,
#superclass : #TestCase,
#category : #'Telescope-Core-Tests-Actions'
}

{ #category : #tests }
TLConnectActionTest >> testTriggerAction [
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectAction
property: [ :e | {e sqrt} ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections size equals: 1.
self assert: targetNode incomingConnections size equals: 1.
self
assert: sourceNode outgoingConnections anyOne
equals: targetNode incomingConnections anyOne
]

{ #category : #tests }
TLConnectActionTest >> testTriggerActionTwiceForReversibility [
"this test is valid only if testTriggerAction is valid"
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectAction
property: [ :e | {e sqrt} ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections isEmpty.
self assert: targetNode incomingConnections isEmpty
]
38 changes: 38 additions & 0 deletions src/Telescope-Core-Tests/TLConnectWithEntityActionTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Class {
#name : #TLConnectWithEntityActionTest,
#superclass : #TestCase,
#category : #'Telescope-Core-Tests-Actions'
}

{ #category : #tests }
TLConnectWithEntityActionTest >> testTriggerAction [
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectWithEntityAction
connectionProperty: [ :e | {e squared} ]
property: [ :connectionEntity | connectionEntity / 8 ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections size equals: 1.
self assert: targetNode incomingConnections size equals: 1.
self
assert: sourceNode outgoingConnections anyOne
equals: targetNode incomingConnections anyOne
]

{ #category : #tests }
TLConnectWithEntityActionTest >> testTriggerActionTwiceForReversibility [
"this test is valid only if testTriggerAction is valid"
| connectAction sourceNode targetNode |
sourceNode := TLSimpleNode withEntity: 4.
targetNode := TLSimpleNode withEntity: 2.
connectAction := TLConnectWithEntityAction
connectionProperty: [ :e | {e squared} ]
property: [ :connectionEntity | connectionEntity / 8 ]
context: (TLDrawableCollection with: sourceNode with: targetNode).
connectAction actionOn: sourceNode.
connectAction actionOn: sourceNode.
self assert: sourceNode outgoingConnections isEmpty.
self assert: targetNode incomingConnections isEmpty
]
83 changes: 83 additions & 0 deletions src/Telescope-Core-Tests/TLConnectionsWithEntityTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
Class {
#name : #TLConnectionsWithEntityTest,
#superclass : #TestCase,
#instVars : [
'group'
],
#category : #'Telescope-Core-Tests-Model'
}

{ #category : #running }
TLConnectionsWithEntityTest >> setUp [
super setUp.
group := TLEntitiesGroup new.
TLVisualization new addDrawable: group.
group addNodesFromEntities: (1 to: 4)
]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectGroupFromANode [
| connections |
connections := group connectFrom: TLSimpleNode new entity: 42.
self assert: connections size equals: 4.

]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectGroupToANode [
| connections |
connections := group connectTo: TLSimpleNode new entity: 42.
self assert: connections size equals: 4
]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectGroupWithSubgroupFromANode [
| connections |
group > #subgroup addNodesFromEntities: (5 to: 8).
connections := group connectFrom: TLSimpleNode new entity: 42..
self assert: connections size equals: 8.
]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectGroupWithSubgroupToANode [
| connections |
group > #subgroup addNodesFromEntities: (5 to: 8).
connections := group connectTo: TLSimpleNode new entity: 42..
self assert: connections size equals: 8.
]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectNodeFromAGroup [
| connections |
connections := TLSimpleNode new connectFrom: group entity: 42..
self assert: connections size equals: 4.
]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectNodeFromAnotherNode [
| connection nodeA nodeB |
nodeA := TLSimpleNode withEntity: $a.
nodeB := TLSimpleNode withEntity: $b.
connection := nodeB connectFrom: nodeA entity: 42.
self assert: connection fromNode equals: nodeA.
self assert: connection toNode equals: nodeB.

]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectNodeToAGroup [
| connections |
connections := TLSimpleNode new connectTo: group entity: 42.
self assert: connections size equals: 4.
]

{ #category : #tests }
TLConnectionsWithEntityTest >> testConnectNodeToAnotherNode [
| connection nodeA nodeB |
nodeA := TLSimpleNode withEntity: $a.
nodeB := TLSimpleNode withEntity: $b.
connection := nodeA connectTo: nodeB entity: 42.
self assert: connection fromNode equals: nodeA.
self assert: connection toNode equals: nodeB.

]
15 changes: 15 additions & 0 deletions src/Telescope-Core-Tests/TLModelTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,18 @@ TLModelTest >> testRemoveAllFromGroup [
self assert: node2 parent equals: nil.

]

{ #category : #tests }
TLModelTest >> testRemoveAllThenAddAgainGroup [
| group subGroup secondSubGroup |
group := TLEntitiesGroup new.
subGroup := group > #group1.
self assert: subGroup parent equals: group.
group removeAll.
self assert: subGroup parent equals: nil.
self assert: group isEmpty.
self assert: group subGroupsDictionary isEmpty.
secondSubGroup := group > #group1.
self assert: secondSubGroup parent equals: group.
self deny: secondSubGroup equals: subGroup
]
7 changes: 6 additions & 1 deletion src/Telescope-Core/TLAbstractNode.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ TLAbstractNode >> connectFromNode: aTLNode [
^ aTLNode connectToNode: self
]

{ #category : #connection }
TLAbstractNode >> connectFromNode: aTLNode entity: anObject [
^ aTLNode connectToNode: self entity: anObject
]

{ #category : #connect }
TLAbstractNode >> connectIfNotAlreadyFollowingProperty: aBlockOrSymbol context: aTLEntitiesGroup [
| target |
Expand Down Expand Up @@ -145,7 +150,7 @@ TLAbstractNode >> connectTo: aTLConnectable [

{ #category : #connect }
TLAbstractNode >> connectTo: aTLConnectable entity: anObject [
^ aTLConnectable connectToNode: self entity: anObject
^ aTLConnectable connectFromNode: self entity: anObject
]

{ #category : #connect }
Expand Down
68 changes: 68 additions & 0 deletions src/Telescope-Core/TLConnectWithEntityAction.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
"
TLConnectionectAction is an action that create TLConnectionWithEntity from the receiver to an other node
"
Class {
#name : #TLConnectWithEntityAction,
#superclass : #TLConnectAction,
#instVars : [
'connectionProperty'
],
#category : #'Telescope-Core-Actions'
}

{ #category : #'as yet unclassified' }
TLConnectWithEntityAction class >> connectionProperty: aConnectionBlockOrProperty property: aBlockOrProperty [
^ self new
connectionProperty: aConnectionBlockOrProperty;
property: aBlockOrProperty;
yourself
]

{ #category : #'as yet unclassified' }
TLConnectWithEntityAction class >> connectionProperty: aConnectionBlockOrProperty property: aBlockOrProperty context: aTLGroup [
^ (self
connectionProperty: aConnectionBlockOrProperty
property: aBlockOrProperty)
context: aTLGroup;
yourself
]

{ #category : #accessing }
TLConnectWithEntityAction >> connectionProperty [
^ connectionProperty
]

{ #category : #accessing }
TLConnectWithEntityAction >> connectionProperty: anObject [
connectionProperty := anObject
]

{ #category : #action }
TLConnectWithEntityAction >> regularActionOn: aNode [
| connectionEntities contextNodesByEntities |
connectionEntities := self
obtain: self connectionProperty
on: aNode entity.
contextNodesByEntities := (self obtainContextFor: aNode)
groupedBy: #entity.
self connectionsByNode
at: aNode
put:
((self obtain: self connectToOrigin on: aNode entity)
ifFalse: [ connectionEntities
collect: [ :aConnectionEntity |
aNode
connectTo:
(contextNodesByEntities
at: (self obtain: self property on: aConnectionEntity))
entity: aConnectionEntity ] ]
ifTrue: [ connectionEntities
collect: [ :aConnectionEntity |
(contextNodesByEntities
at: (self obtain: self property on: aConnectionEntity))
connectTo: aNode
entity: aConnectionEntity ] ]).
self connectionStyle
ifNotNil: [ (self connectionsByNode at: aNode)
do: [ :c | c addStyle: self connectionStyle ] ]
]
12 changes: 12 additions & 0 deletions src/Telescope-Core/TLDrawableCollection.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ TLDrawableCollection >> collection [
^ self
]

{ #category : #connection }
TLDrawableCollection >> connectToNode: aNode entity: aConnectionEntity [
^ self
collect:
[ :aDrawable | aDrawable connectToNode: aNode entity: aConnectionEntity ]
]

{ #category : #enumerating }
TLDrawableCollection >> nodesCollect: aBlock [
^ self
Expand All @@ -68,3 +75,8 @@ TLDrawableCollection >> removeAllConnections [
TLDrawableCollection >> removeStyle: aStyle [
self do: [ :aDrawable | aDrawable removeStyle: aStyle ]
]

{ #category : #removing }
TLDrawableCollection >> removed [
self do: #removed
]
15 changes: 14 additions & 1 deletion src/Telescope-Core/TLEntitiesGroup.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ TLEntitiesGroup >> > aSubGroupSymbol [
yourself ]
]

{ #category : #enumeration }
TLEntitiesGroup >> \ aCollection [
^ self telescopeEntities \ aCollection
]

{ #category : #adding }
TLEntitiesGroup >> addAbsentNodesInVisualizationFromEntities: aGroupOfEntities [
"only add nodes for entities that are not yet in visualization"
Expand Down Expand Up @@ -281,6 +286,11 @@ TLEntitiesGroup >> notEmpty [
^ self collection notEmpty.
]

{ #category : #enumeration }
TLEntitiesGroup >> reject: aBlockClosure [
^ self telescopeEntities reject: aBlockClosure
]

{ #category : #accessing }
TLEntitiesGroup >> remove: aTLDrawable [
self removeChild: aTLDrawable.
Expand All @@ -295,7 +305,10 @@ TLEntitiesGroup >> removeAll [
{ #category : #removing }
TLEntitiesGroup >> removeChild: aTLDrawable [
self telescopeEntities remove: aTLDrawable.
self requireUpdateAndLayoutApplication.
aTLDrawable isGroup
ifTrue: [ self subGroupsDictionary
removeKey: (self subGroupsDictionary keyAtValue: aTLDrawable) ].
self requireUpdateAndLayoutApplication
]

{ #category : #accessing }
Expand Down
Loading

0 comments on commit e18dca7

Please sign in to comment.