.useful Home Page

org.dotuseful.ui.tree
Class MouseAdaptedTreeMouseHandler

java.lang.Object
  extended byjava.awt.event.MouseAdapter
      extended byorg.dotuseful.ui.tree.MouseAdaptedTreeMouseHandler
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener

public class MouseAdaptedTreeMouseHandler
extends java.awt.event.MouseAdapter

A mouse handler for MouseAdaptedTree which transmits mouse events to corresponding tree nodes. Tree nodes must implement MouseListener interface.
Unfortunately you can't transmit mouseEntered and mouseExited events in easy way because these events are fired for JTree component at all.

Author:
Denis Krukovsky

Constructor Summary
MouseAdaptedTreeMouseHandler()
           
 
Method Summary
protected  java.awt.event.MouseListener getNode(java.awt.event.MouseEvent e)
          Returns a tree node which is mouse event on.
protected  javax.swing.JTree getTree(java.awt.event.MouseEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseAdaptedTreeMouseHandler

public MouseAdaptedTreeMouseHandler()
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)

getNode

protected java.awt.event.MouseListener getNode(java.awt.event.MouseEvent e)
Returns a tree node which is mouse event on.

Parameters:
e - a mouse event to calculate the node to
Returns:
a tree node which is mouse event on, or null if there is no node.

getTree

protected javax.swing.JTree getTree(java.awt.event.MouseEvent e)

© 2004 .useful community

SourceForge.net-Logo