Skip to content
Permalink
Browse files

Last weeks I have invested time in Hiedra (source at: https://github.…

…com/tinchodias/hiedra), that is already in Pharo since 6.0 but needed some extra love.

* Adds support for FastTable, and it's optimized for it (keeps support for Spec's TreePresenter).
* Better tests: more coverage and more understandable.
* Added examples of use.
* Improved comments in methods and classes.
* More understandable code.

API changed so this commit includes the upgrade of the only user: Epicea.
  • Loading branch information
tinchodias committed Mar 20, 2019
1 parent 1e24b80 commit 85bf85d99d71683b92668baf7a50ccf0afb3657f
Showing with 25,917 additions and 1,418 deletions.
  1. +24 −18 src/EpiceaBrowsers/EpLogNodeGraphPresenter.class.st
  2. +0 −197 src/Hiedra-Tests/HiNodesAndLinksIteratorWithOneLinkModelTest.class.st
  3. +0 −81 src/Hiedra-Tests/HiNodesAndLinksIteratorWithTwoLinkModelsTest.class.st
  4. +477 −0 src/Hiedra-Tests/HiRulerBuilderTest.class.st
  5. +74 −0 src/Hiedra-Tests/HiRulerTest.class.st
  6. +0 −74 src/Hiedra-Tests/HiTestNode.class.st
  7. +104 −0 src/Hiedra/HiAbstractRenderer.class.st
  8. +0 −8 src/Hiedra/HiBuilder.class.st
  9. +170 −0 src/Hiedra/HiColumnController.class.st
  10. +0 −26 src/Hiedra/HiDirectLinkRenderer.class.st
  11. +24,177 −0 src/Hiedra/HiExampleCommit.class.st
  12. +92 −0 src/Hiedra/HiFastTableExample.class.st
  13. +18 −56 src/Hiedra/HiLink.class.st
  14. +0 −137 src/Hiedra/HiLinkBuilder.class.st
  15. +0 −76 src/Hiedra/HiLinkRenderer.class.st
  16. +47 −50 src/Hiedra/HiNode.class.st
  17. +0 −52 src/Hiedra/HiNodeBuilder.class.st
  18. +0 −70 src/Hiedra/HiNodeRenderer.class.st
  19. +0 −81 src/Hiedra/HiNodesAndLinksIterator.class.st
  20. +0 −25 src/Hiedra/HiRenderer.class.st
  21. +0 −20 src/Hiedra/HiRenderingElement.class.st
  22. +149 −60 src/Hiedra/HiRuler.class.st
  23. +66 −101 src/Hiedra/HiRulerBuilder.class.st
  24. +0 −122 src/Hiedra/HiRulerController.class.st
  25. +0 −53 src/Hiedra/HiRulerLazyMorph.class.st
  26. +0 −70 src/Hiedra/HiRulerRenderer.class.st
  27. +391 −0 src/Hiedra/HiSimpleRenderer.class.st
  28. +0 −41 src/Hiedra/HiSnakeLinkRenderer.class.st
  29. +113 −0 src/Hiedra/HiSpecExample.class.st
  30. +15 −0 src/Hiedra/ManifestHiedra.class.st
@@ -10,13 +10,13 @@ Class {
#superclass : #ComposablePresenter,
#instVars : [
'directory',
'hiedraRulerController',
'monitor',
'hiedraCheckBoxPresenter',
'logNodesTreePresenter',
'openSettingsButtonPresenter',
'refreshButtonPresenter',
'selectDirectoryButtonPresenter'
'selectDirectoryButtonPresenter',
'hiedraColumnController'
],
#category : #'EpiceaBrowsers-UI-Graph'
}
@@ -82,18 +82,13 @@ EpLogNodeGraphPresenter >> initializeHiedraCheckBoxPresenter [
{ #category : #initialization }
EpLogNodeGraphPresenter >> initializeHiedraController [

hiedraRulerController := HiRulerController new.

hiedraRulerController treeModel: self logNodesTreePresenter.
self logNodesTreePresenter whenRootsChanged: [
hiedraRulerController updateFromTree ].

hiedraRulerController rulerBuilder
rowSize: self rowSize;
columnSize: self rowSize // 3.

hiedraRulerController rulerBuilder addLinkBuilder: [ :linkBuilder |
linkBuilder targetsBlock: [ :node | node referencedNodes ] ].
hiedraColumnController := HiColumnController new.
hiedraColumnController pageSize: 100.
hiedraColumnController renderer
rowHeight: self rowHeight;
cellWidth: self rowHeight // 3;
arrowSize: 2.0;
nodeConnectionOffset: 2.5.

"Set zero inset, else there is an empty gap cutting Hiedra links."
self logNodesTreePresenter rowInset: 0.
@@ -106,8 +101,9 @@ EpLogNodeGraphPresenter >> initializeLogNodesTreePresenter [
self initializeHiedraController.

self logNodesTreePresenter columns: {
hiedraRulerController newTreeColumnModel
initialWidth: 50
TreeColumnPresenter new
displayBlock: [ :item | hiedraColumnController cellMorphAtValue: item content ];
initialWidth: 50;
yourself.

TreeColumnPresenter new
@@ -222,21 +218,31 @@ EpLogNodeGraphPresenter >> refreshLogNodesTreePresenter [
on: FileSystemError
do: [ :error | self inform: error asString ].

self flag: #fix. "hacky"
self isMonitorDirectory ifTrue: [
| currentGlobalName |
currentGlobalName := self monitor sessionStore store globalName.
nodes := nodes reject: [:each | each globalName = currentGlobalName ].
nodes := { EpMonitorLogNode for: self monitor }, nodes.
].

"Obtain the references between nodes only if the checkbox is selected since it's a potentially expensive process."
self hiedraCheckBoxPresenter state ifTrue: [
nodes
do: [ :node | node populateReferencedNodesWith: nodes ]
displayingProgress: ('Analyzing ', directory asString)].
displayingProgress: ('Analyzing ', directory asString) ].

hiedraColumnController ruler: (HiRulerBuilder
newRulerValues: nodes
linksBlock: [ :node | node referencedNodes asArray ]).
hiedraColumnController reset.

self logNodesTreePresenter roots: nodes.
]

{ #category : #accessing }
EpLogNodeGraphPresenter >> rowHeight [

^ 23
]

{ #category : #accessing }

This file was deleted.

This file was deleted.

0 comments on commit 85bf85d

Please sign in to comment.
You can’t perform that action at this time.