내 GraphZoomScrollPane
이 실제로 매우 효과적이며, 일부 확대/축소 작업 후 스크롤 막대가 갑자기 사라지는 상황에서 나는 놀랐습니다. 그들은 박쥐가되었지만 부적절한 크기와 Y가 없습니까? 어느 누구도이 점에 대해 도움이 될 수 있으며 확대/축소가 의존하는 매개 변수는 무엇인지 알려주시겠습니까? 나는 JUNGPopupGraphMousePlugin
, ModalGraphMouse
, DefaultSettableVertexLocationFunction
, EdgeWeightStrokeFunction
을 사용 중이다. 모든 종류의 문서 또는 도움을 주시면 대단히 감사하겠습니다.GraphZoomScrollPane 및 VisualizationViewer 종속성
3
A
답변
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
안녕하세요 괴짜가 정이랑 문제가있는 것 같습니다. 링크는 http : // www입니다. .jarvana.com/jarvana/view/jung/jung/1.7.6/jung-1.7.6-sources.jar! /samples/graph/GraphZoomScrollPaneDemo.java? format = ok 문제를 보려면 다음을 수행하십시오. – cathy
설명하는 문제를 나타내는 [sscce] (http://sscce.org/)를 제공하십시오. – trashgod
아래는 SSCCE입니다. 부탁드립니다. 가능한 한 빨리 알려 주시기 바랍니다. pls .... – cathy