changeset 619:8172d6f0f918

Refactor header panel and thread record panel review-thread: http://icedtea.classpath.org/pipermail/thermostat/2012-September/003151.html reviewed-by: omajid
author Mario Torre <neugens.limasoftware@gmail.com>
date Tue, 18 Sep 2012 14:35:21 +0200
parents 6a179175bb1b
children cb5aa245e81f
files client/swing-components/src/main/java/com/redhat/thermostat/swing/ActionButton.java client/swing-components/src/main/java/com/redhat/thermostat/swing/ActionButtonUI.java client/swing-components/src/main/java/com/redhat/thermostat/swing/ActionToggleButton.java client/swing-components/src/main/java/com/redhat/thermostat/swing/EmptyIcon.java client/swing-components/src/main/java/com/redhat/thermostat/swing/GradientPanel.java client/swing-components/src/main/java/com/redhat/thermostat/swing/HeaderPanel.java client/swing-components/src/main/java/com/redhat/thermostat/swing/ShadowLabel.java client/swing-components/src/main/java/com/redhat/thermostat/swing/ToggleButton.java client/swing-components/src/main/java/com/redhat/thermostat/swing/ToolbarButton.java dolphin/src/main/java/com/redhat/swing/laf/dolphin/button/DolphinButtonUI.java thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/IconResources.java thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/ThreadDetailsView.java thread/client-common/src/main/resources/com/redhat/thermostat/thread/client/common/gtk-media-record.png thread/client-common/src/main/resources/com/redhat/thermostat/thread/client/common/record.png thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadView.java thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/ThreadAliveDaemonTimelinePanel.java thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/ThreadMainPanel.java thread/client-swing/src/test/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadViewTest.java
diffstat 18 files changed, 676 insertions(+), 323 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/ActionButton.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.swing;
+
+import javax.swing.AbstractButton;
+import javax.swing.Icon;
+import javax.swing.JButton;
+
+@SuppressWarnings("serial")
+public class ActionButton extends JButton implements ToolbarButton {
+
+    private AbstractButton realButton;
+    
+    public ActionButton(final Icon icon) {
+        super(icon);
+        
+        realButton = new JButton() {
+            @Override
+            public int getWidth() {
+                return icon.getIconWidth() + 5;
+            }
+            
+            @Override
+            public int getHeight() {
+                return icon.getIconHeight() + 4;
+            }
+        };
+        setUI(new ActionButtonUI(realButton));
+        
+        setSize(realButton.getWidth(), realButton.getHeight());
+        setContentAreaFilled(false);
+        
+        setPreferredSize(getSize());
+        setMinimumSize(getSize());
+        setMaximumSize(getSize());
+        
+        realButton.setModel(getModel());
+
+        setBorderPainted(false);
+    }
+    
+    @Override
+    public AbstractButton getToolbarButton() {
+        return this;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/ActionButtonUI.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.swing;
+
+import java.awt.Graphics;
+import java.awt.image.BufferedImage;
+import java.awt.image.BufferedImageOp;
+import java.awt.image.ConvolveOp;
+import java.awt.image.Kernel;
+
+import javax.swing.AbstractButton;
+import javax.swing.ButtonModel;
+import javax.swing.Icon;
+import javax.swing.JComponent;
+import javax.swing.border.Border;
+import javax.swing.plaf.metal.MetalButtonUI;
+
+class ActionButtonUI extends MetalButtonUI {
+
+    private BufferedImage sourceIcon;
+    private BufferedImage rollOverIcon;
+    private AbstractButton realButton;
+    
+    ActionButtonUI(AbstractButton button) {
+        this.realButton = button;
+    }
+    
+    private BufferedImage getBrighterImage(BufferedImage source) {
+        float[] kernel = new float[] { 0, 0, 0, 0, 1.2f, 0, 0, 0, 0 };
+
+        BufferedImageOp brighterOp = new ConvolveOp(new Kernel(3, 3, kernel),
+                ConvolveOp.EDGE_NO_OP, null);
+        return brighterOp.filter(source, new BufferedImage(source.getWidth(),
+                source.getHeight(), source.getType()));
+    }
+
+    @Override
+    public void paint(Graphics g, JComponent c) {
+
+        AbstractButton button = (AbstractButton) c;
+        ButtonModel model = button.getModel();
+        if (model.isPressed() || model.isArmed() || model.isSelected()) {
+            realButton.paint(g);
+        } else if (model.isRollover()) {
+            Border border = realButton.getBorder();
+            border.paintBorder(realButton, g, 0, 0, realButton.getWidth(),
+                    realButton.getHeight());
+        }
+        // paint the icon, always to the center
+        Icon icon = button.getIcon();
+        int w = icon.getIconWidth();
+        int h = icon.getIconHeight();
+
+        if (sourceIcon == null) {
+            sourceIcon = new BufferedImage(w + 1, h + 1,
+                    BufferedImage.TYPE_INT_ARGB);
+            Graphics imageGraphics = sourceIcon.getGraphics();
+            icon.paintIcon(null, imageGraphics, 0, 0);
+        }
+
+        if (rollOverIcon == null) {
+            rollOverIcon = getBrighterImage(sourceIcon);
+        }
+
+        int x = realButton.getWidth() / 2 - w / 2;
+        int y = realButton.getHeight() / 2 - h / 2;
+
+        if (model.isRollover()) {
+            g.drawImage(rollOverIcon, x, y, null);
+        } else {
+            g.drawImage(sourceIcon, x, y, null);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/ActionToggleButton.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.swing;
+
+import javax.swing.AbstractButton;
+import javax.swing.Icon;
+import javax.swing.JToggleButton;
+
+@SuppressWarnings("serial")
+public class ActionToggleButton extends JToggleButton implements ToolbarButton {
+    private AbstractButton realButton;
+    
+    public ActionToggleButton(final Icon icon) {
+        super(icon);
+        
+        realButton = new JToggleButton() {
+            @Override
+            public int getWidth() {
+                return icon.getIconWidth() + 4;
+            }
+            
+            @Override
+            public int getHeight() {
+                return icon.getIconHeight() + 4;
+            }
+        };
+        setUI(new ActionButtonUI(realButton));
+        
+        setSize(realButton.getWidth(), realButton.getHeight());
+        setContentAreaFilled(false);
+        
+        setPreferredSize(getSize());
+        setMinimumSize(getSize());
+        setMaximumSize(getSize());
+        
+        realButton.setModel(getModel());
+
+        setBorderPainted(false);
+    }
+    
+    @Override
+    public AbstractButton getToolbarButton() {
+        return this;
+    }    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/EmptyIcon.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.swing;
+
+import java.awt.Component;
+import java.awt.Graphics;
+
+import javax.swing.ImageIcon;
+
+@SuppressWarnings("serial")
+public class EmptyIcon extends ImageIcon  {
+
+    private int width;
+    private int height;
+    
+    public EmptyIcon() {
+        this(16, 16);
+    }
+    
+    public EmptyIcon(int width, int height) {
+        this.width = width;
+        this.height = height;
+    }
+    
+    @Override
+    public int getIconHeight() {
+        return height;
+    }
+    
+    @Override
+    public int getIconWidth() {
+        return width;
+    }
+    
+    @Override
+    public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
+        // no-op
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/GradientPanel.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.swing;
+
+import java.awt.Color;
+import java.awt.GradientPaint;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Paint;
+
+import javax.swing.JPanel;
+
+
+@SuppressWarnings("serial")
+public class GradientPanel extends JPanel {
+
+    private Color top;
+    private Color bottom;
+    
+    public GradientPanel(Color top, Color bottom) {
+        this.top = top;
+        this.bottom = bottom;
+    }
+    
+    @Override
+    protected void paintComponent(Graphics g) {
+        
+        Graphics2D graphics = GraphicsUtils.getInstance().createAAGraphics(g);
+        
+        Paint gradient = new GradientPaint(0, 0, top, 0, getHeight(), bottom);
+        graphics.setPaint(gradient);
+        graphics.fillRect(0, 0, getWidth(), getHeight());
+        graphics.dispose();
+    }
+}
--- a/client/swing-components/src/main/java/com/redhat/thermostat/swing/HeaderPanel.java	Tue Sep 18 14:34:23 2012 +0200
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/HeaderPanel.java	Tue Sep 18 14:35:21 2012 +0200
@@ -36,69 +36,62 @@
 
 package com.redhat.thermostat.swing;
 
+import java.awt.BorderLayout;
 import java.awt.Color;
-import java.awt.Font;
-import java.awt.GradientPaint;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Paint;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
 import java.lang.reflect.InvocationTargetException;
 
 import javax.swing.BoxLayout;
-import javax.swing.GroupLayout;
-import javax.swing.GroupLayout.Alignment;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JFrame;
+import javax.swing.JLabel;
 import javax.swing.JPanel;
-import javax.swing.LayoutStyle.ComponentPlacement;
 import javax.swing.SwingUtilities;
 
 /**
  * A component that host a panel with a nicely rendered header.
  */
+@SuppressWarnings("serial")
 public class HeaderPanel extends JPanel {
-
-    private GraphicsUtils graphicsUtils;
     
     private String header;
-    private boolean open;
     
     private JPanel contentPanel;
-        
+    private JLabel headerLabel;
+    private JPanel headerPanel;
+    private JPanel controlPanel;
+    
     public HeaderPanel() {
-        this(null);
+        this("");
     }
     
     public HeaderPanel(String header) {
-        this(header, 30);
-    }
-    
-    public HeaderPanel(String header, int headerHeight) {
         
         this.header = header;
-        graphicsUtils = GraphicsUtils.getInstance();
+        
+        setLayout(new BorderLayout(0, 0));
+
+        headerLabel = new ShadowLabel(header, new EmptyIcon(5, 5));
+        headerPanel = new GradientPanel(Color.WHITE, getBackground());
+        headerPanel.setPreferredSize(new Dimension(HeaderPanel.this.getWidth(), 40));
         
-        this.open = true;
+        headerPanel.setLayout(new BorderLayout(0, 0));
+        headerPanel.add(headerLabel, BorderLayout.WEST);
+        add(headerPanel, BorderLayout.NORTH);
         
-        JPanel headerPanel = new TopPanel();
+        controlPanel = new JPanel();
+        controlPanel.setOpaque(false);
+        controlPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 10));
+        
+        headerPanel.add(controlPanel, BorderLayout.EAST);
         
         contentPanel = new JPanel();
         contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.X_AXIS));
         
-        GroupLayout groupLayout = new GroupLayout(this);
-        groupLayout.setHorizontalGroup(
-            groupLayout.createParallelGroup(Alignment.LEADING)
-                .addComponent(headerPanel, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE)
-                .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, 450, Short.MAX_VALUE)
-        );
-        groupLayout.setVerticalGroup(
-            groupLayout.createParallelGroup(Alignment.LEADING)
-                .addGroup(groupLayout.createSequentialGroup()
-                    .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, headerHeight, GroupLayout.PREFERRED_SIZE)
-                    .addPreferredGap(ComponentPlacement.RELATED)
-                    .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE))
-        );
-        setLayout(groupLayout);
+        add(contentPanel, BorderLayout.CENTER);
     }
    
     public String getHeader() {
@@ -107,6 +100,7 @@
     
     public void setHeader(String header) {
         this.header = header;
+        headerLabel.setText(header);
     }
     
     public void setContent(JComponent content) {
@@ -115,27 +109,9 @@
         contentPanel.revalidate();
         repaint();
     }
-    
-    @SuppressWarnings({ "serial" })
-    private class TopPanel extends JPanel {
-        @Override
-        protected void paintComponent(Graphics g) {
-            
-            Graphics2D graphics = graphicsUtils.createAAGraphics(g);
-            
-            Paint gradient = new GradientPaint(0, 0, Color.WHITE, 0, getHeight(), getBackground());
-            graphics.setPaint(gradient);
-            graphics.fillRect(0, 0, getWidth(), getHeight());
-            
-            if (header != null) {
-                int currentHeight = getHeight();
-                
-                Font font = getFont();
-                int height = graphicsUtils.getFontMetrics(this, font).getAscent()/2 + currentHeight/2 - 1;
-                graphicsUtils.drawStringWithShadow(this, graphics, header, getForeground(), 6, height);
-            }
-            graphics.dispose();
-        }
+
+    public void addToolBarButton(ToolbarButton button) {
+        controlPanel.add(button.getToolbarButton());
     }
     
     public static void main(String[] args) throws InvocationTargetException, InterruptedException {
@@ -148,7 +124,7 @@
                
                HeaderPanel header = new HeaderPanel();
                header.setHeader("Test");
-               frame.add(header);
+               frame.getContentPane().add(header);
                frame.setSize(500, 500);
                frame.setVisible(true);
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/ShadowLabel.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.swing;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+
+import javax.swing.Icon;
+import javax.swing.JLabel;
+import javax.swing.plaf.metal.MetalLabelUI;
+
+@SuppressWarnings("serial")
+public class ShadowLabel extends JLabel {
+
+    public ShadowLabel(String text, Icon icon) {
+        super(text);
+        this.setIcon(icon);
+        setUI(new ShadowLabelUI());
+    }
+    
+    public ShadowLabel(String text) {
+        this(text, null);
+    }
+
+    private class ShadowLabelUI extends MetalLabelUI {
+        
+        @Override
+        protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY) {
+            GraphicsUtils graphicsUtils = GraphicsUtils.getInstance();
+            Graphics2D graphics = graphicsUtils.createAAGraphics(g);
+            graphicsUtils.drawStringWithShadow(l, graphics, s, getForeground(), textX, textY);
+        }
+    }
+}
--- a/client/swing-components/src/main/java/com/redhat/thermostat/swing/ToggleButton.java	Tue Sep 18 14:34:23 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
- * Copyright 2012 Red Hat, Inc.
- *
- * This file is part of Thermostat.
- *
- * Thermostat is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published
- * by the Free Software Foundation; either version 2, or (at your
- * option) any later version.
- *
- * Thermostat is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Thermostat; see the file COPYING.  If not see
- * <http://www.gnu.org/licenses/>.
- *
- * Linking this code with other modules is making a combined work
- * based on this code.  Thus, the terms and conditions of the GNU
- * General Public License cover the whole combination.
- *
- * As a special exception, the copyright holders of this code give
- * you permission to link this code with independent modules to
- * produce an executable, regardless of the license terms of these
- * independent modules, and to copy and distribute the resulting
- * executable under terms of your choice, provided that you also
- * meet, for each linked independent module, the terms and conditions
- * of the license of that module.  An independent module is a module
- * which is not derived from or based on this code.  If you modify
- * this code, you may extend this exception to your version of the
- * library, but you are not obligated to do so.  If you do not wish
- * to do so, delete this exception statement from your version.
- */
-
-package com.redhat.thermostat.swing;
-
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.beans.Transient;
-
-import javax.swing.ImageIcon;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JToggleButton;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-
-/**
- * A simple On/Off switch.
- */
-@SuppressWarnings("serial")
-public class ToggleButton extends JToggleButton {
-    
-    private static final int WIDTH = 40;
-    private static final int HEIGHT = 24;
-    
-    private ImageIcon toggle;
-    private ImageIcon selectedToggle;
-    
-    public ToggleButton() {
-        
-        toggle = new ImageIcon(getClass().getResource("/icons/scale-slider-vert.png"));
-        selectedToggle = new ImageIcon(getClass().getResource("/icons/scale-slider-vert-backdrop.png"));
-        
-        setBorder(null);
-    }
-
-    @Override
-    protected void paintComponent(Graphics g) {
-        GraphicsUtils utils = GraphicsUtils.getInstance();
-        
-        Graphics2D graphics = utils.createAAGraphics(g);
-        graphics.clearRect(0, 0, getWidth(), getHeight());
-        
-        graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
-        
-        Color selectedcolor = null;
-        Color shadow = new Color(0xE0E0E0);
-        if (model.isSelected()) {
-            selectedcolor = new Color(0x4A90D9);
-        } else {
-            selectedcolor = new Color(0xaeaeae);
-        }
-        
-        Color bgColor = null;
-        Container parent = getParent();
-        if (parent != null) {
-            bgColor = parent.getBackground();
-        } else {
-            bgColor = getBackground();
-        }
-        
-        // external shape and main fill
-        utils.setGradientPaint(graphics, 0, 10, shadow, bgColor);
-        graphics.fill(utils.getRoundShape(getWidth(), getHeight()));
-        
-        utils.setGradientPaint(graphics, 0, getWidth() / 2, selectedcolor, bgColor);
-        graphics.draw(utils.getRoundShape(getWidth(), getHeight()));
-        
-        // slider
-        int x = (toggle.getIconWidth() / 2);
-        int y = (getHeight()/2);
-        int width = getWidth() - (toggle.getIconWidth()/2) - 2;
-        
-        graphics.setColor(selectedcolor);
-        graphics.setStroke(new BasicStroke(1.2f));
-        graphics.drawLine(x, y, width, y);
-        
-        graphics.setStroke(new BasicStroke());
-
-        // toggle
-        x = 2;
-        y = (getHeight()/2) - (toggle.getIconHeight()/2);
-        ImageIcon toggle = this.toggle;
-        if (model.isRollover()) {
-            toggle = this.selectedToggle;
-        }
-        
-        if (model.isSelected()) {
-            toggle = this.selectedToggle;
-            x = getWidth() - toggle.getIconWidth() - 3;
-        }
-        graphics.drawImage(toggle.getImage(), x, y, null);
-        
-        graphics.dispose();
-    }
-    
-    @Override
-    @Transient
-    public Dimension getMinimumSize() {
-        if (isMinimumSizeSet()) {
-            return super.getMinimumSize();
-        }
-        return new Dimension(WIDTH, HEIGHT);
-    }
-    
-    @Override
-    @Transient
-    public Dimension getPreferredSize() {
-        if (isPreferredSizeSet()) {
-            return super.getPreferredSize();
-        }
-        return new Dimension(WIDTH, HEIGHT);
-    }
-    
-    public static void main(String[] args) {
-        SwingUtilities.invokeLater(new Runnable() {
-            
-            @Override
-            public void run() {
-                JFrame frame = new JFrame();
-                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-                
-                HeaderPanel header = new HeaderPanel();
-                header.setHeader("Test");
-                
-                JPanel buttonPanel = new JPanel();
-                ToggleButton toggle = new ToggleButton();
-                
-                buttonPanel.add(toggle);
-                header.setContent(buttonPanel);
-                
-                frame.add(header);
-                frame.setSize(500, 500);
-                frame.setVisible(true);
-            }
-        });
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/swing-components/src/main/java/com/redhat/thermostat/swing/ToolbarButton.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.swing;
+
+import javax.swing.AbstractButton;
+
+public interface ToolbarButton {
+    AbstractButton getToolbarButton();
+}
--- a/dolphin/src/main/java/com/redhat/swing/laf/dolphin/button/DolphinButtonUI.java	Tue Sep 18 14:34:23 2012 +0200
+++ b/dolphin/src/main/java/com/redhat/swing/laf/dolphin/button/DolphinButtonUI.java	Tue Sep 18 14:35:21 2012 +0200
@@ -90,13 +90,12 @@
         DolphinTheme theme = DolphinThemeUtils.getCurrentTheme();
         
         Graphics2D graphics = (Graphics2D) g.create();
-        
-        graphics.clearRect(0, 0, c.getWidth(), c.getHeight());
-        DolphinThemeUtils.setAntialiasing(graphics);
 
         AbstractButton button = (AbstractButton) c;
         ButtonModel model = button.getModel();
         
+        DolphinThemeUtils.setAntialiasing(graphics);
+
         Color topGradient = null;
         Color bottomGradient = null;
         if (!c.isEnabled()) {
@@ -111,17 +110,22 @@
                 bottomGradient = theme.getButtonGradientBottomColor();
             }
         }
+
+        if (button.isOpaque()) {
+            graphics.clearRect(0, 0, c.getWidth(), c.getHeight());
+        }
         
-        Paint paint = new GradientPaint(0, 0, topGradient, 0, c.getHeight(),
-                                        bottomGradient);
-        graphics.setPaint(paint);
+        if (button.isContentAreaFilled() && button.isOpaque()) {
+            Paint paint = new GradientPaint(0, 0, topGradient, 0, c.getHeight(),
+                    bottomGradient);
+            graphics.setPaint(paint);
+            Shape shape = DolphinThemeUtils.getRoundShape(c.getWidth(), c.getHeight());
+            graphics.fill(shape);
+        }
 
-        Shape shape = DolphinThemeUtils.getRoundShape(c.getWidth(), c.getHeight());
-        
-        graphics.fill(shape);
         graphics.dispose();
         
-        super.paint(g, c);        
+        super.paint(g, c);
     }
     
     @Override
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/IconResources.java	Tue Sep 18 14:35:21 2012 +0200
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * This file is part of Thermostat.
+ *
+ * Thermostat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2, or (at your
+ * option) any later version.
+ *
+ * Thermostat is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Thermostat; see the file COPYING.  If not see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Linking this code with other modules is making a combined work
+ * based on this code.  Thus, the terms and conditions of the GNU
+ * General Public License cover the whole combination.
+ *
+ * As a special exception, the copyright holders of this code give
+ * you permission to link this code with independent modules to
+ * produce an executable, regardless of the license terms of these
+ * independent modules, and to copy and distribute the resulting
+ * executable under terms of your choice, provided that you also
+ * meet, for each linked independent module, the terms and conditions
+ * of the license of that module.  An independent module is a module
+ * which is not derived from or based on this code.  If you modify
+ * this code, you may extend this exception to your version of the
+ * library, but you are not obligated to do so.  If you do not wish
+ * to do so, delete this exception statement from your version.
+ */
+
+package com.redhat.thermostat.thread.client.common;
+
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import com.redhat.thermostat.client.ui.IconDescriptor;
+
+public class IconResources {
+
+    private static final Logger logger = Logger.getLogger(IconResources.class.getSimpleName());
+
+    private static IconDescriptor monitor;
+    private static IconDescriptor record;
+
+    public static IconDescriptor getMonitorIcon() {
+        if (monitor == null) {
+            monitor = loadIcon("com/redhat/thermostat/thread/client/common/monitor.png");
+        }
+        return monitor;
+    }
+    
+    public static IconDescriptor getRecordIcon() {
+        if (record == null) {
+            record = loadIcon("com/redhat/thermostat/thread/client/common/gtk-media-record.png");
+        }
+        return record;
+    }
+    
+    private static IconDescriptor loadIcon(String name) {
+        try {
+            return IconDescriptor.createFromClassloader(ClassLoader.getSystemClassLoader(), name);
+        } catch (IOException e) {
+            logger.log(Level.WARNING, "Can't load " + name, e);
+        }
+        return null;
+    }
+}
--- a/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/ThreadDetailsView.java	Tue Sep 18 14:34:23 2012 +0200
+++ b/thread/client-common/src/main/java/com/redhat/thermostat/thread/client/common/ThreadDetailsView.java	Tue Sep 18 14:35:21 2012 +0200
@@ -36,25 +36,13 @@
 
 package com.redhat.thermostat.thread.client.common;
 
-import java.io.IOException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
 import com.redhat.thermostat.client.osgi.service.BasicView;
 import com.redhat.thermostat.client.ui.IconDescriptor;
 
 public abstract class ThreadDetailsView extends BasicView {
-    
-    private static final Logger logger = Logger.getLogger(ThreadDetailsView.class.getSimpleName());
-    
+        
     public IconDescriptor getEmptyDetailsIcon() {
-        try {
-            return IconDescriptor.createFromClassloader(ClassLoader.getSystemClassLoader(),
-                                                        "com/redhat/thermostat/thread/client/common/monitor.png");
-        } catch (IOException e) {
-            logger.log(Level.WARNING, "Can't load emptyDetailsIcon", e);
-        }
-        return null;
+        return IconResources.getMonitorIcon();
     }
     
     public abstract void setDetails(ThreadTableBean thread);
Binary file thread/client-common/src/main/resources/com/redhat/thermostat/thread/client/common/gtk-media-record.png has changed
Binary file thread/client-common/src/main/resources/com/redhat/thermostat/thread/client/common/record.png has changed
--- a/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadView.java	Tue Sep 18 14:34:23 2012 +0200
+++ b/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadView.java	Tue Sep 18 14:35:21 2012 +0200
@@ -108,20 +108,19 @@
         });
         
         timelinePanel = new ThreadAliveDaemonTimelinePanel();
-
-        timelinePanel.setToggleText(t.localize(LocaleResources.START_RECORDING) + ":");
-        timelinePanel.getRecordButton().addItemListener(new ItemListener()
+        panel.getToggleButton().setToolTipText(t.localize(LocaleResources.START_RECORDING));
+        panel.getToggleButton().addItemListener(new ItemListener()
         {
             @Override
             public void itemStateChanged(ItemEvent e) {
-                                
-                ThreadAction action = null;
+                
+                ThreadAction action = null;                
                 if (e.getStateChange() == ItemEvent.SELECTED) {
                     action = ThreadAction.START_LIVE_RECORDING;
-                    timelinePanel.setToggleText(t.localize(LocaleResources.STOP_RECORDING) + ":");
+                    panel.getToggleButton().setToolTipText(t.localize(LocaleResources.STOP_RECORDING));
                 } else {
                     action = ThreadAction.STOP_LIVE_RECORDING;
-                    timelinePanel.setToggleText(t.localize(LocaleResources.START_RECORDING) + ":");
+                    panel.getToggleButton().setToolTipText(t.localize(LocaleResources.START_RECORDING));
                 }
                 
                 if (skipNotification) return;
@@ -173,7 +172,7 @@
             @Override
             public void run() {
                 if (!notify) skipNotification = true;
-                timelinePanel.getRecordButton().setSelected(recording);
+                panel.getToggleButton().setSelected(recording);
                 if (!notify) skipNotification = false;
             }
         });
--- a/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/ThreadAliveDaemonTimelinePanel.java	Tue Sep 18 14:34:23 2012 +0200
+++ b/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/ThreadAliveDaemonTimelinePanel.java	Tue Sep 18 14:35:21 2012 +0200
@@ -46,7 +46,6 @@
 
 import com.redhat.thermostat.common.locale.Translate;
 import com.redhat.thermostat.thread.client.common.locale.LocaleResources;
-import com.redhat.thermostat.swing.ToggleButton;
 
 @SuppressWarnings("serial")
 class ThreadAliveDaemonTimelinePanel extends JPanel {
@@ -56,10 +55,6 @@
     private JLabel liveThreads;
     private JLabel daemonThreads;
     private JPanel timelinePanel;
-
-    private ToggleButton toggleButton;
-    
-    private JLabel lblNewLabel; 
     
     /**
      * Create the panel.
@@ -96,60 +91,29 @@
         
         daemonThreads = new JLabel("-");
         daemonThreads.setHorizontalAlignment(SwingConstants.RIGHT);
-        
-        JPanel panel = new JPanel();
         GroupLayout gl_runningPanel = new GroupLayout(runningPanel);
         gl_runningPanel.setHorizontalGroup(
             gl_runningPanel.createParallelGroup(Alignment.LEADING)
                 .addGroup(gl_runningPanel.createSequentialGroup()
-                    .addGroup(gl_runningPanel.createParallelGroup(Alignment.LEADING)
-                        .addComponent(daemonThreadsLabel)
-                        .addComponent(liveThreadsLabel))
-                    .addGap(24)
-                    .addGroup(gl_runningPanel.createParallelGroup(Alignment.LEADING, false)
-                        .addComponent(daemonThreads, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                        .addComponent(liveThreads, GroupLayout.DEFAULT_SIZE, 85, Short.MAX_VALUE))
+                    .addComponent(liveThreadsLabel)
+                    .addGap(18)
+                    .addComponent(liveThreads, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE)
+                    .addGap(18)
+                    .addComponent(daemonThreadsLabel)
                     .addPreferredGap(ComponentPlacement.RELATED)
-                    .addComponent(panel, GroupLayout.DEFAULT_SIZE, 331, Short.MAX_VALUE))
+                    .addComponent(daemonThreads, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
+                    .addContainerGap(54, Short.MAX_VALUE))
         );
         gl_runningPanel.setVerticalGroup(
             gl_runningPanel.createParallelGroup(Alignment.TRAILING)
-                .addGroup(gl_runningPanel.createSequentialGroup()
+                .addGroup(Alignment.LEADING, gl_runningPanel.createSequentialGroup()
                     .addGroup(gl_runningPanel.createParallelGroup(Alignment.BASELINE)
                         .addComponent(liveThreadsLabel)
-                        .addComponent(liveThreads))
-                    .addPreferredGap(ComponentPlacement.RELATED)
-                    .addGroup(gl_runningPanel.createParallelGroup(Alignment.BASELINE)
+                        .addComponent(liveThreads)
                         .addComponent(daemonThreads)
                         .addComponent(daemonThreadsLabel))
-                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-                .addComponent(panel, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE)
+                    .addContainerGap(26, Short.MAX_VALUE))
         );
-        
-        toggleButton = new ToggleButton();
-        toggleButton.setName("recordButton");
-        
-        lblNewLabel = new JLabel("New label");
-        lblNewLabel.setName("recordButtonText");
-        
-        GroupLayout gl_panel = new GroupLayout(panel);
-        gl_panel.setHorizontalGroup(
-            gl_panel.createParallelGroup(Alignment.TRAILING)
-                .addGroup(gl_panel.createSequentialGroup()
-                    .addContainerGap(209, Short.MAX_VALUE)
-                    .addComponent(lblNewLabel)
-                    .addPreferredGap(ComponentPlacement.RELATED)
-                    .addComponent(toggleButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
-        );
-        gl_panel.setVerticalGroup(
-            gl_panel.createParallelGroup(Alignment.LEADING)
-                .addGroup(gl_panel.createSequentialGroup()
-                    .addGroup(gl_panel.createParallelGroup(Alignment.TRAILING, false)
-                        .addComponent(lblNewLabel, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-                        .addComponent(toggleButton, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-                    .addContainerGap(24, Short.MAX_VALUE))
-        );
-        panel.setLayout(gl_panel);
         runningPanel.setLayout(gl_runningPanel);
         setLayout(groupLayout);
 
@@ -166,12 +130,4 @@
     public JPanel getTimelinePanel() {
         return timelinePanel;
     }
-    
-    public ToggleButton getRecordButton() {
-        return toggleButton;
-    }
-    
-    public void setToggleText(String text) {
-        lblNewLabel.setText(text);
-    }
 }
--- a/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/ThreadMainPanel.java	Tue Sep 18 14:34:23 2012 +0200
+++ b/thread/client-swing/src/main/java/com/redhat/thermostat/thread/client/swing/impl/ThreadMainPanel.java	Tue Sep 18 14:35:21 2012 +0200
@@ -38,12 +38,15 @@
 
 import javax.swing.BoxLayout;
 import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
 import javax.swing.GroupLayout.Alignment;
 import javax.swing.JPanel;
 import javax.swing.JSplitPane;
 
 import com.redhat.thermostat.common.locale.Translate;
+import com.redhat.thermostat.swing.ActionToggleButton;
 import com.redhat.thermostat.swing.HeaderPanel;
+import com.redhat.thermostat.thread.client.common.IconResources;
 import com.redhat.thermostat.thread.client.common.locale.LocaleResources;
 
 @SuppressWarnings("serial")
@@ -52,6 +55,8 @@
     private static final Translate t = LocaleResources.createLocalizer();
     private JSplitPane splitPane;
     
+    private ActionToggleButton toggleButton;
+    
     public ThreadMainPanel() {
         setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
         
@@ -61,6 +66,10 @@
         JPanel content = new JPanel();
         headerPanel.setContent(content);
         
+        toggleButton = new ActionToggleButton(new ImageIcon(IconResources.getRecordIcon().getData().array()));
+        toggleButton.setName("recordButton");
+        headerPanel.addToolBarButton(toggleButton);
+        
         splitPane = new JSplitPane();
         splitPane.setName("threadMainPanelSplitPane");
         splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
@@ -90,4 +99,8 @@
     public JSplitPane getSplitPane() {
         return splitPane;
     }
+    
+    public ActionToggleButton getToggleButton() {
+        return toggleButton;
+    }
 }
--- a/thread/client-swing/src/test/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadViewTest.java	Tue Sep 18 14:34:23 2012 +0200
+++ b/thread/client-swing/src/test/java/com/redhat/thermostat/thread/client/swing/impl/SwingThreadViewTest.java	Tue Sep 18 14:35:21 2012 +0200
@@ -123,23 +123,22 @@
         frameFixture.show();
         
         JToggleButtonFixture togglefixture = frameFixture.toggleButton("recordButton");
-        JLabelFixture toggleTest = frameFixture.label("recordButtonText");
         
-        toggleTest.requireText(t.localize(LocaleResources.START_RECORDING) + ":");
+        togglefixture.requireToolTip(t.localize(LocaleResources.START_RECORDING));
         
         togglefixture.click();
 
-        toggleTest.requireText(t.localize(LocaleResources.STOP_RECORDING) + ":");
+        togglefixture.requireToolTip(t.localize(LocaleResources.STOP_RECORDING));
         
         // now try "programmatically"
         
         view.setRecording(true, true);
         
-        toggleTest.requireText(t.localize(LocaleResources.STOP_RECORDING) + ":");
+        togglefixture.requireToolTip(t.localize(LocaleResources.STOP_RECORDING));
     
         view.setRecording(false, false);
         
-        toggleTest.requireText(t.localize(LocaleResources.START_RECORDING) + ":");
+        togglefixture.requireToolTip(t.localize(LocaleResources.START_RECORDING));
     }
 
     @GUITest