1 /**
2 * LGPL-style license, for more see http://siouxsie.sourceforge.net/license.txt
3 */
4 package siouxsie.desktop.impl;
5
6 import java.awt.Component;
7 import java.awt.Dimension;
8
9 import javax.swing.JComponent;
10 import javax.swing.JLabel;
11 import javax.swing.JProgressBar;
12
13 import org.jdesktop.swingx.JXStatusBar;
14
15 import siouxsie.desktop.IStatusBar;
16
17 /**
18 *
19 * @author Arnaud Cogoluegnes
20 * @version $Id$
21 * @deprecated
22 */
23 public class StatusBar implements IStatusBar {
24
25 private JXStatusBar statusBar = new JXStatusBar();
26 private JLabel leadingMessage = new JLabel();
27 private JLabel trailingMessage = new JLabel();
28 private JProgressBar progressBar = new JProgressBar();
29
30 public StatusBar() {
31
32
33 statusBar.add(progressBar);
34 progressBar.setVisible(false);
35 statusBar.add(trailingMessage);
36 statusBar.setAlignmentX(Component.RIGHT_ALIGNMENT);
37 statusBar.setPreferredSize(new Dimension(25,25));
38 }
39
40
41
42
43
44 public JComponent getComponent() {
45 return this.statusBar;
46 }
47
48
49
50
51
52 public void setTrailingMessage(String msg) {
53 trailingMessage.setText(msg);
54 }
55
56
57
58
59
60 public void setLeadingMessage(String msg) {
61 leadingMessage.setText(msg);
62 }
63
64
65
66
67
68 public void processEnded() {
69 progressBar.setIndeterminate(false);
70 progressBar.setVisible(false);
71 }
72
73
74
75
76
77 public void processStarted(boolean indeterminate) {
78 progressBar.setVisible(true);
79 progressBar.setIndeterminate(indeterminate);
80 if(!indeterminate) {
81 progressBar.setValue(0);
82 }
83 }
84
85
86
87
88
89 public void setProgress(int progress) {
90 progressBar.setValue(progress);
91 }
92
93
94 }