jung

Adding Jung dependencies to Neo4j server plugin extensions

我是研究僧i 提交于 2019-12-25 03:47:24
问题 Hi I am trying to experiment with Neo4j server plugins. The pom.xml file that I am using is exactly the same as in - https://github.com/neo4j/neo4j/blob/2.1.3/community/server-examples/pom.xml And the server plugin extension that I am experimenting with is - https://github.com/neo4j/neo4j/blob/2.1.3/community/server-examples/src/main/java/org/neo4j/examples/server/plugins/GetAll.java This works fine, but then I decide to make some calls to the Jung library from GetAll.java. So I simply add

How to unite two graphs in JUNG?

只谈情不闲聊 提交于 2019-12-24 21:20:24
问题 I have to graphs which I want to unite, that is, create a new graph composed by the union of both graph's edges and nodes (without repetition). Is there an implementation for that avaliable in JUNG or do I have do so on my own? 回答1: There isn't an implementation for that in JUNG, but it's about six lines of code assuming that the graphs, vertices, and edges are of the same types: // given Graph g1, g2 Graph g = new [appropriate Graph implementation] for (V v : Collections.union(g1.getVertices

Vertex label color in Jung visualization

纵然是瞬间 提交于 2019-12-24 16:34:18
问题 I've created a graph with Jung and I'm looking into visualization options. I'm trying to change the color of the vertex labels, don't care if they are picked/unpicked, just from the get-go. I.e. I want to paint the vertex labels white, leave edge labels black (default). Can't seem to find a sample that works, the DefaultVertexLabelRenderer class should help I guess but I can't seem to get it to work. Any ideas? The code currently looks like this: public static void main(String[] args) { Graph

How to get a vertex coordinate in JUNG?

余生颓废 提交于 2019-12-23 04:24:55
问题 Is there a way to get the vertex coordinate when using the EditingModalGraphMouse in Jung ?? I've made a class for the vertex with the coordinate setter and getter but i don't kown how to set the vertex with its specific coordinate ? (i've user a transformer : Transformer) 回答1: The following gives you an idea on how to obtain the Cartesian coordinates on a Jung VisualizationViewer instance... Create an inner class as follows: protected class MyGraphMousePlugin extends

How to animate drawing edges with JUNG

╄→гoц情女王★ 提交于 2019-12-23 02:57:10
问题 I'm new to JUNG I have a FRLayout that represents a network topology with key nodes or vertices that are color as red and the other vertices blue The edges from the starting node to the end node are blue I want to be to demonstrate an animation of the path to the end node. How can animate drawing the edges from a start_node to end_node with a specified time interval? Can you provide or reference an example? 回答1: You could attach a keyframe to your Edge data. Then, every time you draw (using a

How to add custom vertex labels in JUNG graph visualization?

混江龙づ霸主 提交于 2019-12-22 07:10:18
问题 How to use custom vertex labels in JUNG graph visualization? I am following Jung 2.0 Tutorial where I found that setVertexLabelTransformer() can be used to label the vertices, but these labels cannot be customized, to my knowledge. For example, the below code produces three vertices, having vertex-labels 1,2,4: import edu.uci.ics.jung.algorithms.layout.CircleLayout; import edu.uci.ics.jung.algorithms.layout.Layout; import edu.uci.ics.jung.graph.Graph; import edu.uci.ics.jung.graph

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

故事扮演 提交于 2019-12-21 20:54:15
问题 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

Java graph library for visualising flowchart-like diagrams

牧云@^-^@ 提交于 2019-12-21 17:56:10
问题 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

pagerank implementation in java

99封情书 提交于 2019-12-21 05:43:04
问题 I am looking for a java implementation of the pagerank algorithm. 回答1: 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

How can I integrate stanford parser software in my java program? [closed]

依然范特西╮ 提交于 2019-12-21 02:43:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . I have to develop a project in java that uses a Stanford parser to separate the sentences and has to generate a graph that shows the relation between the words in a sentence. for example: Ohio is located in America. Output: the image shows the graph. But the output need not be the