jung

Jung coloring vertex with value

强颜欢笑 提交于 2019-12-05 03:24:08
I'm stuck at the moment with the Java library Jung. I display vertices and edges, only I can not find any functions for vertex coloring that I need with the value of the vertices and not with the mouse. import edu.uci.ics.jung.algorithms.layout.FRLayout; import edu.uci.ics.jung.algorithms.layout.Layout; import edu.uci.ics.jung.graph.Graph; import edu.uci.ics.jung.visualization.BasicVisualizationServer; import edu.uci.ics.jung.visualization.decorators.PickableVertexPaintTransformer; import edu.uci.ics.jung.visualization.decorators.ToStringLabeller; import edu.uci.ics.jung.visualization

How to add two edges having the same label (but different endpoints) in JUNG?

旧时模样 提交于 2019-12-04 13:11:34
How to add two edges having the same label but different endpoints? For example, I want to add two edges having the same label 'label1', one from vertex v-1 to vertex v-2 and the other one from vertex v-2 to v-3. Part of the code would be: g.addEdge("label1","v-1","v-2"); g.addEdge("label1","v-2","v-3"); But JUNG does not allow to add two edges with the same label. It gives an error: edge label1 already exists in this graph with endpoints [v-1, v-2] and cannot be added with endpoints [v-2, v-3] How can I add two edges having the same label? Thanks. Edit: I just read that there is a way to

Java graph library for visualising flowchart-like diagrams

。_饼干妹妹 提交于 2019-12-04 09:25:46
I'm in the process of making an interface for drawing flow chart like diagrams (essentially circuit diagrams) that contain nodes that look like the following: +-------+ in1 -->| |---> out1 | | in2 -->| | | | in3 -->| |---> out2 +-------+ i.e. each box has several input edges and several output edges. For visual clarity, it makes more sense if all the input edges are grouped on one side and all the output edges are grouped on the other. The interface will involve the user connecting the input and outputs of different boxes together. I'm trying to find a Java library that will help me build such

How do I use JUNG2 in a MVC-gui?

瘦欲@ 提交于 2019-12-04 01:48:59
问题 I was playing around with JUNG2 and wanted to implement a small GUI that allows me to display and change a Graph. Following the examples from the JUNG library worked fine, but they don't separate Model, View and Controller. So I started to build GUI with a clean separation. My first version of a GUI is supposed, to simply show an initial graph. The view is an observer of the model and gets notifications, whenever the graph changes, which happens exactly one time, at the initialization step of

How to programatically pan a VisualizationViewer with Jung (the java library)?

余生颓废 提交于 2019-12-03 22:33:12
After a lot a investigations, I don't achieve to find a convenient answer to the following question: how to programatically pan a VisualizationViewer with Jung? I have a GUI with the list of the vertices of my graph, and I want that a double click on one item of the list (i.e. a node description) perform a "centering action" of my VisualizationViewer for the clicked node. How to code such a behavior? it seems simple but I found no convenient answer. If someone could help, thanks! njames Here is how to popup a menu after right-clicking on a node in JUNG2 and later choose to center to this node:

pagerank implementation in java

与世无争的帅哥 提交于 2019-12-03 21:23:23
I am looking for a java implementation of the pagerank algorithm. Well you've tagged this question with JUNG which includes an implementation of the PageRank algorithm. Here's a link to the Javadoc for it if you haven't seen it. You can get the source for JUNG easily. You could also take a look at the WebLA project on sourceforge. The have a Java implementation of PageRank . 来源: https://stackoverflow.com/questions/2353898/pagerank-implementation-in-java

writing JUNG graphs to images: can't reliably render complete graph

落花浮王杯 提交于 2019-12-03 13:39:04
问题 I've been using JUNG to visualize some simple graphs, and I'd like to write several of them to a PNG file. Unfortunately, the images often appear to render before the graph is finished painting, meaning that I get incomplete graphs -- that is, graphs where only a hanfdul of edges or nodes are drawn -- about half of the time. Rendering to screen works fine, which is part of why I'm so puzzled. As you'll see below, I tried a couple of workarounds, but they didn't help. It may be useful to know

Interactive Python Network/Graph Modeling

独自空忆成欢 提交于 2019-12-03 05:49:08
I'm looking for a python library that will allow me to interactively draw networks and graphs and attach data to nodes and edges. I have found two libraries for Java that seem to do what I need: JUNG and piccolo2d . Are there any python equivalents to these? wong2 Have a look at: matplotlib - Here are some graphs made with it. networkx igraph Using GNU/Radio Companion, I was able to accomplish what I needed by performing some extensions here and there. It is not the best solution since it introduces some ugly dependencies, but it works for now. I've got an example of doing this here: http:/

comparing open source java graph drawing frameworks(JUNG and Prefuse) for drawing network topology

僤鯓⒐⒋嵵緔 提交于 2019-12-03 03:40:02
问题 which of the open source Java graph drawing frameworks to use for a network diagram with the following requirements? The graph will have less than 1000 nodes. 1) has parallel edges 2) directed and undirected edges within a single graph 3) nodes represented by images 4) user interaction with nodes and edges 5) dynamically adding/deleting nodes and edges 6) multiple labelling on nodes and edges , different levels of labelling can be turned off/on by users. (like drawing in layers and turning

How to manually set the zoom on a Jung visualisation?

老子叫甜甜 提交于 2019-12-01 22:00:49
问题 I have a jung tree displayed in a JPanel. The constructor of my tree looks like this: Forest<String, Integer> graph = new DelegateForest<String, Integer>(); static GraphZoomScrollPane panel = null; static DefaultModalGraphMouse graphMouse = null; static JComboBox modeBox = null; static ScalingControl scaler; public PanelTree(List<Cluster> clist) { setBounds(215, 10, 550, 550); updateData(clist); // adds vertex and edges to graph treeLayout = new TreeLayout<String, Integer>(graph); vv = new