smalltalkpharomoose-technologyroassal

Make edges not clickable in Roassal visualization from within a Glamour browser


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.


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).