logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From psm...@apache.org
Subject cvs commit: jakarta-log4j/src/java/org/apache/log4j/chainsaw LoggerNameTreePanel.java
Date Fri, 12 Dec 2003 21:44:58 GMT
psmith      2003/12/12 13:44:58

  Modified:    src/java/org/apache/log4j/chainsaw LoggerNameTreePanel.java
  Log:
  beginnings of some work to improve usability of the focus on, ignore logger.
  within the Logger name tree panel.
  
  If you hold down CTRL the mouse icon changes to a Focus On icon.  
  This will eventually be hooked up so that while holding down CTRL
  and double clicking you can focus on a logger.
  
  Holding down CTRL+SHIFT will be the ignore action.
  
  This mimics the way Photoshop's zoom works.
  
  Revision  Changes    Path
  1.17      +27 -0     jakarta-log4j/src/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
  
  Index: LoggerNameTreePanel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- LoggerNameTreePanel.java	12 Dec 2003 10:28:20 -0000	1.16
  +++ LoggerNameTreePanel.java	12 Dec 2003 21:44:58 -0000	1.17
  @@ -53,12 +53,17 @@
   
   import java.awt.BorderLayout;
   import java.awt.Component;
  +import java.awt.Cursor;
   import java.awt.Dimension;
   import java.awt.Font;
  +import java.awt.Point;
  +import java.awt.Toolkit;
   import java.awt.event.ActionEvent;
   import java.awt.event.InputEvent;
   import java.awt.event.MouseAdapter;
   import java.awt.event.MouseEvent;
  +import java.awt.event.MouseMotionAdapter;
  +import java.awt.event.MouseMotionListener;
   import java.beans.PropertyChangeEvent;
   import java.beans.PropertyChangeListener;
   import java.util.ArrayList;
  @@ -118,6 +123,26 @@
    * @author Paul Smith <psmith@apache.org>
    */
   final class LoggerNameTreePanel extends JPanel implements Rule {
  +  private final class MouseKeyIconListener
  +    extends MouseMotionAdapter
  +    implements MouseMotionListener {
  +    Cursor focusOnCursor = Toolkit.getDefaultToolkit().createCustomCursor(ChainsawIcons.FOCUS_ON_ICON.getImage(),
new Point(0,0), "");
  +    Cursor ignoreCursor = Toolkit.getDefaultToolkit().createCustomCursor(ChainsawIcons.IGNORE_ICON.getImage(),
new Point(0,0), "");
  +      /* (non-Javadoc)
  +     * @see java.awt.event.MouseMotionListener#mouseMoved(java.awt.event.MouseEvent)
  +     */
  +    public void mouseMoved(MouseEvent e) {
  +//      LogLog.debug(e.toString());
  +      if((e.getModifiers() & InputEvent.CTRL_MASK)>0 && (e.getModifiers()
& InputEvent.SHIFT_MASK)>0) {
  +        logTree.setCursor(ignoreCursor);
  +      }else if((e.getModifiers() & InputEvent.CTRL_MASK)>0) {
  +        logTree.setCursor(focusOnCursor);
  +      }else {
  +        logTree.setCursor(Cursor.getDefaultCursor());
  +      }
  +    }
  +
  +}
     private static final int WARN_DEPTH = 4;
     private final JTree logTree;
     private final JScrollPane scrollTree;
  @@ -490,6 +515,8 @@
       * this Class.
       */
     private void setupListeners() {
  +    
  +    logTree.addMouseMotionListener(new MouseKeyIconListener());
       /**
          * Enable the actions depending on state of the tree selection
          */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org


Mime
View raw message