GraphZoomScrollPane 和 VisualizationViewer 依赖项

发布于 2024-12-04 14:27:17 字数 353 浏览 1 评论 0原文

我对我的 GraphZoomScrollPane 工作非常奇怪的情况感到震惊,在一些放大和缩小操作后滚动条突然消失。它们确实出来了,但尺寸不合适而且没有 Y?任何人都可以在这方面帮助我并让我知道缩放取决于哪些参数吗?我正在使用 JUNG PopupGraphMousePluginModalGraphMouseDefaultSettableVertexLocationFunctionEdgeWeightStrokeFunction。 非常感谢任何类型的文档或帮助。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

作死小能手 2024-12-11 14:27:17
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);
    }

上面是负责缩放部分代码的部分代码。
请让我知道。到底哪里错了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文