3

I am struck up in situation where my GraphZoomScrollPane is working really weierdly, where the scroll bars disappear suddenly after some zoom in and zoom out operations. They do come bak but with improper size and no Y? Can any one help me in this regard and let me know what are the parameters on which zooming depends? I am using JUNG PopupGraphMousePlugin, ModalGraphMouse, DefaultSettableVertexLocationFunction, EdgeWeightStrokeFunction. Any sort of documentation or help is greatly appreciated.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
cathy
  • 221
  • 2
  • 5

1 Answers1

0
private JPanel _getCenterPanel() {
        JPanel jpMainPanel = new com.panduit.acmnms.gui.framework.ACMPanel(new GridLayout(1,0));
        initVisualViewer();
        pane = new GraphZoomScrollPane(vv);//Defined in the begng.
        jpMainPanel.add(pane);
        return jpMainPanel;
    }

private void initVisualViewer() {
        clusteringLayout = new SubLayoutDecorator(new SpringLayout(graph));
        Dimension preferredSize = new Dimension(width, height);
        visualizationModel = new DefaultVisualizationModel(clusteringLayout, preferredSize);
        vv =  new VisualizationViewer(visualizationModel, pr, preferredSize);
        ewcs = new EdgeWeightStrokeFunction(edge_weight);
        vertexLocations = new DefaultSettableVertexLocationFunction(); 
        vv.setDoubleBuffered(false);
        vv.setGraphMouse(graphMouse);
        graphMouse.setMode(ModalGraphMouse.Mode.PICKING);
        popupGraphMousePlugin = new PopupGraphMousePlugin(vertexLocations);
        graphMouse.add(popupGraphMousePlugin);
        System.out.println("  graphMouse.getModeMenu()  "+graphMouse.getModeMenu());
        graphMouse.setZoomAtMouse(true);
        vv.setGraphMouse(graphMouse);
        vertexImagerAndShapeFunction = new VertexIconAndShapeFunction(new EllipseVertexShapeFunction());
        vertexImagerAndShapeFunction.setIconMap(iconMap);
        pr.setVertexIconFunction(vertexImagerAndShapeFunction);
        pr.setVertexShapeFunction(vertexImagerAndShapeFunction);
        vertexStringerImpl = new VertexStringerImpl(labelMap);
        pr.setVertexStringer(vertexStringerImpl);
        vertexToolTipFunctionAdapter = new VertexToolTipFunctionAdapter(tooTipMap);
        vv.setToolTipFunction(vertexToolTipFunctionAdapter);
        vv.setPickSupport(new ShapePickSupport());
            pr.setEdgeShapeFunction(new EdgeShape.QuadCurve());
        ewcs.setWeighted(true);
        vv.setBackground(Color.white);
    }

Above is the part of the code which is responsible for zooming part of the code. please let me knw. Where is the wrong.

mhu
  • 17,720
  • 10
  • 62
  • 93
cathy
  • 221
  • 2
  • 5
  • Hi geeks there seems to be an issue with the JUNG it self you can visit the link http://www.jarvana.com/jarvana/view/jung/jung/1.7.6/jung-1.7.6-sources.jar!/samples/graph/GraphZoomScrollPaneDemo.java?format=ok to see the issue: – cathy Jan 18 '12 at 07:04