weird import issues - Jung2

拜拜、爱过 提交于 2019-12-13 02:47:42

问题


I've been trying to get Jung 2.1.1 to work successfully but whatever breaking changes were made are just not making sense.

After importing the 2.1.1 jars, I get the error:

The constructor VisualizationViewer(Network, LayoutAlgorithm, Dimension) is undefined

for the line:

VisualizationViewer vv = new 
            VisualizationViewer(g, layoutAlgorithm, new Dimension(900, 900));

where

 Network g = NetworkBuilder.undirected().build(); // and other load steps

There are other imports that aren't working, like

import edu.uci.ics.jung.visualization.decorators.PickableNodePaintFunction;
import edu.uci.ics.jung.visualization.layout.LayoutAlgorithmTransition;

Edit: It appears the classes in the Jung 2.1.1 JAR still use the old definitions, for example

VisualizationViewer(Layout<V,E>,Dimension)

and not

VisualizationViewer(Network<N,E>,Dimension,Dimension)

回答1:


This question was answered in https://github.com/jrtom/jung/issues/201

The short version is that you should not be cloning the HEAD version on the JUNG website; that's the 3.0 version in development, which is not yet ready for release, and is incompatible with 2.1.1. Use the 2.1.1 version explicitly for both the jars and the samples.



来源:https://stackoverflow.com/questions/49535831/weird-import-issues-jung2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!