JGraphX is an open source Java Swing Component. It is the architecture written after JGraph 5, but not named JGraph 6 because it is rewritten and the API is entirely different.
Questions tagged [jgraphx]
182 questions
2
votes
0 answers
How to copy a generic graph in jGraphX?
I'm having problems copying a graph in jgraphX. The example given by the author doesnt appear to clone recursively the children of the default parent:
graph2.addCells(graph1.cloneCells(graph1.getChildCells(graph1.getDefaultParent())));
There is a…

fig
- 732
- 1
- 8
- 14
1
vote
1 answer
How to turn off the edge labels in JGraphX?
I am trying to create a JGraphXAdapter which receives a directed graph as a constructor argument and applied a mxHierarchicalLayout to it. Then, I use mxCellRenderer to create a BufferedImage and write the visualization to a png file.
The problem is…

Hafthor94
- 11
- 1
1
vote
0 answers
Detect if a node when dropped/moved intersects another node - mxgraph
I am trying to detect if any part of cell node intersects with another cell when u move a cell and some of its body intersects with another node. I tried to write my own custom mouseUp function such that if the there's some intersection, I'll…

user3775998
- 1,393
- 3
- 13
- 22
1
vote
0 answers
jGraphX - Import XML and get it's vertices and edges
I am trying to import an xml file into a graph object and then iterate through its children (vertices && edges). I am trying the following but does not work for me
String xml = " ...... ";
mxGraph graph = new…

NickAth
- 1,089
- 1
- 14
- 35
1
vote
0 answers
Trying to construct and visualize a Gomory-Hu-Tree using JGraphT and JGraphX
I'm trying to construct and visualize a Gomory-Hu Tree using JGraphT and JGraphX. By reading tutorials or other questions, I've managed to implement a simple weighted graph and a resulting Gomory-Hu Tree.
Now I want to visualize the resulting Tree.…

Infty
- 13
- 4
1
vote
1 answer
JGraphX. Changing the thickness or diameter of edges
I am using jgraphx library to draw some graphs in java. After zooming the graph, the edges become more thick. So i want to make the change of the sizes (or thikcness) of the edges dynamically with the scale zoom. My question is how can i change the…

Younes Meridji
- 149
- 5
1
vote
0 answers
Styling JgraphT graph visualized in JGraphX
I am trying to set cell style for a graph created with JgraphT and displayed using JGraphX. I was able to successfully set cell style for a graph created directly in JGraphX. Here is the code:
import javax.swing.JFrame;
import…

Anonimista
- 185
- 1
- 11
1
vote
1 answer
Create reversed mxHierarchical layout in mxgraph
Greetings to the community! I am currently creating a custom mxgraph editor and I am converting the graphs using different layouts. I would like to convert my graph layout into an mxHierarchicalLayout but reversed (instead of top-to-down I would…

NickAth
- 1,089
- 1
- 14
- 35
1
vote
1 answer
JGraphX new initialization of graph/graphComponent does not work as expected and causes artefacts
Hi I am using JGraphX to build some kind of Java swing based graph editor application. The application in general works fine and as intended under normal
circumstances. In general I have an class called Editor which contains all essential…

Patrick P.
- 25
- 6
1
vote
0 answers
Add focus event on an element in a graph with jgraphx
I'm working with JGraphx in Java.
I have a BD with a huge ammount of elements, and I want to show in a graph just one node (the "origin") and its related ones to a certain order.
The idea is to be able to "click" in one of these nodes, making this…

TheChosenPie
- 11
- 5
1
vote
0 answers
JGraphx how to export SVG file from graph
I'm using JGraphx, and I want to put export graph to an SVG file.
I tried
Document document = (Document) mxCellRenderer.createSvgDocument(safetyTreeGraph, null, 1, Color.WHITE, null);, but I don't know how to output that SVG document to local. So…

lution
- 81
- 12
1
vote
1 answer
Save and load graph in xml file using JGraphx
In JGraphx, it is possible to draw custom vertex. I defined the custom object and used that as the value of the vertex. To save and load the graph as xml file, the custom object has been registered as follows:
mxCodecRegistry.addPackage(the path of…

Matin Meskin
- 86
- 9
1
vote
1 answer
Edges don't allow me to choose exact points in source or target [mxgraph]
Good morning,
I'm developing a tool for modelling graphs and I don't see how an edge can be painted choosing both terminal points. If I have an elbow, I can define where one of the terminal points will be but the other terminal point may or not be…

jevora
- 469
- 1
- 5
- 14
1
vote
0 answers
JGraphx - How to avoid edges from overlaping?
I saw some other similar questions (e.g.: https://stackoverflow.com/questions/28771698/jgraphx-how-to-avoid-adding-edges-over-each-other#=)
..but they didn't solve my problem. I have a graph with more them 2 edges between 2 vertices, but they are…

Larissa Rocha
- 11
- 1
1
vote
1 answer
Vertex Attributes in JGraphX
I'd like to know if there is a list of possible attributes (and their possible values) to use when creating a new vertex in JGraphX.
I know the method is graph.insertVertex(parent, null, vertexText, 0, 0, width, height,…

b00n
- 68
- 7