KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwtx > swing > border > EmptyBorder


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: EmptyBorder.java,v $
11    Revision 1.4 2004/04/23 00:52:32 dannaab
12    Handle borders in a Swing-like way. Implement EmptyBorder & TitledBorder
13
14    Revision 1.3 2003/12/14 09:13:38 bobintetley
15    Added CVS log to source headers
16
17 */

18
19 package swingwtx.swing.border;
20
21 import swingwt.awt.*;
22
23 public class EmptyBorder extends AbstractBorder implements Border {
24     protected int left, right, top, bottom;
25
26     public EmptyBorder(Insets borderInsets) {
27         this(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right);
28     }
29     public EmptyBorder(int top, int left, int bottom, int right) {
30         this.top = top;
31         this.left = left;
32         this.bottom = bottom;
33         this.right = right;
34     }
35
36     public Insets getBorderInsets(Component c) { return getBorderInsets(); }
37     public Insets getBorderInsets() { return new Insets(top, left, bottom, right); }
38
39     public Insets getBorderInsets(Component c, Insets insets) {
40         insets.top = top;
41         insets.left = left;
42         insets.bottom = bottom;
43         insets.right = right;
44         return insets;
45     }
46 }
47
Popular Tags