Bonjour à tous,

Je suis en train de créer un graphe avec Jung, que j'aimerais afficher grâce à un CircleLayout. Tout se passe bien jusqu'à l'affichage, puisque tous mes sommets et mes liens se trouvent superposés en haut à gauche de ma fenêtre. Ayant essayé avec les autres layout de Jung, il se trouve que seul le DAGLayout me donne un affichage "normal". Tous les autres me produise la même superposition en haut à gauche. Voici le code de création de mon graphe. Est-ce que quelqu'un aurait une idée ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 
public class	ContactView extends JFrame {
 
	private Graph effectiveGraph;
	private Graph authGraph;
	private Collection<String> allVertices;
	private Collection<String> allEdges;
	private JFrame jf; 
	DAGLayout<String,String> layoutEffectiveGraphe;
	CircleLayout<String,String> layoutAuthGraph;
	BasicVisualizationServer<String,String> effectiveVv;
	BasicVisualizationServer<String,String> authVv;
 
	JPanel authPanel;
	JPanel effectivePanel;
	JTabbedPane mainPanel;
 
 
	public ContactView(String title, String agentPath, String resPath){
 
		addWindowListener(new WindowAdapter() {
			public void	windowClosing(WindowEvent e) { end(); }
		});
 
		effectiveGraph = new DirectedSparseGraph<String,String>();
		authGraph = new DirectedSparseGraph<String,String>();
 
		layoutEffectiveGraphe = new DAGLayout(effectiveGraph);
		layoutEffectiveGraphe.setSize(new Dimension(500,500));
 
		layoutAuthGraph = new CircleLayout(authGraph);
		layoutAuthGraph.setSize(new Dimension(500,500));
 
		authGraph.addVertex("contact1");
		authGraph.addVertex("contact2");
		authGraph.addVertex("contact3");
		authGraph.addVertex("contact4");
 
		authGraph.addEdge("lien1", "contact1", "contact2");
		authGraph.addEdge("lien2", "contact2", "contact4");
		authGraph.addEdge("lien3", "contact1", "contact4");
		authGraph.addEdge("lien4", "contact1", "contact3");
		authGraph.addEdge("lien5", "contact3", "contact1");
 
		effectiveVv = new BasicVisualizationServer(layoutEffectiveGraphe);
 
		effectiveVv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());	
		effectiveVv.setBackground(Color.WHITE);
 
		authVv = new BasicVisualizationServer(layoutAuthGraph);
 
		authVv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller());	
		authVv.setBackground(Color.WHITE);
 
 
		/*Initialisation GUI*/
		jf = new JFrame(title);
		jf.setSize(800, 600);	
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 
		mainPanel = new JTabbedPane();
 
		authPanel = new JPanel();
		effectivePanel = new JPanel();
 
		effectivePanel.setBackground(Color.WHITE);
		effectivePanel.add(effectiveVv);
 
		authPanel.setBackground(Color.WHITE);
		authPanel.add(authVv);
 
		mainPanel.addTab("Authorized contacts", authPanel);
		mainPanel.addTab("Effective contacts", effectivePanel);
 
		jf.getContentPane().add(mainPanel);
		jf.setVisible(true);
 
	}
}

Pour l'instant, seul le authGraph est "rempli", mais le soucis est le même avec effectiveGraph.

Merci d'avance.