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. 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
, DefaultSettableVertexLocationFunctio开发者_高级运维n
, EdgeWeightStrokeFunction
.
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.
精彩评论