KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > GridBagConstraints


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: GridBagConstraints.java,v $
11    Revision 1.6 2004/01/06 08:28:02 bobintetley
12    Header fixes
13
14  
15  */

16
17 package swingwt.awt;
18
19
20 public class GridBagConstraints implements Cloneable JavaDoc {
21     
22     public static final int RELATIVE = -1;
23     public static final int REMAINDER = 0;
24     public static final int NONE = 0;
25     public static final int BOTH = 1;
26     public static final int HORIZONTAL = 2;
27     public static final int VERTICAL = 3;
28     public static final int CENTER = 10;
29     public static final int NORTH = 11;
30     public static final int NORTHEAST = 12;
31     public static final int EAST = 13;
32     public static final int SOUTHEAST = 14;
33     public static final int SOUTH = 15;
34     public static final int SOUTHWEST = 16;
35     public static final int WEST = 17;
36     public static final int NORTHWEST = 18;
37     public static final int PAGE_START = 19;
38     public static final int PAGE_END = 20;
39     public static final int LINE_START = 21;
40     public static final int LINE_END = 22;
41     public static final int FIRST_LINE_START = 23;
42     public static final int FIRST_LINE_END = 24;
43     public static final int LAST_LINE_START = 25;
44     public static final int LAST_LINE_END = 26;
45     
46     public int gridx;
47     public int gridy;
48     public int gridwidth;
49     public int gridheight;
50     
51     public double weightx;
52     public double weighty;
53     public int anchor;
54     public int fill;
55     
56     public Insets insets;
57     
58     public int ipadx;
59     public int ipady;
60     
61     int tempX;
62     int tempY;
63     int tempWidth;
64     int tempHeight;
65     int minWidth;
66     int minHeight;
67     
68     public GridBagConstraints() {
69         gridx = RELATIVE;
70         gridy = RELATIVE;
71         gridwidth = 1;
72         gridheight = 1;
73         
74         weightx = 0;
75         weighty = 0;
76         anchor = CENTER;
77         fill = NONE;
78         
79         insets = new Insets(0, 0, 0, 0);
80         ipadx = 0;
81         ipady = 0;
82     }
83     
84     public GridBagConstraints(
85                                 int gridx,
86                                 int gridy,
87                                 int gridwidth,
88                                 int gridheight,
89                                 double weightx,
90                                 double weighty,
91                                 int anchor,
92                                 int fill,
93                                 Insets insets,
94                                 int ipadx,
95                                 int ipady) {
96         this.gridx = gridx;
97         this.gridy = gridy;
98         this.gridwidth = gridwidth;
99         this.gridheight = gridheight;
100         this.fill = fill;
101         this.ipadx = ipadx;
102         this.ipady = ipady;
103         this.insets = insets;
104         this.anchor = anchor;
105         this.weightx = weightx;
106         this.weighty = weighty;
107     }
108     
109     public Object JavaDoc clone() {
110         try {
111             GridBagConstraints c = (GridBagConstraints) super.clone();
112             c.insets = (Insets) insets.clone();
113             return c;
114         }
115         catch (CloneNotSupportedException JavaDoc e) {
116             throw new InternalError JavaDoc();
117         }
118     }
119 }
Popular Tags