繁体   English   中英

GraphZoomScrollPane和VisualizationViewer依赖项

[英]GraphZoomScrollPane and VisualizationViewer dependancies

在我的GraphZoomScrollPane工作得非常糟糕的情况下我GraphZoomScrollPane非常震惊,在一些放大和缩小操作之后滚动条突然消失。 他们确实来了bak但是尺寸不合适而没有Y? 任何人都可以在这方面帮助我,让我知道缩放所依赖的参数是什么? 我正在使用JUNG PopupGraphMousePluginModalGraphMouseDefaultSettableVertexLocationFunctionEdgeWeightStrokeFunction 非常感谢任何形式的文档或帮助。

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);
    }

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

暂无
暂无

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

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