|
From: SourceForge.net <no...@so...> - 2007-02-07 19:37:14
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4145682 By: pandemic73 Hi, I have 4 copies of Graph A, but when A and the copies are rendered in 5 separate JFrames, the vertex placement is of course different in all of them. So, it is very hard to instantly navigate the graph and identify which vertex is which (despite the labels). So I want to copy the location of all the Vertices in Graph A into the 4 copies of A. Or in other words, reproduce the layout of graph A, so they all look identical. As the copies are in fact graph.copy()'ies, I can traverse each vertex in each copy and manually use getEquivalent to identify the original Vertex, and then get the position of that vertex and.. hopefully copy it into the equivalent vertex. Cause I am guessing as the position of a vertexA can be obtained through someLayoutX.getLocation(vertexA), the position of the vertexB in someLayoutY can be given the same coordinates? However, I have not managed to locate any setX og setPostion.. only get methods. Which is why I feel maybe there is a smart(er) way to do this.. If you understand what I want to do, and have any ideas - let me know. I wold greatly appreciate it! /Pan ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |
|
From: SourceForge.net <no...@so...> - 2007-02-07 19:48:05
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4145703 By: e-flat Pan: Once you've laid out the first graph to your satisfaction, you can use the vertex positions from that graph for the others, by passing the first Layout to the others as an optional argument to the initialize() method. (By default, initialize() uses random vertex locations as a starting point, but it can take a VertexLocationDecorator as a parameter--and Layout implements VLD.) Even easier: lay the first one out, and use a StaticLayout for the others (again, initialized using the first one). If you want to do this manually for some reason, check out Layout.forceMove() and Layout.lockVertex(). (I agree that forceMove() is not the most intuitive name for the method.) Joshua ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |
|
From: SourceForge.net <no...@so...> - 2007-02-08 17:01:58
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4147446 By: pandemic73 Thanks Joshua, The good thing is I am already using the StaticLayout for the copies, and the ISOMLayout for the original. The sad thing is that I do not understand how to do this.. arg. This is how I currently display the graph copies: --- 8< ------ sl_ = new StaticLayout(topology_); cr_ = new ConfigurationRenderer(ps); vv_ = new VisualizationViewer(sl_, cr_); vv_.setPickedState(ps); jf_.getContentPane().add(vv_); ------------ And I tried to add this line after creating the StaticLayout (top line in the snipet): sl_.initialize(orgLayout.getCurrentSize(), orgLayout); However, that did not go very well. Eh... nullpointer. I will continue to try to understand this, but if you *know* the answer, let me know. Thanks, Pan ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |
|
From: SourceForge.net <no...@so...> - 2007-02-08 23:12:05
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4148058 By: pandemic73 Not a chance.. I do not understand this at all. Please, advise. What and how do I provide to the graph copies using StaticLayout so that the vertex layout is similar to the original graph? In Joshuas answer it simply seemed like all I had to do was pass the layout of the original graph.. However that and any other wild attempt of getting it to work fails.. miserably. This is what I do: sl_ = new StaticLayout(topology_); // sl_.initialize(new Dimension(600, 622)); // this works sl_.initialize(new Dimension(600, 622), (VertexLocationFunction) orgLayout); // this does not This is what I get after doing the above: --- 8< --------- Exception in thread "main" java.lang.NullPointerException at java.awt.geom.Point2D.setLocation(Point2D.java:241) at edu.uci.ics.jung.visualization.AbstractLayout.initializeLocation(Abst ractLayout.java:196) at edu.uci.ics.jung.visualization.AbstractLayout.initializeLocations(Abs tractLayout.java:174) at edu.uci.ics.jung.visualization.AbstractLayout.initialize(AbstractLayo ut.java:114) at no.gatada.sak.simulator.Configuration.displayJFrame(Configuration.jav a:421) .... ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |
|
From: SourceForge.net <no...@so...> - 2007-02-08 23:15:11
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4148064 By: e-flat Pan: Have you actually visualized the first graph? If you haven't, it won't yet have vertex positions that it can give to the other layouts. You need to do this first. (Technically you don't have to actually visualize it--you can just advance the layout yourself--but visualizing it may be the easiest way to do it. Tom may be able to give you better advice.) Joshua ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |
|
From: SourceForge.net <no...@so...> - 2007-02-09 01:31:34
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4148212 By: tomnelson What graph does orgLayout have? Is it the same graph as _topology? If not, orgLayout will have no locations for the _topology vertices in your static layout to use. Tom Nelson ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |
|
From: SourceForge.net <no...@so...> - 2007-02-09 08:55:17
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4148620 By: pandemic73 Tom / Joshua: Well, they are as mentioned all copies of the same graph: // copying the graph topology_ = (Graph) graph.copy(); I get a feeling I will have to manually do the equivalent trick on all vertices in all the copies? Starting to look into the forceMove() and lockVertex() to do this manually. Correct me if this is not the easiest way. Thanks! :-) ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=252062 |