Thread: RE: [jgrapht-users] Specifying edges' appearance
Brought to you by:
barak_naveh,
perfecthash
From: <Tom...@lo...> - 2005-06-22 09:34:34
|
Dear all, I've managed to overcome my little problem by creating a new kind of JGraphT Edge (ObjectHolderDirectedEdge extends DirectedEdge), and using it for my project. By overriding it's toString() method I got the desired customization (it also holds a value, hence it's name). best, tom. |
From: Kyle L. <ky...@ar...> - 2005-06-23 13:22:11
|
Can you cut and paste the toString() code? I would like to know what you mean by cusomizing the look. Your original post seemed to indicate you wanted to change the graphical look (somehow interfacing with jgraph to change vertex and edge graphics). But your recent post indicates you just wanted to change the text. Which was it? Thanks. Tomás Laurenzo wrote: > Dear all, > > > > I've managed to overcome my little problem by creating a new kind of > JGraphT Edge (ObjectHolderDirectedEdge extends DirectedEdge), and using > it for my project. > > By overriding it's toString() method I got the desired customization > (it also holds a value, hence it's name). > > best, > tom. > > > > ------------------------------------------------------- > SF.Net email is sponsored by: Discover Easy Linux Migration Strategies > from IBM. Find simple to follow Roadmaps, straightforward articles, > informative Webcasts and more! Get everything you need to get up to > speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users > -- ---------------------------------------------------------------------- Kyle Lahnakoski ky...@ar... (416) 892-7784 Arcavia Software Ltd |
From: <Tom...@lo...> - 2005-06-23 13:30:29
|
Dear Kyle, I at first wanted to customize both the graphical appearance and the text. As you say, by overriding the toString() method I only can change it's text. Sadly, the graphical customization remains unsolved. best, tom. Kyle Lahnakoski wrote: > Can you cut and paste the toString() code? I would like to know what > you mean by cusomizing the look. Your original post seemed to > indicate you wanted to change the graphical look (somehow interfacing > with jgraph to change vertex and edge graphics). But your recent post > indicates you just wanted to change the text. > > Which was it? > > Thanks. > > > Tomás Laurenzo wrote: > >> Dear all, >> >> >> >> I've managed to overcome my little problem by creating a new kind of >> JGraphT Edge (ObjectHolderDirectedEdge extends DirectedEdge), and using >> it for my project. >> >> By overriding it's toString() method I got the desired customization >> (it also holds a value, hence it's name). >> >> best, >> tom. >> >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >> from IBM. Find simple to follow Roadmaps, straightforward articles, >> informative Webcasts and more! Get everything you need to get up to >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >> _______________________________________________ >> jgrapht-users mailing list >> jgr...@li... >> https://lists.sourceforge.net/lists/listinfo/jgrapht-users >> > > |
From: <Tom...@lo...> - 2005-06-24 12:47:32
|
Dear Kyle et al, I've solved my little problem and I'm posting the resulting code here. I'm afraid that the code it's really kludgy, but as I've seen that this is a common problem, I'm pasting it hoping that it will be useful to someone. // first we create an add the edge ObjectHolderDirectedEdge edge = new ObjectHolderDirectedEdge(firstNode, secondNode, anObject); graph.addEdge(edge); // graph is a JGraphT ListenableGraph // then we modify it's appearance Map nested = new Hashtable(); Map attributeMap = new Hashtable(); DefaultGraphCell edgeCell = jgraphAdapter.getEdgeCell(edge); // jgraph is, obviously a JGraph object. // jgraphAdapter is a JGraphModelAdapter GraphConstants.setLineColor(attributeMap, Color.BLUE); GraphConstants.setLineEnd(attributeMap, GraphConstants.ARROW_TECHNICAL); GraphConstants.setEditable(attributeMap, false); nested.put(edgeCell, attributeMap); jgraph.getGraphLayoutCache().edit(nested, null, null, null); hth. best to all, tom. Kyle Lahnakoski wrote: > Can you cut and paste the toString() code? I would like to know what > you mean by cusomizing the look. Your original post seemed to > indicate you wanted to change the graphical look (somehow interfacing > with jgraph to change vertex and edge graphics). But your recent post > indicates you just wanted to change the text. > > Which was it? > > Thanks. > > > Tomás Laurenzo wrote: > >> Dear all, >> >> >> >> I've managed to overcome my little problem by creating a new kind of >> JGraphT Edge (ObjectHolderDirectedEdge extends DirectedEdge), and using >> it for my project. >> >> By overriding it's toString() method I got the desired customization >> (it also holds a value, hence it's name). >> >> best, >> tom. >> >> >> >> ------------------------------------------------------- >> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies >> from IBM. Find simple to follow Roadmaps, straightforward articles, >> informative Webcasts and more! Get everything you need to get up to >> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click >> _______________________________________________ >> jgrapht-users mailing list >> jgr...@li... >> https://lists.sourceforge.net/lists/listinfo/jgrapht-users >> > > |