But, why would you add another method for this?
Also, please do not add verbs in the API, like (add*). For example, it
is edge:from:to:, and not addEdgeFrom:to:.
You might want to name it edgeFrom:to:, but that does not work because
the assumption when we do not give the model is to take the collection
of the objects behind the nodes.
Like this you can write:
view nodes: classes.
view edgesFrom: #superclass.
This case is much more often encountered then having an edge without a
model at all.
So, all in all, I would not add this new method.
Cheers,
Doru
On 24 Mar 2009, at 16:54, Alexandre Bergel wrote:
I did not see this...
It will make addEdgeFrom:to: shorter then.
Thanks,
Alexandre
On 24 Mar 2009, at 16:50, Tudor Girba wrote:
Hi Alex,
There is no need for that because you already have support for that:
view := MOViewRenderer new.
view nodes: #(1 2).
view edge: nil from: 1 to: 2.
view open
This is because:
Object>>moValue: anArgument
^ self
Cheers,
Doru
On 24 Mar 2009, at 16:44, Alexandre Bergel wrote:
Hi All,
Several time I saw the need to add a particular edge between two
nodes that I know. I added a new method addEdgeFrom:to: in
ViewRenderer.
Here the appropriate test. Feel free to comment.
-=-=-=-=-=-=-=-=-=-=-=-=
testAddEdge
| view |
view := MOViewRenderer new.
view nodes: (1 to: 2).
view addEdgeFrom: 1 to: 2.
window := view open.
self assert: (view root edges size = 1).
self assert: (view root edges first source =
(view nodeForDomainValue: 1)).
self assert: (view root edges first target =
(view nodeForDomainValue: 2)).
-=-=-=-=-=-=-=-=-=-=-=-=
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"We cannot reach the flow of things unless we let go."
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Problem solving efficiency grows with the abstractness level of
problem understanding."