How to manually set the zoom on a Jung visualisation?

后端 未结 2 1662
囚心锁ツ
囚心锁ツ 2021-01-20 10:47

I have a jung tree displayed in a JPanel. The constructor of my tree looks like this:

  Forest graph = new DelegateForest

        
2条回答
  •  时光取名叫无心
    2021-01-20 11:18

    ScalingControl is not good method if you use Mouse Transformer.

    Try to:

    // for zoom:
    vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT).setScale(scale_x1, scale_y1, vv.getCenter());
    // for out:
    vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW).setScale(scale_x2, scale_y2, vv.getCenter());
    

提交回复
热议问题