/**
  * Handles mouse moved events.
  *
  * @param e the mouse event
  */
 public void mouseMoved(MouseEvent e) {
   TreePath path = tree.getPathForLocation(e.getX(), e.getY());
   if (path == null) return;
   if (e.getX() > tree.getPathBounds(path).x + hotspot - 3
       || e.getX() < tree.getPathBounds(path).x + 2) tree.setCursor(Cursor.getDefaultCursor());
   else {
     tree.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
   }
 }
Example #2
0
    public synchronized void actionPerformed(ActionEvent e) {
      HelpModel helpmodel = searchnav.getModel();
      try {
        if (paramCursor == null) {
          paramCursor = searchparams.getCursor();
        }
        if (treeCursor == null) {
          treeCursor = tree.getCursor();
        }
        if (waitCursor == null) {
          waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
        }
        searchparams.setCursor(waitCursor);
        tree.setCursor(waitCursor);

        if (helpsearch == null) {
          debug("helpsearch is null");
          helpsearch = searchnav.getSearchEngine();
          searchquery = helpsearch.createQuery();
          searchquery.addSearchListener(BasicSearchNavigatorUI.this);
        }
        debug("click on search w/: " + searchparams.getText());
        if (searchquery.isActive()) {
          searchquery.stop();
        }
        searchquery.start(searchparams.getText(), searchnav.getLocale());
      } catch (Exception e2) {
        searchparams.setCursor(paramCursor);
        tree.setCursor(treeCursor);
        // more work needed here
        e2.printStackTrace();
        // 2 beeps
        searchnav.getToolkit().beep();
        searchnav.getToolkit().beep();
      }
    }