2011-09-14 136 views
3

當我的GraphZoomScrollPane工作的非常好,滾動條在一些放大和縮小操作後突然消失的情況下,我很興奮。他們確實來了bak,但是尺寸不合適,沒有Y?在這方面,任何人都可以幫助我,讓我知道縮放依賴於哪些參數?我正在使用JUNGPopupGraphMousePluginModalGraphMouse,DefaultSettableVertexLocationFunction,EdgeWeightStrokeFunction。 任何形式的文件或幫助非常感謝。GraphZoomScrollPane和VisualizationViewer依賴關係

+1

請提供一個[sscce](http://sscce.org/),展示您描述的問題。 – trashgod

+0

Belove是你問的SSCCE ..請審覈它並讓我儘快知道請你.... – cathy

回答

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

以上是負責放大部分代碼的部分代碼。 請讓我知道。哪裏錯了。

+0

嗨極客似乎有問題與JUNG它自我你可以訪問鏈接http:// www .jarvana.com/jarvana/view/jung/jung/1.7.6/jung-1.7.6-sources.jar!/samples/graph/GraphZoomScrollPaneDemo.java?format = ok查看問題: – cathy