java - How to use DirectedSparseVertex() in the jung library? -
i new jung library, , trying create new vertex , following jung tutorial (here: http://jung.sourceforge.net/doc/manual.html#start). but, eclipse ide cannot recognize directedsparsevertex class or directededge class when try use it. wondering if missing import or something? here code. hope guys can help.
import java.net.url; import java.util.arraydeque; import java.util.arraylist; import java.util.linkedlist; import java.util.priorityqueue; import java.util.queue; import org.jgrapht.directedgraph; import org.jgrapht.graph.defaultedge; import edu.uci.ics.jung.graph.directedsparsegraph; import edu.uci.ics.jung.graph.graph; import edu.uci.ics.jung.graph.sparsegraph; import edu.uci.ics.jung.visualization.renderers.renderer.vertex; public class locknodes { public locknodes() { graph original = new directedsparsegraph(); vertex v1_orig = original.addvertex(new directedsparsevertex()); vertex v2_orig = original.addvertex(new directedsparsevertex()); directededge e_orig = original.addedge(new directedsparseedge(v1, v2)); graph target = new directedsparsegraph(); vertex v1_copy = v1_orig.copy(target); vertex v2_copy = v2_orig.copy(target); directededge e_copy = e_orig.copy(target); } }
so underlying in red: new directedsparsevertex() , directededge e_copy
the classes you're referencing (directedsparsevertex
, directededge
) jung 1.x; presumably using new jung 2.x classes, don't have types vertices , edges.
(note, way, new home jung, of v2.1, on github: http://jrtom.github.io/jung/)
i suggest take @ current javadoc , samples, documented here: http://jrtom.github.io/jung/javadoc/index.html
and @ tutorial (a bit out of date, based on v2): http://www.grotto-networking.com/jung/jung2-tutorial.pdf
Comments
Post a Comment