|
From: Jesus M. S. Jr. <jm...@ih...> - 2001-04-30 11:52:45
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The way it works is that GraphPanel implements the MouseListener and MouseMotionListener interfaces. Thus, you will see the mouseXXX() methods on the GraphPanel class. These methods simply delegates the actual action depending on the state ( as in the state pattern on the GoF book ) of the GraphPanel class. The states are Normal, Vertex, and Edge states. These states correspond to the three buttons ( save for the Layout button ) that you see using GraphEditor. These states correspond to the classes GraphPanelNormalState, GraphPanelVertexState, GraphPanelEdgeState ... all of which inherit from GraphPanel abstract class. Finally, these state classes passes on the mouse events to the VisualGraphComponent ( if any ) via the processMouseEvent() and processMouseMotionEvent() methods of the VisualGraphComponent interface. GraphPanel ---( delegates to ) --- > state class ---- ( passes event to ) - ---> VisualGraphComponent HTH, John On Mon, 30 Apr 2001 09:41, Patrick Hartling wrote: > I am just getting started with OpenJGraph, and I was wondering if it is > possible to know when a node in a graph is selected. For the project I > am working on, I would like to be able to select a node in the graph and > have a JTable be updated based on the selection. Thanks. > > -Patrick > > > Patrick L. Hartling | Research Assistant, VRAC > pa...@13... | 2624 Howe Hall -- (515)294-4916 > http://www.137.org/patrick/ | http://www.vrac.iastate.edu/ > > _______________________________________________ > Openjgraph-development mailing list > Ope...@li... > http://lists.sourceforge.net/lists/listinfo/openjgraph-development -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.4 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjrtUwUACgkQAvd5SY4qWYyZwQCgub7it55vUgPPZjgPhMJPuaCe OUQAn3W+sIvPS7nYMZsIeeqhVYJDa0r0 =Jgg8 -----END PGP SIGNATURE----- |