'From Pharo1.4 of 18 April 2012 [Latest update: #14438] on 16 May 2012 at 11:15:20
pm'!
!MOAbstractRegularTreeLayout methodsFor: 'hook' stamp: 'BenComan 5/16/2012
23:14'!
doExecute: node
| rootNodes btcdebug|
alreadyLayoutedNodes := OrderedCollection new.
rootNodes := self rootNodesFor: node nodes.
nodesByLayer := OrderedCollection new.
self flag: #btcdebug.
"Regarding moose-dev(a)iam.unibe.ch emails 'Jenkins build is still unstable:
moose-latest-dev #972'
To isolate the issue, open a Transcript then generate the following in Mondrian Easel
twenty times
view shape label.
view nodes: #(1 2 3 4 ).
view edgesFromAssociations: { 1 -> 2. 1 ->3 . 3 -> 4}.
view treeLayout.
"
btcdebug := rootNodes first.
Transcript cr; crShow: '------------------------------'.
Transcript crShow: 'B1>', (self childrenFor: btcdebug) asString.
Transcript crShow: 'B2>', (self computeChildrenFor: btcdebug) asString.
self
layout: rootNodes
atPoint: self leftGap @ self topGap
atLayer: 1.
self isLayered ifTrue: [
self rearrangeByLayers: node ]! !
!MOAbstractVerticalTreeLayout methodsFor: 'hook-private' stamp: 'BenComan
5/16/2012 23:02'!
layout: aNodeCollection atPoint: aPoint atLayer: aNumber
| treeSize childrenPosition x y middleOfTree |
aNodeCollection isEmpty ifTrue: [ ^ 0 ].
x := aPoint x.
y := aPoint y.
alreadyLayoutedNodes addAll: aNodeCollection.
self atLayer: aNumber add: aNodeCollection.
aNodeCollection do: [ :each |
self flag: #btcdebug. Transcript crShow: 'A2>', each asString.
childrenPosition := y + each height + self verticalGap.
treeSize := each width
max: (self layout: (self computeChildrenFor: each) atPoint: x @ childrenPosition
atLayer: aNumber + 1).
middleOfTree := x + (treeSize / 2.0) - (each width / 2.0).
each translateTo: middleOfTree @ y.
x := x + treeSize + self horizontalGap ].
^ x - aPoint x - self horizontalGap! !