And example
~~~~~~~~~~~~~~~~~~~~~~~~~
| v |
v := RTView new.
v addAll: ((RTEllipse new color: (Color red alpha: 0.3)) elementsOn: (1 to:
300)).
"RTRectanglePackLayout on: v elements."
RTForceBasedLayout on: v elements.
^ v
~~~~~~~~~~~~~~~~~~~~~~~~~
Peter
On Tue, Apr 7, 2015 at 10:04 PM, Peter Uhnák <i.uhnak(a)gmail.com> wrote:
Out of curiosity I dug a little deeper and was happy
to learn about a Job
and more about Pharo internals.
In any case, try replacing RTForceBasedLayout>>doExecute: with this
~~~~~~~~~~~~~~~~~~~~~~~~~
doExecute: nodeElements
self start: nodeElements.
[ :job |
job
title: 'Laying out elements';
min: 1 - alpha;
max: 1.
nbIterations = 0
ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self
step. job currentValue: 1 - alpha ] ]
ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step.
job currentValue: 1 - alpha ] ]
] asJob run.
alpha := 0.
nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
~~~~~~~~~~~~~~~~~~~~~~~~~
it's bit messy (and doesn't account for nbIterations), but its a proof of
concept.
I thing that it makes sense to create execution indicator without progress
(with spinner for example)
What can be done is to display alpha on progress bar. From current value
to 0.005 or whatever there is.
I was thinking more something like this
http://www.barchart.com/shared/images/progress_bar.gif or thsi
https://i.stack.imgur.com/gz9GK.gif
Peter