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);
}
Выше приведена часть кода, которая отвечает за масштабирование части кода.
пожалуйста, дайте мне знать. Где не так.