psmith      2003/06/19 22:22:10

  Modified:    src/java/org/apache/log4j/chainsaw ReceiversPanel.java
  Log:
  makes a lot more sense to make the ReceiversToolbar extend
  from JToolbar than be some funky JPanel.
  
  Revision  Changes    Path
  1.9       +14 -27    
jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/ReceiversPanel.java
  
  Index: ReceiversPanel.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/ReceiversPanel.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ReceiversPanel.java       20 Jun 2003 04:51:02 -0000      1.8
  +++ ReceiversPanel.java       20 Jun 2003 05:22:09 -0000      1.9
  @@ -63,8 +63,6 @@
   import java.awt.Dimension;
   import java.awt.Graphics;
   import java.awt.Graphics2D;
  -import java.awt.GridBagConstraints;
  -import java.awt.GridBagLayout;
   import java.awt.RenderingHints;
   import java.awt.event.ActionEvent;
   
  @@ -85,6 +83,7 @@
   import javax.swing.JPanel;
   import javax.swing.JPopupMenu;
   import javax.swing.JScrollPane;
  +import javax.swing.JToolBar;
   import javax.swing.JTree;
   import javax.swing.SwingUtilities;
   import javax.swing.event.TreeSelectionEvent;
  @@ -329,15 +328,14 @@
      * @author Paul Smith <[EMAIL PROTECTED]>
      *
      */
  -  private class ReceiverToolbar extends JPanel implements TreeSelectionListener {
  +  private class ReceiverToolbar extends JToolBar
  +    implements TreeSelectionListener {
       final Action playReceiverButtonAction;
       final Action shutdownReceiverButtonAction;
       final Action pauseReceiverButtonAction;
   
       private ReceiverToolbar() {
  -      setLayout(new GridBagLayout());
  -
  -      GridBagConstraints c = new GridBagConstraints();
  +      setFloatable(false);
   
         playReceiverButtonAction =
           new AbstractAction() {
  @@ -392,22 +390,12 @@
         SmallButton restartAllButton = new SmallButton(startAllAction);
         restartAllButton.setText(null);
   
  -      c.weightx = 0.0;
  -      c.weighty = 0.0;
  -      c.ipadx = 1;
  -      c.ipady = 1;
  -      c.fill = GridBagConstraints.NONE;
  -      c.anchor = GridBagConstraints.WEST;
  -
  -      add(restartAllButton, c);
  -
  -      add(playReceiverButton, c);
  -      add(pauseReceiverButton, c);
  -      add(shutdownReceiverButton, c);
  -
  -      c.weightx = 1.0;
  -      c.weighty = 1.0;
  -      c.anchor = GridBagConstraints.EAST;
  +      add(playReceiverButton);
  +      add(pauseReceiverButton);
  +      add(shutdownReceiverButton);
  +
  +      addSeparator();
  +      add(restartAllButton);
   
         Action closeAction =
           new AbstractAction(null, new CloseIcon(8, 1, 1)) {
  @@ -419,12 +407,11 @@
         closeAction.putValue(
           Action.SHORT_DESCRIPTION, "Closes the Receiver panel");
   
  -      add(new SmallButton(closeAction), c);
  +      add(Box.createHorizontalGlue());
  +
  +      add(new SmallButton(closeAction));
   
  -      c.weightx = 0;
  -      c.ipadx = 0;
  -      c.ipady = 0;
  -      add(Box.createHorizontalStrut(5), c);
  +      add(Box.createHorizontalStrut(5));
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to