The problem here is that you are mixing Mondrian code and Roassal code. It is like putting some C or Assembly code in your Java code. You can do it, but you need to know exactly what’s going on.
Without Mondrian, you can have: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | v e1 e2 l lbl | v := ROView new. e1 := (ROBox new size: 30) element. e2 := (ROBox new size: 30) element. l := ROLine elementFrom: e1 to: e2.
lbl := (ROLabel text: 'hello world') element. ROConstraint stick: lbl between: e1 and: e2. "locate the label between 2 nodes"
e1 @ RODraggable. e2 @ RODraggable.
v add: e1; add: e2; add: l; add: lbl. v open -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
If you really wish to stick to Mondrian, you can do:
-=-=-=-=-=-=-=-= | b | b:= ROMondrianViewBuilder new. b shape circle size: 30. b nodes: #(1 2).
b edgeFromAssociation: 1 -> 2. b open.
b view edges do: [ :edge | | lbl | lbl := (ROLabel text: 'hello world') element. b view add: lbl. ROConstraint stick: lbl between: edge from and: edge to. ]. -=-=-=-=-=-=-=-=
Cheers, Alexandre
On Jan 30, 2014, at 6:51 AM, Vincent Blondeau vincent.blondeau@polytech-lille.net wrote:
Le 29/01/2014 11:49, Alexandre Bergel a écrit :
Vincent, did it work?
Not really...
The code I use is :
//Node and edges creation ... view shape label centeredLabel. labelNode := view node: 'Hello'. "create the label I want between (it's for the example)" ROConstraint stick: labelNode between: view edges first from and: view edges first to. "locate the label between 2 nodes" view treeLayout. view openA text "hello" is displayed but at the begining, the text is misplaced :
<Mail Attachment.txt> If I move one of the nodes linked to the edge, the text moves to the right location (the picture at the bottom, shows what I want to do :) ) <Mail Attachment.txt> But the text doesn't stay on the edge but it's between the left sides of the nodes...
<Mail Attachment.txt> Do I use the right method and the right arguments ?
Thanks for helping !
Vincent
Alexandre
On 24 Jan 2014, at 07:11, Vincent Blondeau vincent.blondeau@polytech-lille.net wrote:
Hello,
I use Roassal to visualize a FAST AST as a kind of UML diagram. Each node on Roassal is a node of the AST and the edges shows the parent link. That's work fine and it's very easy to do it ! Thanks !
But I would like to add some text on the edges to know what are the instance variables containing the children nodes.
I saw the examples and there's not a such functionality.
Is it possible to add it ?
Cheers, Vincent _______________________________________________ Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list
Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev