Re render.

Help
2012-11-09
2013-05-29
  • Fer Madeiral
    Fer Madeiral
    2012-11-09

    I'm using prefuse to visualize a radial graph, that contains a setting panel to user choose the edge type, arrow type, etc. For instance, when the user check the radio button of edge type, is passed to method below: 0, if the edge type is straight, or 1, if the edge type is curve. Even the edge type value be update in defaultRendererFactory of the visualization, the screen isn't update. I tried repaint my display, visualization, run(layout), etc, and didn't work.
    If anyone can help me, I'd be really grateful.

     
  • Fer Madeiral
    Fer Madeiral
    2012-11-09

    Here is the piece of code:

    public void updateEdgeType(int type) {
    if (type == 0)
        m_edgeType = Constants.EDGE_TYPE_LINE;
    else
        m_edgeType = Constants.EDGE_TYPE_CURVE;

        m_edgeRenderer.setEdgeType(m_edgeType);
        ((EdgeRenderer) defaultRendererFactory.getDefaultEdgeRenderer()).setEdgeType(m_edgeType);
        m_vis.setRendererFactory(defaultRendererFactory);

        // ??????
    }

     
  • Björn Kruse
    Björn Kruse
    2012-11-09

    Hi,

    to my experience, most of this type of "repaint does not consider something" issues happens because one of the various actions or actionLists is not run.
    Please make sure that ALL necessary Actions (and ActionLists) are run. Maybe your run(layout) does not contain all of them?

    regards, Björn

     
  • Fer Madeiral
    Fer Madeiral
    2012-11-09

    Björn, thank you for answering me.

    My ActionList "layout" perform all my Actions:

    ActionList layout = new ActionList();
            layout.add(new TreeRootAction(graph));
            layout.add(treeLayout);
            layout.add(nodeFillColor);
            layout.add(nodeTextColor);
            layout.add(edgeFillColor);
            layout.add(edgeStrokeColor);
            layout.add(fonts);
            m_vis.putAction("layout", layout);
    

    except my ActionList "animate":

    ActionList animate = new ActionList(1250);
            animate.setPacingFunction(new SlowInSlowOutPacer());
            animate.add(new QualityControlAnimator());
            animate.add(new VisibilityAnimator(graph));
            animate.add(new PolarLocationAnimator(graphNodes, linear));
            animate.add(new ColorAnimator(graphNodes));
            animate.add(new RepaintAction());
            m_vis.putAction("animate", animate);
    

    F. Madeiral

     
  • Björn Kruse
    Björn Kruse
    2012-11-10

    And? As I suggested, have you tried run(animate) after setting EdgeType?
    What happend then?
    regards, Björn

     
  • Fer Madeiral
    Fer Madeiral
    2012-11-10

    I dont run animate because this activity only execute when node is clicked, and I think that isnt necessary in this case. Anyway, I tested it right now, and doesnt work too =/

    F. Madeiral