16 package net.squiz.matrix.ui;
21 import java.awt.event.*;
22 import net.squiz.matrix.core.*;
23 import javax.swing.border.*;
33 private static java.util.List elements =
new ArrayList();
34 private static MatrixStatusBarElement[] elementsArr;
37 private static String statusText =
"";
47 MatrixStatusBarElement element =
new MatrixStatusBarElement(statusText);
48 synchronized(elements) {
49 elements.add(element);
61 private static MatrixStatusBarElement[] getElements() {
62 synchronized(elements) {
63 if (elementsArr == null) {
64 elementsArr = (MatrixStatusBarElement[]) elements.toArray(
65 new MatrixStatusBarElement[elements.size()]);
78 MatrixStatusBarElement[] elements = getElements();
79 for (
int i = 0; i < elements.length; i++)
113 ActionListener listener =
new ActionListener() {
114 public void actionPerformed(ActionEvent evt) {
119 javax.swing.Timer t =
new javax.swing.Timer(time, listener);
130 private static class MatrixStatusBarElement
extends JPanel
131 implements MatrixConstants, MouseListener {
133 private JLabel label;
135 private javax.swing.Timer clearTimer;
138 private MatrixStatusBarElement(String status) {
139 setLayout(
new FlowLayout(FlowLayout.LEFT));
142 label =
new JLabel(statusText);
144 label.setFont(PLAIN_FONT_10);
149 setBackground(UIManager.getColor(
"StatusBar.background"));
153 ActionListener listener =
new ActionListener() {
154 public void actionPerformed(ActionEvent evt) {
158 clearTimer =
new javax.swing.Timer(1000, listener);
159 clearTimer.setRepeats(
false);
160 addMouseListener(
this);
169 if (status.equals(
"") && spinner.isStarted())
171 else if ((!status.equals(
"")) && !spinner.isStarted())
173 label.setText(status);
194 clearTimer.setDelay(time);
204 return label.getText();
207 public void mouseEntered(MouseEvent evt) {}
208 public void mouseExited(MouseEvent evt) {}
209 public void mousePressed(MouseEvent evt) {}
210 public void mouseReleased(MouseEvent evt) {}
212 public void mouseClicked(MouseEvent evt) {
213 if (evt.getClickCount() != 2)
221 net.squiz.matrix.debug.Log.openLogs();