1 /*****************************************************/
\r
2 /* This java file is a part of the */
\r
4 /* - Plouf's Java IRC Client - */
\r
6 /* Copyright (C) 2002 - 2004 Philippe Detournay */
\r
8 /* All contacts : theplouf@yahoo.com */
\r
10 /* PJIRC is free software; you can redistribute */
\r
11 /* it and/or modify it under the terms of the GNU */
\r
12 /* General Public License as published by the */
\r
13 /* Free Software Foundation; version 2 or later of */
\r
16 /* PJIRC is distributed in the hope that it will */
\r
17 /* be useful, but WITHOUT ANY WARRANTY; without */
\r
18 /* even the implied warranty of MERCHANTABILITY or */
\r
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
\r
20 /* General Public License for more details. */
\r
22 /* You should have received a copy of the GNU */
\r
23 /* General Public License along with PJIRC; if */
\r
24 /* not, write to the Free Software Foundation, */
\r
25 /* Inc., 59 Temple Place, Suite 330, Boston, */
\r
26 /* MA 02111-1307 USA */
\r
28 /*****************************************************/
\r
30 package irc.gui.pixx;
\r
32 import java.awt.Color;
\r
33 import java.awt.Dimension;
\r
34 import java.awt.Graphics;
\r
35 import java.awt.Panel;
\r
40 public class PixxSeparator extends Panel {
\r
45 public static final int BORDER_UP = 0;
\r
49 public static final int BORDER_DOWN = 1;
\r
53 public static final int BORDER_LEFT = 2;
\r
57 public static final int BORDER_RIGHT = 3;
\r
60 * Create a new PixxSeparator.
\r
65 public PixxSeparator(int type) {
\r
71 public Dimension getPreferredSize() {
\r
75 return new Dimension(16, 2);
\r
77 return new Dimension(16, 1);
\r
79 return new Dimension(2, 16);
\r
81 return new Dimension(1, 16);
\r
83 return new Dimension(16, 16);
\r
89 public void paint(Graphics g) {
\r
94 public void update(Graphics g) {
\r
95 int w = getSize().width;
\r
96 int h = getSize().height;
\r
99 g.setColor(new Color(0x868686));
\r
100 g.drawLine(0, 0, w - 1, 0);
\r
101 g.drawLine(0, 0, 0, 1);
\r
102 g.drawLine(w - 1, 0, w - 1, 1);
\r
103 g.setColor(Color.black);
\r
104 g.drawLine(1, 1, w - 2, 1);
\r
107 g.setColor(new Color(0x868686));
\r
108 g.drawLine(0, 0, 0, h - 1);
\r
109 g.setColor(Color.black);
\r
110 g.drawLine(1, 0, 1, h - 1);
\r
113 g.setColor(new Color(0xD7D3CB));
\r
114 g.drawLine(0, h - 1, w - 1, h - 1);
\r
117 g.setColor(new Color(0xD7D3CB));
\r
118 g.drawLine(w - 1, 0, w - 1, h - 1);
\r