Hi,
On 4 Dec 2011, at 23:07, Veronica Isabel Uquillas Gomez wrote:
Hi Alex,
I could not find an example of how to update the edges, so initially I drew all the edges and then I was simulating an update by using:
view interaction whenClickingUpdateNode: [ :enode | self viewEdgesOfDelta: enode with: outgoingDeltas with: incomingDeltas on: view ] whenClickingBackUpdateNode: [ :enode | self resetEdgesOn: view ] withLayoutUpdate: false.
But this was drawing new edges and some of them in a different position of the original.
Based on your example I created my edges only once and then I reuse them when changing color... I works perfectly :D
Thank you very much!!
Btw, I am curious about this: view treeLayout userDefinedEdges: edges.
What is it exactly? after that you draw more edges... does it to ensure the tree layout based on the initial edges?
This tells the layout to only take into account the specified edges. For example, if you want to show a class hierarchy tree and on top show some other relationships, you can tell the view to only layout according to the inheritance edges and not the others.
Cheers, Doru
Cheers, Veronica
On 04 Dec 2011, at 15:15, Alexandre Bergel wrote:
Hi Veronica,
I need to have more detail. I cannot reproduce the problem. How do you update the edges?
Consider the following example (you need to update Mondrian to see it working, I fixed a bug, which raised an exception). Just do it in an Easel:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= "Example on updating shape color. Moving the mouse about a node turn the edges to used classes red. "
| classes edges getDepOfAClass classesAndTheirOutgoingEdges |
"Return the list of classes that are dependent from aClass" getDepOfAClass := [ :aClass | | b | b := Set new. aClass methods do: [:m | b addAll: ((m allLiterals select: [:l | (l isKindOf: Association) and: [ l value isBehavior ]]) collect: #value) ]. b ].
"We select all the classes of Mondrian" classes := (Smalltalk globals select: #isBehavior) select: [:c | c name beginsWith: 'MO' ]. view shape rectangle width: #numberOfAttributes; height: #numberOfMethods. view interaction action: #inspect. view interaction on: MOMouseEnter do: [ :ann | (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color red ]]. ]; on: MOMouseLeave do: [ :ann | (classesAndTheirOutgoingEdges at: ann model) do: [:e | e copyShapeAndDo: [:s | s color: Color lightGray ]]. ]. view nodes: classes.
view shape: (MOOrthoVerticalLineShape new color: Color black). edges := view edgesFrom: #superclass. view treeLayout userDefinedEdges: edges.
view shape line color: Color veryLightGray.
classesAndTheirOutgoingEdges := Dictionary new. classes do: [:cls | classesAndTheirOutgoingEdges at: cls put: (view edge: cls from: #yourself toAll: [:c | getDepOfAClass value: c ]) ]. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cheers, Alexandre
On 3 Dec 2011, at 17:46, Veronica Isabel Uquillas Gomez wrote:
Hi,
I have an inconvenient with the positions in which edges are being drawn. Attached a screenshot to explain what is happening.
My visualization displays at the beginning all the edges (grey), and then when interacting with a node, its edges change color. However, when drawing the edges in another color (green/red) some appear in a different location (see the red one). For me this creates confusion as it seems to be a different edge (i know that when drawing it's a different object but i think it should appear in the same location as most of them do).
I thought that it was related with the type of line (arrowed) but in fact the same happens with a simple line or in a different layout. This case in particular uses the dominance tree layout.
Now I am wondering if that is a bug of the layout or of the edge's drawing itself. And, if this can be fixed..
Best Regards, Veronica
<edges-positions.png>
Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev
-- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
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
-- www.tudorgirba.com
"To lead is not to demand things, it is to make them happen."