From: SourceForge.net <no...@so...> - 2007-03-26 22:08:10
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4229076 By: gregbern Hi folks I've updated/added more stuff to the running JUNG2 tutorial at http://www.grotto-networking.com/JUNG/ In addition, based on Tom's suggestion (but probably needing a bunch of polishing) I worked though an example with context sensitive mouse menus. This means that I wrote a fairly generic graph mouse plugin whose function is to bring up different popup menus depending on whether a node or vertex is right clicked. I copied several of the notions from other JUNG2 code so the good ideas are from JUNG the bad ideas are from me ;-) Pictures of the output are given in section 5.5 of the JUNG2 (unofficial) tutorial (pdf or odt format). How this works is that you feed two JPopupMenus to the constructor for the new menu mouse plugin thingy. Under the appropriate mouse click the plugin is activated if a vertex is selected the vertex popup will be brought up, similarly for the edge popup. Prior to actually showing the popup the components of the popup are scanned to see if they implement a simple "edge listener" or "vertex listener" interface, if so they are fed the selected edge or vertex (and some support info). Note that because mouse menus are also used for deleting edges and vertices, I also implemented to generic (works with user defined edge/vertex) deletion menu items that can be added to the users edge and vertex popups. The code for this more elaborate example is in the directory http://www.grotto-networking.com/JUNG/MouseMenu/ The one example dialog was developed with swing layout extensions (aka Netbeans). This can be changed for more portability if there is sufficient interest in this example/application. Regards Greg B. ______________________________________________________________________ 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 |