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