jung

JApplet fails to run in HTML page

扶醉桌前 提交于 2019-12-11 10:51:13
问题 I have created a JApplet using the JUNG library in Netbeans that compiles and runs normally. However, when I try to create an html file that runs the applet, only a grey pane appears but the components are missing. My class is : public class View extends JApplet { //Here I declare the buttons etc.. public View() { initializeComponent(); fetchGraphs(); } public static void main(String[] args) throws IOException{ f = new JFrame(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize

Jung2: How to implement displaying details of a node on mouse over of a Node?

半城伤御伤魂 提交于 2019-12-11 08:38:49
问题 I am looking for a way how to display details of a node (as a popup) on MouseOver. Unfortunately the Jung2 tutorial does not provide any information how to implement this kind of functionality. Could anybody share a code sample or point me to an example on the web? 回答1: PluggableRendererDemo does this. 回答2: use VisualizationViewer.setVertexToolTipTransformer From the EdgeLabelDemo you can see a simple example is to use the built-in transformer: vv.setVertexToolTipTransformer(new

Saving jung graph with Custom Node and Edge

 ̄綄美尐妖づ 提交于 2019-12-11 03:55:20
问题 How can one save a JUNG graph with a custom node and edge? Problem is, till now we have been able to save a JUNG graph of fields with primitive types like integer, string, etc. But the JUNG graph custom node and edge we are working with involves using datatypes like ArrayList and some more complicated datastructures inside the the edge and/or node. I have searched a lot on the web but came across how to save a simple custom node/edge using only int or string or double. Moreover, my aim is not

JUNG: unpicked vertex label color

情到浓时终转凉″ 提交于 2019-12-11 03:54:14
问题 I can make picked vertex labels red using vertexLabelRenderer declared like this: DefaultVertexLabelRenderer vertexLabelRenderer=new DefaultVertexLabelRenderer(Color.RED); How do I change color of unpicked vertex labels. Constructor (see below) only allows defining unpicked vertex labels. Also method setForeground() does not affect the font color. Here is the JUNG 2.0.1 API document: http://jung.sourceforge.net/site/apidocs/edu/uci/ics/jung/visualization/renderers/DefaultVertexLabelRenderer

JUNG Tree Layout dynamic update

荒凉一梦 提交于 2019-12-11 01:47:33
问题 I'm using the TreeLayout in JUNG for my graph. The user is able to make changes to the graph and it should then update and show the changes. To enable a update, I create the graph again and set the layout using it: graph = new DelegateForest<String, Integer>( new DirectedOrderedSparseMultigraph<String, Integer>()); createGraph() //adds the vertices and edges to the graph layout.setGraph(graph); vv.repaint(); This does update the tree to what it should be, but the tree layout is lost. Most of

How to copy a graph in JUNG 2.0 framework?

你离开我真会死。 提交于 2019-12-10 17:44:00
问题 in JUNG 1.7.6 there was the function copy() for this purpose (myGraph.copy()), but in JUNG 2.0 this function does not exist anymore. I could not find any other possibility to create a copy of a graph object. I would be very glad if someone could help me. A workaround would be nice, too. Thanks a lot! 回答1: Code below with generics, so you should replace V and E with String for your Graph<String, String> . Graph<V, E> src; Graph<V, E> dest; for (V v : src.getVertices()) dest.addVertex(v); for

JUNG - How to get the giant connected component of a graph?

末鹿安然 提交于 2019-12-10 17:42:45
问题 Currently, what I'm doing is: WeakComponentClusterer<Integer, String> wcc = new WeakComponentClusterer<Integer, String>(); Collection<Graph<Integer,String>> ccs = FilterUtils.createAllInducedSubgraphs(wcc.transform(graph),graph); The problem is that in ccs is stored all the connected components but I just want the giant one (GCC). Since the order of the clusters in the collection css is not determinated by their size, I have to iterate over the whole collection in order to find the giant

JUNG cannot display large graphs?

旧巷老猫 提交于 2019-12-10 16:47:07
问题 I am using JUNG for a project and when I am displaying relatively large graphs eg 1500 nodes, my pc would not be able to handle it (graphs are rendered but If I want to navigate the graph the system become very slow). Any Suggestions. 回答1: So, there are two things that JUNG visualization doesn't always scale very well right now: iterative force-directed layouts interaction: figuring out which node or edge (if any) is being referenced for hover and click events. It sounds like it's the latter

Improve the rendering of a JUNG graph

拈花ヽ惹草 提交于 2019-12-10 04:10:28
问题 i am using jung to visually display large data sets, (1000s of nodes) but the system becomes very laggy when I zoom in or out, or move a node. Is there anyway to improve the rendering of graphs in JUNG ? 回答1: The way that I used to improve rendering on graphs was to filter the edges of the graph. Every time you try to move the graph the framework do enormous calculations to reposition every vertex and edge and this causes bad performance. The filtering could be done with adding

How to use PageRank algorithm in JUNG?

这一生的挚爱 提交于 2019-12-09 02:32:30
I am using JUNG as my tool to visualize network graph and compute network attributes(ex: indegree, outdegree, and pagerank). I know JUNG already implemented PageRank algorithm, but there were no instruction on using pagerank algorithm in the manual( http://jung.sourceforge.net/doc/index.html ). Does anyone knows how to do it? I also tried the following code, but it came out an error " Vertex CLP Holdings Ltd not an element of this graph ". public void calcPageRank() { PageRank<MyNode, MyLink> alg = new PageRank<MyNode, MyLink>(g,0.1); alg.initialize(); System.out.println(alg.getVertexScore(new