简体   繁体   English

GraphZoomScrollPane和VisualizationViewer依赖项

[英]GraphZoomScrollPane and VisualizationViewer dependancies

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. 在我的GraphZoomScrollPane工作得非常糟糕的情况下我GraphZoomScrollPane非常震惊,在一些放大和缩小操作之后滚动条突然消失。 They do come bak but with improper size and no Y? 他们确实来了bak但是尺寸不合适而没有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 . 我正在使用JUNG PopupGraphMousePluginModalGraphMouseDefaultSettableVertexLocationFunctionEdgeWeightStrokeFunction Any sort of documentation or help is greatly appreciated. 非常感谢任何形式的文档或帮助。

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. 哪里错了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM