MouseAdaptedTreeMouseHandler Issue

Help
2004-11-04
2013-03-08
  • Scott Y. Hong
    Scott Y. Hong
    2004-11-04

    What's the design reason that the following events
    are not overloaded in MouseAdaptedTreeMouseHandler

    mouseEntered(MouseEvent event)
    mouseExited(MouseEvent event)

    Thanks

     
    • Hi Scott,

      Good to see you here. I had implemented these method calls in earlier MouseAdaptedTreeMouseHandler. It looked as

      public void mouseEntered(MouseEvent e) {
          MouseListener node = getNode(e);
          if (node != null) {
              node.mouseEntered(e);
          }
      }

      However soon I realized that a listener will receive mouseEntered() or mouseExited() only after the mouse enters or exits a Tree component at all, but not each particular node! So I removed them from a handler.

      Implementing mouseEntered() and mouseExited() would require working with MouseMotionListener.mouseMoved(), and I'm not sure how well it will work because a tree node is not actually treated as a Swing component. If you want, you could move in this direction, and contribute your findings back to our project.

      Thank you for interest in dotuseful project.

      Denis Krukovsky.