1 package org.wcb.gui.component;
2
3
4 import javax.swing.JPanel;
5 import javax.swing.JLabel;
6 import java.awt.BorderLayout;
7 import java.awt.Dimension;
8 import java.awt.Color;
9 import java.awt.Graphics;
10 /**
11 * <small>
12 * <p/>
13 * Copyright (c) 2006 wbogaardt.
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 * <p/>
28 * $File: $ <br>
29 * $Change: $ submitted by $Author: wbogaardt $ at $DateTime: Sep 11, 2006 10:34:24 AM $ <br>
30 * </small>
31 *
32 * @author wbogaardt
33 *
34 */
35 public class JStatusBar extends JPanel {
36
37 /**
38 * Create a bottom status bar.
39 */
40 public JStatusBar() {
41 setLayout(new BorderLayout());
42 setPreferredSize(new Dimension(10, 23));
43
44 JPanel rightPanel = new JPanel(new BorderLayout());
45 rightPanel.add(new JLabel(new TriangleSquareCornerWindowIcon()), BorderLayout.SOUTH);
46 rightPanel.setOpaque(false);
47
48 add(rightPanel, BorderLayout.EAST);
49 setBackground(new Color(236, 233, 216));
50 }
51
52 /**
53 * Paints the status bar.
54 * @param g Referecne to graphics component.
55 */
56 protected void paintComponent(Graphics g) {
57 super.paintComponent(g);
58
59 int y = 0;
60 g.setColor(new Color(156, 154, 140));
61 g.drawLine(0, y, getWidth(), y);
62 y++;
63 g.setColor(new Color(196, 194, 183));
64 g.drawLine(0, y, getWidth(), y);
65 y++;
66 g.setColor(new Color(218, 215, 201));
67 g.drawLine(0, y, getWidth(), y);
68 y++;
69 g.setColor(new Color(233, 231, 217));
70 g.drawLine(0, y, getWidth(), y);
71
72 y = getHeight() - 3;
73 g.setColor(new Color(233, 232, 218));
74 g.drawLine(0, y, getWidth(), y);
75 y++;
76 g.setColor(new Color(233, 231, 216));
77 g.drawLine(0, y, getWidth(), y);
78 y = getHeight() - 1;
79 g.setColor(new Color(221, 221, 220));
80 g.drawLine(0, y, getWidth(), y);
81
82 }
83
84 }