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 ChainsawStatusBar.java
Date Wed, 17 Sep 2003 07:31:25 GMT
psmith      2003/09/17 00:31:25

  Modified:    src/java/org/apache/log4j/chainsaw ChainsawStatusBar.java
  Log:
  moved the 3 elements; current:filtered:unfiltered into 2 status
  bar elements, current & then filtered:unfiltered.  Looks cleaner.
  
  Also adjusted the order of the status bar elements, and
  tweaked the sizes.
  
  Revision  Changes    Path
  1.4       +28 -11    jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java
  
  Index: ChainsawStatusBar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChainsawStatusBar.java	17 Sep 2003 01:24:07 -0000	1.3
  +++ ChainsawStatusBar.java	17 Sep 2003 07:31:25 -0000	1.4
  @@ -53,6 +53,7 @@
   
   import java.awt.Dimension;
   import java.awt.FlowLayout;
  +import java.awt.Font;
   import java.awt.GridBagConstraints;
   import java.awt.GridBagLayout;
   import java.awt.Insets;
  @@ -81,6 +82,7 @@
     private final JLabel statusMsg = new JLabel(DEFAULT_MSG);
     private final JLabel pausedLabel = new JLabel("", JLabel.CENTER);
     private final JLabel lineSelectionLabel = new JLabel("", JLabel.CENTER);
  +  private final JLabel eventCountLabel = new JLabel("", JLabel.CENTER);
     private final JLabel receivedEventLabel = new JLabel("0.0", JLabel.CENTER);
     private final JLabel receivedConnectionlabel = new JLabel("", JLabel.CENTER);
     private volatile long lastReceivedEvent = System.currentTimeMillis();
  @@ -120,9 +122,17 @@
       receivedEventLabel.setMinimumSize(
         new Dimension(
           receivedEventLabel.getFontMetrics(receivedEventLabel.getFont())
  -                          .stringWidth("999.9/s") + 10,
  +                          .stringWidth("999.9/s") + 5,
           (int) receivedEventLabel.getPreferredSize().getHeight()));
   
  +	eventCountLabel.setBorder(statusBarComponentBorder);
  +	eventCountLabel.setToolTipText("<# viewable events>:<# total events>");
  +	eventCountLabel.setMinimumSize(
  +	new Dimension(
  +	eventCountLabel.getFontMetrics(eventCountLabel.getFont())
  +						.stringWidth("9999:9999") + 5,
  +	  (int) eventCountLabel.getPreferredSize().getHeight()));
  +	  
       receivedConnectionlabel.setBorder(statusBarComponentBorder);
       receivedConnectionlabel.setToolTipText(
         "Indicates whether Chainsaw has received a remote connection");
  @@ -135,13 +145,14 @@
       lineSelectionLabel.setMinimumSize(
         new Dimension(
           lineSelectionLabel.getFontMetrics(lineSelectionLabel.getFont())
  -                          .stringWidth("999999:999999:999999"),
  +                          .stringWidth("999999"),
           (int) lineSelectionLabel.getPreferredSize().getHeight()));
       lineSelectionLabel.setToolTipText(
  -      "<current line #>:<# viewable events>:<# total events>");
  +      "The current line # selected");
   
       JComponent[] toFix =
         new JComponent[] {
  +		eventCountLabel,
           receivedConnectionlabel, lineSelectionLabel, receivedEventLabel,
           pausedLabel
         };
  @@ -172,19 +183,24 @@
       c.gridx = 1;
       add(receivedConnectionlabel, c);
   
  -    c.weightx = 0.0;
  -    c.weighty = 0.0;
  -    c.gridx = 2;
  -    add(receivedEventLabel, c);
  +	c.weightx = 0.0;
  +	c.weighty = 0.0;
  +	c.gridx = 2;
  +	add(lineSelectionLabel, c);
  +	
  +	c.weightx = 0.0;
  +	c.weighty = 0.0;
  +	c.gridx = 3;
  +	add(eventCountLabel, c);
   
       c.weightx = 0.0;
       c.weighty = 0.0;
  -    c.gridx = 3;
  -    add(lineSelectionLabel, c);
  +    c.gridx = 4;
  +    add(receivedEventLabel, c);
   
       c.weightx = 0.0;
       c.weighty = 0.0;
  -    c.gridx = 4;
  +    c.gridx = 5;
   
       add(pausedLabel, c);
   
  @@ -264,7 +280,8 @@
         new Runnable() {
           public void run() {
             lineSelectionLabel.setText(
  -            selectedLine + ":" + lineCount + ":" + total);
  +            selectedLine+"");
  +			eventCountLabel.setText(selectedLine==0?"":lineCount + ":" + total);
           }
         });
     }
  
  
  

---------------------------------------------------------------------
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