Make your own free website on Tripod.com
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Graph.GraphEventsCollector

java.lang.Object
   |
   +----java.awt.Component
           |
           +----Graph.GraphEventsCollector

public abstract class GraphEventsCollector
extends Component
implements KeyListener, MouseListener, MouseMotionListener
This class serves as a basis for development of Collectors - that do all of the actual editing, manipulating stretching, folding etc. of the graphs. Collectors, recieve (user generated) events from all objects on the Graph Panel (and the Graph Panel, itself). These events, and their sequences have different meaning, in different contexts (node or edge drawing, for example). This is where the semantics is resolved, and actions over the graph are performed accordingly (placing the node if mouse click occured on the graph panel in the Node Draw Collector). To succesfully design a new Collector class, you have to design your own schemes of events, and how you want them to be processed. Familiarity with Hashtable is essential, since edges and nodes are stored in hashtables in the GraphDisplay. As for composing several Collectors, at this time there is a rudimentary support for this kind of collector construction. You can create Host and Extension Collectors - Extension Collectors are hosted by the Hosts. For example how this works, take a look at the Selection (host) and Movement (extension) Collectors. Movement is activated on the top of Selection, so that selected nodes and edges can be moved around. While Movement Collector accepts events, and moves nodes, Selection displays marks on the selected Edges, and can be used for copy-pasting/deleting parts of the Graph.

See Also:
GraphDisplay, SelectionCollector, MovementCollector

Constructor Index

 o GraphEventsCollector()

Method Index

 o close()
 o getGraphDisplay()
 o keyPressed(KeyEvent)
keyPressed method comment.
 o keyReleased(KeyEvent)
keyReleased method comment.
 o keyTyped(KeyEvent)
keyTyped method comment.
 o mouseClicked(MouseEvent)
mouseClicked method comment.
 o mouseDragged(MouseEvent)
mouseDragged method comment.
 o mouseEntered(MouseEvent)
mouseEntered method comment.
 o mouseExited(MouseEvent)
mouseExited method comment.
 o mouseMoved(MouseEvent)
mouseMoved method comment.
 o mousePressed(MouseEvent)
mousePressed method comment.
 o mouseReleased(MouseEvent)
mouseReleased method comment.
 o paint(Graphics)
 o setGraphDisplay(GraphDisplay)
 o update(Graphics)

Constructors

 o GraphEventsCollector
 public GraphEventsCollector()

Methods

 o close
 public abstract void close()
 o getGraphDisplay
 public GraphDisplay getGraphDisplay()
 o keyPressed
 public void keyPressed(KeyEvent e)
keyPressed method comment.

 o keyReleased
 public void keyReleased(KeyEvent e)
keyReleased method comment.

 o keyTyped
 public void keyTyped(KeyEvent e)
keyTyped method comment.

 o mouseClicked
 public void mouseClicked(MouseEvent e)
mouseClicked method comment.

 o mouseDragged
 public void mouseDragged(MouseEvent e)
mouseDragged method comment.

 o mouseEntered
 public void mouseEntered(MouseEvent e)
mouseEntered method comment.

 o mouseExited
 public void mouseExited(MouseEvent e)
mouseExited method comment.

 o mouseMoved
 public void mouseMoved(MouseEvent e)
mouseMoved method comment.

 o mousePressed
 public void mousePressed(MouseEvent e)
mousePressed method comment.

 o mouseReleased
 public void mouseReleased(MouseEvent e)
mouseReleased method comment.

 o paint
 public void paint(Graphics g)
Overrides:
paint in class Component
 o setGraphDisplay
 public void setGraphDisplay(GraphDisplay graphDisplay)
 o update
 public void update(Graphics g)
Overrides:
update in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index