Question

I draw a dynamic callgraph with Roassal from within a Glamour browser in Pharo 2.0.

By default not only the nodes, but also the edges are clickable.

As i have no further information to display for the edges, i want them not to be clickable. How do i remove the "clickability"?

That's how i draw the callgraph from within a Glamour browser:

methodsUnderTestAsCallGraphIn: constructor
    constructor roassal
        painting: [ :view :testFailure | 
                    view shape rectangle
                        size: 30;
                        fillColor: ThreeColorLinearNormalizer new.
                    view nodes: (tests methodsUnderTest: testFailure).
                    view shape arrowedLine.
                    view edges: (tests methodsUnderTest: testFailure) from: #yourself toAll: #outgoingCalls.
                    view treeLayout ];
        title: 'Callgraph of methods under test'

I think GLMRoassalPresentation>>renderOn: is responsible for adding the "clickability":

[...]

    self shouldPopulateSelection ifTrue: [   
        aView raw allElementsDo: [:each | 
            each on: ROMouseClick do: [:event | self selection: each model ]] ].

[...]

I want to to keep this behaviour for the nodes, but not for the edges.

Was it helpful?

Solution

It helps to have a self contained example to clarify the behaviour you want, so I've re-framed your question.

With the two commented-out lines , I guess is the behaviour you don't want. Does uncommmenting those two lines provide the behaviour you want?

browser := GLMTabulator new.
browser column: #myRoassal ; column: #mySelection.
browser transmit 
    to: #myRoassal ;
    andShow: 
    [   : aGLMPresentation |
        aGLMPresentation roassal
            painting:
            [   : view : numbers |  |edges|
                view shape rectangle ; withText ; size: 30.
                view nodes: numbers.
                view interaction noPopup.
                view edges: numbers from:  [ :x | x / 2] to: [ :x | x ].
"               view edges do: [ :edge | edge model:#doNotSelectMe ]."
                view treeLayout.
            ].
    ].
browser transmit 
    to: #mySelection ;
    from: #myRoassal ;
"   when: [ :selection | selection ~= #doNotSelectMe ] ;"
    andShow: 
    [   : aGLMPresentation |
        aGLMPresentation text
            display: [ : selectedItem | selectedItem asString ]
    ].
browser openOn: (1 to: 10).

OTHER TIPS

Unfortunately, this is not possible at the moment because the clicking is hardcoded in GLMRoassalPresentation. However, you are right that we should find a solution, so I opened an issue: http://code.google.com/p/moose-technology/issues/detail?id=981

I am not sure what you mean by "clickability". You have no interaction defined, so the default interaction is a simple popup. If you want to remove the popup, then just insert a "view interaction noPopup". Try this in a fresh Roassal easel:

view shape rectangle size: 40.
view nodes: #(1 2).

view interaction noPopup.
view edgesFrom: 1 to: 2.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top