KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > form > layoutsupport > delegates > GridBagControlCenter


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.form.layoutsupport.delegates;
21
22 import java.util.ResourceBundle JavaDoc;
23
24 import javax.swing.*;
25 import javax.swing.border.TitledBorder JavaDoc;
26
27 import org.openide.util.Utilities;
28
29 /**
30  * @author phrebejk
31  */

32
33 public class GridBagControlCenter extends javax.swing.JPanel JavaDoc {
34
35     private GridBagCustomizer customizer;
36
37     private ResourceBundle JavaDoc bundle;
38
39     private ActionL actionLsnr;
40
41     static final long serialVersionUID =-3758289034173265028L;
42     /** Creates new form GridBagControlCenter */
43     public GridBagControlCenter(GridBagCustomizer customizer) {
44         bundle = GridBagLayoutSupport.getBundleHack();
45
46         initComponents();
47
48         ButtonGroup anchorGroup = new ButtonGroup();
49
50         anchorGroup.add(nwButton);
51         anchorGroup.add(nButton);
52         anchorGroup.add(neButton);
53         anchorGroup.add(wButton);
54         anchorGroup.add(cButton);
55         anchorGroup.add(eButton);
56         anchorGroup.add(swButton);
57         anchorGroup.add(sButton);
58         anchorGroup.add(seButton);
59
60
61         // i18n
62

63         ((TitledBorder JavaDoc)anchorPanel.getBorder()).setTitle(bundle.getString("CTL_GBC_anchorPanel"));
64         ((TitledBorder JavaDoc)fillPanel.getBorder()).setTitle(bundle.getString("CTL_GBC_fillPanel"));
65         ((TitledBorder JavaDoc)ipadPanel.getBorder()).setTitle(bundle.getString("CTL_GBC_ipadPanel"));
66         ((TitledBorder JavaDoc)insetsPanel.getBorder()).setTitle(bundle.getString("CTL_GBC_insetsPanel"));
67         ((TitledBorder JavaDoc)gridSizePanel.getBorder()).setTitle(bundle.getString("CTL_GBC_gridSizePanel"));
68
69
70         nwButton.setToolTipText(bundle.getString("CTL_GBC_anchor.NW"));
71         nButton.setToolTipText(bundle.getString("CTL_GBC_anchor.N"));
72         neButton.setToolTipText(bundle.getString("CTL_GBC_anchor.NE"));
73         wButton.setToolTipText(bundle.getString("CTL_GBC_anchor.W"));
74         cButton.setToolTipText(bundle.getString("CTL_GBC_anchor.C"));
75         eButton.setToolTipText(bundle.getString("CTL_GBC_anchor.E"));
76         swButton.setToolTipText(bundle.getString("CTL_GBC_anchor.SW"));
77         sButton.setToolTipText(bundle.getString("CTL_GBC_anchor.S"));
78         seButton.setToolTipText(bundle.getString("CTL_GBC_anchor.SE"));
79
80         horizontalFillButton.setToolTipText(bundle.getString("CTL_GBC_fill.H"));
81         verticalFillButton.setToolTipText(bundle.getString("CTL_GBC_fill.V"));
82
83         ipadHMButton.setToolTipText(bundle.getString("CTL_GBC_ipad.HM"));
84         ipadHPButton.setToolTipText(bundle.getString("CTL_GBC_ipad.HP"));
85         ipadVMButton.setToolTipText(bundle.getString("CTL_GBC_ipad.VM"));
86         ipadVPButton.setToolTipText(bundle.getString("CTL_GBC_ipad.VP"));
87
88         topMButton.setToolTipText(bundle.getString("CTL_GBC_insets.topM"));
89         topPButton.setToolTipText(bundle.getString("CTL_GBC_insets.topP"));
90         leftPButton.setToolTipText(bundle.getString("CTL_GBC_insets.leftP"));
91         leftMButton.setToolTipText(bundle.getString("CTL_GBC_insets.leftM"));
92         rightMButton.setToolTipText(bundle.getString("CTL_GBC_insets.rightM"));
93         rightPButton.setToolTipText(bundle.getString("CTL_GBC_insets.rightP"));
94         bottomMButton.setToolTipText(bundle.getString("CTL_GBC_insets.bottomM"));
95         bottomPButton.setToolTipText(bundle.getString("CTL_GBC_insets.bottomP"));
96         HMButton.setToolTipText(bundle.getString("CTL_GBC_insets.HM"));
97         HPButton.setToolTipText(bundle.getString("CTL_GBC_insets.HP"));
98         VMButton.setToolTipText(bundle.getString("CTL_GBC_insets.VM"));
99         VPButton.setToolTipText(bundle.getString("CTL_GBC_insets.VP"));
100         BMButton.setToolTipText(bundle.getString("CTL_GBC_insets.BM"));
101         BPButton.setToolTipText(bundle.getString("CTL_GBC_insets.BP"));
102
103         gridSizeHMButton.setToolTipText(bundle.getString("CTL_GBC_gridSize.HM"));
104         gridSizeHPButton.setToolTipText(bundle.getString("CTL_GBC_gridSize.HP"));
105         gsRHButton.setToolTipText(bundle.getString("CTL_GBC_gridSize.RH"));
106         gridSizeVMButton.setToolTipText(bundle.getString("CTL_GBC_gridSize.VM"));
107         gridSizeVPButton.setToolTipText(bundle.getString("CTL_GBC_gridSize.VP"));
108         gsRVButton.setToolTipText(bundle.getString("CTL_GBC_gridSize.RV"));
109
110         this.customizer = customizer;
111     }
112
113     private void initComponents() {
114         setLayout(new java.awt.GridBagLayout JavaDoc());
115         java.awt.GridBagConstraints JavaDoc gridBagConstraints1;
116
117         actionLsnr = new ActionL ();
118
119         anchorPanel = new javax.swing.JPanel JavaDoc();
120         anchorPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
121         java.awt.GridBagConstraints JavaDoc gridBagConstraints2;
122         anchorPanel.setBorder(new javax.swing.border.TitledBorder JavaDoc(
123             new javax.swing.border.EtchedBorder JavaDoc(), "anchorPanel")); // NOI18N
124

125         nwButton = new javax.swing.JToggleButton JavaDoc();
126         nwButton.setIcon(new ImageIcon(Utilities.loadImage(
127             "org/netbeans/modules/form/layoutsupport/resources/nw.gif"))); // NOI18N
128
nwButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
129         nwButton.setActionCommand("NW"); // NOI18N
130
nwButton.addActionListener(actionLsnr);
131
132         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
133         anchorPanel.add(nwButton, gridBagConstraints2);
134
135         nButton = new javax.swing.JToggleButton JavaDoc();
136         nButton.setIcon(new ImageIcon(Utilities.loadImage(
137             "org/netbeans/modules/form/layoutsupport/resources/n.gif"))); // NOI18N
138
nButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
139         nButton.setActionCommand("N"); // NOI18N
140
nButton.addActionListener(actionLsnr);
141
142         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
143         anchorPanel.add(nButton, gridBagConstraints2);
144
145         neButton = new javax.swing.JToggleButton JavaDoc();
146         neButton.setIcon(new ImageIcon(Utilities.loadImage(
147             "org/netbeans/modules/form/layoutsupport/resources/ne.gif"))); // NOI18N
148
neButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
149         neButton.setActionCommand("NE"); // NOI18N
150
neButton.addActionListener(actionLsnr);
151
152         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
153         gridBagConstraints2.gridwidth = 0;
154         anchorPanel.add(neButton, gridBagConstraints2);
155
156         wButton = new javax.swing.JToggleButton JavaDoc();
157         wButton.setIcon(new ImageIcon(Utilities.loadImage(
158             "org/netbeans/modules/form/layoutsupport/resources/w.gif"))); // NOI18N
159
wButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
160         wButton.setActionCommand("W"); // NOI18N
161
wButton.addActionListener(actionLsnr);
162
163         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
164         anchorPanel.add(wButton, gridBagConstraints2);
165
166         cButton = new javax.swing.JToggleButton JavaDoc();
167         cButton.setIcon(new ImageIcon(Utilities.loadImage(
168             "org/netbeans/modules/form/layoutsupport/resources/c.gif"))); // NOI18N
169
cButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
170         cButton.setActionCommand("C"); // NOI18N
171
cButton.addActionListener(actionLsnr);
172
173         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
174         anchorPanel.add(cButton, gridBagConstraints2);
175
176         eButton = new javax.swing.JToggleButton JavaDoc();
177         eButton.setIcon(new ImageIcon(Utilities.loadImage(
178             "org/netbeans/modules/form/layoutsupport/resources/e.gif"))); // NOI18N
179
eButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
180         eButton.setActionCommand("E"); // NOI18N
181
eButton.addActionListener(actionLsnr);
182
183         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
184         gridBagConstraints2.gridwidth = 0;
185         anchorPanel.add(eButton, gridBagConstraints2);
186
187         swButton = new javax.swing.JToggleButton JavaDoc();
188         swButton.setIcon(new ImageIcon(Utilities.loadImage(
189             "org/netbeans/modules/form/layoutsupport/resources/sw.gif"))); // NOI18N
190
swButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
191         swButton.setActionCommand("SW"); // NOI18N
192
swButton.addActionListener(actionLsnr);
193
194         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
195         gridBagConstraints2.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
196         anchorPanel.add(swButton, gridBagConstraints2);
197
198         sButton = new javax.swing.JToggleButton JavaDoc();
199         sButton.setIcon(new ImageIcon(Utilities.loadImage(
200             "org/netbeans/modules/form/layoutsupport/resources/s.gif"))); // NOI18N
201
sButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
202         sButton.setActionCommand("S"); // NOI18N
203
sButton.addActionListener(actionLsnr);
204
205         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
206         gridBagConstraints2.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
207         anchorPanel.add(sButton, gridBagConstraints2);
208
209         seButton = new javax.swing.JToggleButton JavaDoc();
210         seButton.setIcon(new ImageIcon(Utilities.loadImage(
211             "org/netbeans/modules/form/layoutsupport/resources/se.gif"))); // NOI18N
212
seButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
213         seButton.setActionCommand("SE"); // NOI18N
214
seButton.addActionListener(actionLsnr);
215
216         gridBagConstraints2 = new java.awt.GridBagConstraints JavaDoc();
217         gridBagConstraints2.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
218         anchorPanel.add(seButton, gridBagConstraints2);
219
220
221         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
222         gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
223         gridBagConstraints1.weightx = 1.0;
224         gridBagConstraints1.weighty = 1.0;
225         add(anchorPanel, gridBagConstraints1);
226
227         fillPanel = new javax.swing.JPanel JavaDoc();
228         fillPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
229         java.awt.GridBagConstraints JavaDoc gridBagConstraints3;
230         fillPanel.setBorder(new javax.swing.border.TitledBorder JavaDoc(
231             new javax.swing.border.EtchedBorder JavaDoc(), "fillPanel")); // NOI18N
232

233         horizontalFillButton = new javax.swing.JToggleButton JavaDoc();
234         horizontalFillButton.setIcon(new ImageIcon(Utilities.loadImage(
235             "org/netbeans/modules/form/layoutsupport/resources/horizontal.gif"))); // NOI18N
236
horizontalFillButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
237         horizontalFillButton.addActionListener(actionLsnr);
238
239         gridBagConstraints3 = new java.awt.GridBagConstraints JavaDoc();
240         gridBagConstraints3.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
241         fillPanel.add(horizontalFillButton, gridBagConstraints3);
242
243         verticalFillButton = new javax.swing.JToggleButton JavaDoc();
244         verticalFillButton.setIcon(new ImageIcon(Utilities.loadImage(
245             "org/netbeans/modules/form/layoutsupport/resources/vertical.gif"))); // NOI18N
246
verticalFillButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
247         verticalFillButton.addActionListener(actionLsnr);
248
249         gridBagConstraints3 = new java.awt.GridBagConstraints JavaDoc();
250         gridBagConstraints3.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
251         fillPanel.add(verticalFillButton, gridBagConstraints3);
252
253
254         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
255         gridBagConstraints1.gridx = 0;
256         gridBagConstraints1.gridy = 1;
257         gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
258         gridBagConstraints1.weightx = 1.0;
259         gridBagConstraints1.weighty = 1.0;
260         add(fillPanel, gridBagConstraints1);
261
262         ipadPanel = new javax.swing.JPanel JavaDoc();
263         ipadPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
264         java.awt.GridBagConstraints JavaDoc gridBagConstraints4;
265         ipadPanel.setBorder(new javax.swing.border.TitledBorder JavaDoc(
266             new javax.swing.border.EtchedBorder JavaDoc(), "iPaddingPanel")); // NOI18N
267

268         jLabel1 = new javax.swing.JLabel JavaDoc();
269         jLabel1.setIcon(new ImageIcon(Utilities.loadImage(
270             "org/netbeans/modules/form/layoutsupport/resources/horizontalGr.gif"))); // NOI18N
271

272         gridBagConstraints4 = new java.awt.GridBagConstraints JavaDoc();
273         gridBagConstraints4.insets = new java.awt.Insets JavaDoc(0, 0, 0, 5);
274         ipadPanel.add(jLabel1, gridBagConstraints4);
275
276         ipadHMButton = new javax.swing.JButton JavaDoc();
277         ipadHMButton.setIcon(new ImageIcon(Utilities.loadImage(
278             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
279
ipadHMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
280         ipadHMButton.setActionCommand("HM"); // NOI18N
281
ipadHMButton.addActionListener(actionLsnr);
282
283         gridBagConstraints4 = new java.awt.GridBagConstraints JavaDoc();
284         ipadPanel.add(ipadHMButton, gridBagConstraints4);
285
286         ipadHPButton = new javax.swing.JButton JavaDoc();
287         ipadHPButton.setIcon(new ImageIcon(Utilities.loadImage(
288             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
289
ipadHPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
290         ipadHPButton.setActionCommand("HP"); // NOI18N
291
ipadHPButton.addActionListener(actionLsnr);
292
293         gridBagConstraints4 = new java.awt.GridBagConstraints JavaDoc();
294         gridBagConstraints4.gridwidth = 0;
295         ipadPanel.add(ipadHPButton, gridBagConstraints4);
296
297         jLabel2 = new javax.swing.JLabel JavaDoc();
298         jLabel2.setIcon(new ImageIcon(Utilities.loadImage(
299             "org/netbeans/modules/form/layoutsupport/resources/verticalGr.gif"))); // NOI18N
300

301         gridBagConstraints4 = new java.awt.GridBagConstraints JavaDoc();
302         gridBagConstraints4.insets = new java.awt.Insets JavaDoc(0, 0, 4, 5);
303         ipadPanel.add(jLabel2, gridBagConstraints4);
304
305         ipadVMButton = new javax.swing.JButton JavaDoc();
306         ipadVMButton.setIcon(new ImageIcon(Utilities.loadImage(
307             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
308
ipadVMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
309         ipadVMButton.setActionCommand("VM"); // NOI18N
310
ipadVMButton.addActionListener(actionLsnr);
311
312         gridBagConstraints4 = new java.awt.GridBagConstraints JavaDoc();
313         gridBagConstraints4.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
314         ipadPanel.add(ipadVMButton, gridBagConstraints4);
315
316         ipadVPButton = new javax.swing.JButton JavaDoc();
317         ipadVPButton.setIcon(new ImageIcon(Utilities.loadImage(
318             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
319
ipadVPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
320         ipadVPButton.setActionCommand("VP"); // NOI18N
321
ipadVPButton.addActionListener(actionLsnr);
322
323         gridBagConstraints4 = new java.awt.GridBagConstraints JavaDoc();
324         gridBagConstraints4.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
325         ipadPanel.add(ipadVPButton, gridBagConstraints4);
326
327
328         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
329         gridBagConstraints1.gridx = 0;
330         gridBagConstraints1.gridy = 2;
331         gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
332         gridBagConstraints1.weightx = 1.0;
333         gridBagConstraints1.weighty = 1.0;
334         add(ipadPanel, gridBagConstraints1);
335
336         insetsPanel = new javax.swing.JPanel JavaDoc();
337         insetsPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
338         java.awt.GridBagConstraints JavaDoc gridBagConstraints5;
339         insetsPanel.setBorder(new javax.swing.border.TitledBorder JavaDoc(
340             new javax.swing.border.EtchedBorder JavaDoc(), "insetsPanel")); // NOI18N
341

342         topMButton = new javax.swing.JButton JavaDoc();
343         topMButton.setIcon(new ImageIcon(Utilities.loadImage(
344             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
345
topMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
346         topMButton.setActionCommand("tM"); // NOI18N
347
topMButton.addActionListener(actionLsnr);
348
349         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
350         gridBagConstraints5.gridx = 1;
351         gridBagConstraints5.gridy = 0;
352         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(0, 0, 8, 0);
353         gridBagConstraints5.anchor = java.awt.GridBagConstraints.NORTH;
354         insetsPanel.add(topMButton, gridBagConstraints5);
355
356         topPButton = new javax.swing.JButton JavaDoc();
357         topPButton.setIcon(new ImageIcon(Utilities.loadImage(
358             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
359
topPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
360         topPButton.setActionCommand("tP"); // NOI18N
361
topPButton.addActionListener(actionLsnr);
362
363         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
364         gridBagConstraints5.gridx = 2;
365         gridBagConstraints5.gridy = 0;
366         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(0, 0, 8, 0);
367         gridBagConstraints5.anchor = java.awt.GridBagConstraints.NORTH;
368         insetsPanel.add(topPButton, gridBagConstraints5);
369
370         leftPButton = new javax.swing.JButton JavaDoc();
371         leftPButton.setIcon(new ImageIcon(Utilities.loadImage(
372             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
373
leftPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
374         leftPButton.setActionCommand("lP"); // NOI18N
375
leftPButton.addActionListener(actionLsnr);
376
377         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
378         gridBagConstraints5.gridx = 0;
379         gridBagConstraints5.gridy = 0;
380         gridBagConstraints5.anchor = java.awt.GridBagConstraints.SOUTHEAST;
381         insetsPanel.add(leftPButton, gridBagConstraints5);
382
383         leftMButton = new javax.swing.JButton JavaDoc();
384         leftMButton.setIcon(new ImageIcon(Utilities.loadImage(
385             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
386
leftMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
387         leftMButton.setActionCommand("lM"); // NOI18N
388
leftMButton.addActionListener(actionLsnr);
389
390         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
391         gridBagConstraints5.gridx = 0;
392         gridBagConstraints5.gridy = 1;
393         gridBagConstraints5.anchor = java.awt.GridBagConstraints.NORTHEAST;
394         insetsPanel.add(leftMButton, gridBagConstraints5);
395
396         rightPButton = new javax.swing.JButton JavaDoc();
397         rightPButton.setIcon(new ImageIcon(Utilities.loadImage(
398             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
399
rightPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
400         rightPButton.setActionCommand("rP"); // NOI18N
401
rightPButton.addActionListener(actionLsnr);
402
403         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
404         gridBagConstraints5.gridx = 3;
405         gridBagConstraints5.gridy = 0;
406         gridBagConstraints5.anchor = java.awt.GridBagConstraints.SOUTH;
407         insetsPanel.add(rightPButton, gridBagConstraints5);
408
409         rightMButton = new javax.swing.JButton JavaDoc();
410         rightMButton.setIcon(new ImageIcon(Utilities.loadImage(
411             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
412
rightMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
413         rightMButton.setActionCommand("rM"); // NOI18N
414
rightMButton.addActionListener(actionLsnr);
415
416         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
417         gridBagConstraints5.gridx = 3;
418         gridBagConstraints5.gridy = 1;
419         gridBagConstraints5.anchor = java.awt.GridBagConstraints.NORTH;
420         insetsPanel.add(rightMButton, gridBagConstraints5);
421
422         bottomMButton = new javax.swing.JButton JavaDoc();
423         bottomMButton.setIcon(new ImageIcon(Utilities.loadImage(
424             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
425
bottomMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
426         bottomMButton.setActionCommand("bM"); // NOI18N
427
bottomMButton.addActionListener(actionLsnr);
428
429         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
430         gridBagConstraints5.gridx = 1;
431         gridBagConstraints5.gridy = 1;
432         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(8, 0, 0, 0);
433         insetsPanel.add(bottomMButton, gridBagConstraints5);
434
435         bottomPButton = new javax.swing.JButton JavaDoc();
436         bottomPButton.setIcon(new ImageIcon(Utilities.loadImage(
437             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
438
bottomPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
439         bottomPButton.setActionCommand("bP"); // NOI18N
440
bottomPButton.addActionListener(actionLsnr);
441
442         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
443         gridBagConstraints5.gridx = 2;
444         gridBagConstraints5.gridy = 1;
445         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(8, 0, 0, 0);
446         insetsPanel.add(bottomPButton, gridBagConstraints5);
447
448         jLabel3 = new javax.swing.JLabel JavaDoc();
449         jLabel3.setIcon(new ImageIcon(Utilities.loadImage(
450             "org/netbeans/modules/form/layoutsupport/resources/horizontalGr.gif"))); // NOI18N
451

452         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
453         gridBagConstraints5.gridx = 0;
454         gridBagConstraints5.gridy = 2;
455         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(8, 0, 0, 5);
456         insetsPanel.add(jLabel3, gridBagConstraints5);
457
458         HMButton = new javax.swing.JButton JavaDoc();
459         HMButton.setIcon(new ImageIcon(Utilities.loadImage(
460             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
461
HMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
462         HMButton.setActionCommand("HM"); // NOI18N
463
HMButton.addActionListener(actionLsnr);
464
465         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
466         gridBagConstraints5.gridx = 1;
467         gridBagConstraints5.gridy = 2;
468         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(8, 0, 0, 0);
469         insetsPanel.add(HMButton, gridBagConstraints5);
470
471         HPButton = new javax.swing.JButton JavaDoc();
472         HPButton.setIcon(new ImageIcon(Utilities.loadImage(
473             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
474
HPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
475         HPButton.setActionCommand("HP"); // NOI18N
476
HPButton.addActionListener(actionLsnr);
477
478         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
479         gridBagConstraints5.gridx = 2;
480         gridBagConstraints5.gridy = 2;
481         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(8, 0, 0, 0);
482         insetsPanel.add(HPButton, gridBagConstraints5);
483
484         jLabel4 = new javax.swing.JLabel JavaDoc();
485         jLabel4.setIcon(new ImageIcon(Utilities.loadImage(
486             "org/netbeans/modules/form/layoutsupport/resources/verticalGr.gif"))); // NOI18N
487

488         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
489         gridBagConstraints5.gridx = 0;
490         gridBagConstraints5.gridy = 3;
491         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(0, 0, 0, 5);
492         insetsPanel.add(jLabel4, gridBagConstraints5);
493
494         VMButton = new javax.swing.JButton JavaDoc();
495         VMButton.setIcon(new ImageIcon(Utilities.loadImage(
496             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
497
VMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
498         VMButton.setActionCommand("VM"); // NOI18N
499
VMButton.addActionListener(actionLsnr);
500
501         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
502         gridBagConstraints5.gridx = 1;
503         gridBagConstraints5.gridy = 3;
504         insetsPanel.add(VMButton, gridBagConstraints5);
505
506         VPButton = new javax.swing.JButton JavaDoc();
507         VPButton.setIcon(new ImageIcon(Utilities.loadImage(
508             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
509
VPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
510         VPButton.setActionCommand("VP"); // NOI18N
511
VPButton.addActionListener(actionLsnr);
512
513         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
514         gridBagConstraints5.gridx = 2;
515         gridBagConstraints5.gridy = 3;
516         insetsPanel.add(VPButton, gridBagConstraints5);
517
518         jLabel5 = new javax.swing.JLabel JavaDoc();
519         jLabel5.setIcon(new ImageIcon(Utilities.loadImage(
520             "org/netbeans/modules/form/layoutsupport/resources/bothGr.gif"))); // NOI18N
521

522         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
523         gridBagConstraints5.gridx = 0;
524         gridBagConstraints5.gridy = 4;
525         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(0, 0, 4, 5);
526         insetsPanel.add(jLabel5, gridBagConstraints5);
527
528         BMButton = new javax.swing.JButton JavaDoc();
529         BMButton.setIcon(new ImageIcon(Utilities.loadImage(
530             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
531
BMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
532         BMButton.setActionCommand("BM"); // NOI18N
533
BMButton.addActionListener(actionLsnr);
534
535         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
536         gridBagConstraints5.gridx = 1;
537         gridBagConstraints5.gridy = 4;
538         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
539         insetsPanel.add(BMButton, gridBagConstraints5);
540
541         BPButton = new javax.swing.JButton JavaDoc();
542         BPButton.setIcon(new ImageIcon(Utilities.loadImage(
543             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
544
BPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
545         BPButton.setActionCommand("BP"); // NOI18N
546
BPButton.addActionListener(actionLsnr);
547
548         gridBagConstraints5 = new java.awt.GridBagConstraints JavaDoc();
549         gridBagConstraints5.gridx = 2;
550         gridBagConstraints5.gridy = 4;
551         gridBagConstraints5.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
552         insetsPanel.add(BPButton, gridBagConstraints5);
553
554
555         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
556         gridBagConstraints1.gridheight = 2;
557         gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
558         gridBagConstraints1.weightx = 1.0;
559         gridBagConstraints1.weighty = 1.0;
560         add(insetsPanel, gridBagConstraints1);
561
562         gridSizePanel = new javax.swing.JPanel JavaDoc();
563         gridSizePanel.setLayout(new java.awt.GridBagLayout JavaDoc());
564         java.awt.GridBagConstraints JavaDoc gridBagConstraints6;
565         gridSizePanel.setBorder(new javax.swing.border.TitledBorder JavaDoc(
566             new javax.swing.border.EtchedBorder JavaDoc(), "panelSizePanel")); // NOI18N
567

568         jLabel6 = new javax.swing.JLabel JavaDoc();
569         jLabel6.setIcon(new ImageIcon(Utilities.loadImage(
570             "org/netbeans/modules/form/layoutsupport/resources/horizontalGr.gif"))); // NOI18N
571

572         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
573         gridBagConstraints6.insets = new java.awt.Insets JavaDoc(0, 0, 0, 5);
574         gridSizePanel.add(jLabel6, gridBagConstraints6);
575
576         gridSizeHMButton = new javax.swing.JButton JavaDoc();
577         gridSizeHMButton.setIcon(new ImageIcon(Utilities.loadImage(
578             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
579
gridSizeHMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
580         gridSizeHMButton.setActionCommand("HM"); // NOI18N
581
gridSizeHMButton.addActionListener(actionLsnr);
582
583         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
584         gridSizePanel.add(gridSizeHMButton, gridBagConstraints6);
585
586         gridSizeHPButton = new javax.swing.JButton JavaDoc();
587         gridSizeHPButton.setIcon(new ImageIcon(Utilities.loadImage(
588             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
589
gridSizeHPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
590         gridSizeHPButton.setActionCommand("HP"); // NOI18N
591
gridSizeHPButton.addActionListener(actionLsnr);
592
593         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
594         gridSizePanel.add(gridSizeHPButton, gridBagConstraints6);
595
596         gsRHButton = new javax.swing.JToggleButton JavaDoc();
597         gsRHButton.setIcon(new ImageIcon(Utilities.loadImage(
598             "org/netbeans/modules/form/layoutsupport/resources/remainder.gif"))); // NOI18N
599
gsRHButton.setMargin(new java.awt.Insets JavaDoc(5, 5, 5, 5));
600         gsRHButton.setActionCommand("HR"); // NOI18N
601
gsRHButton.addActionListener(actionLsnr);
602
603         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
604         gridBagConstraints6.gridwidth = 0;
605         gridSizePanel.add(gsRHButton, gridBagConstraints6);
606
607         jLabel8 = new javax.swing.JLabel JavaDoc();
608         jLabel8.setIcon(new ImageIcon(Utilities.loadImage(
609             "org/netbeans/modules/form/layoutsupport/resources/verticalGr.gif"))); // NOI18N
610

611         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
612         gridBagConstraints6.insets = new java.awt.Insets JavaDoc(0, 0, 4, 5);
613         gridSizePanel.add(jLabel8, gridBagConstraints6);
614
615         gridSizeVMButton = new javax.swing.JButton JavaDoc();
616         gridSizeVMButton.setIcon(new ImageIcon(Utilities.loadImage(
617             "org/netbeans/modules/form/layoutsupport/resources/minus.gif"))); // NOI18N
618
gridSizeVMButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
619         gridSizeVMButton.setActionCommand("VM"); // NOI18N
620
gridSizeVMButton.addActionListener(actionLsnr);
621
622         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
623         gridBagConstraints6.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
624         gridSizePanel.add(gridSizeVMButton, gridBagConstraints6);
625
626         gridSizeVPButton = new javax.swing.JButton JavaDoc();
627         gridSizeVPButton.setIcon(new ImageIcon(Utilities.loadImage(
628             "org/netbeans/modules/form/layoutsupport/resources/plus.gif"))); // NOI18N
629
gridSizeVPButton.setMargin(new java.awt.Insets JavaDoc(2, 2, 2, 2));
630         gridSizeVPButton.setActionCommand("VP"); // NOI18N
631
gridSizeVPButton.addActionListener(actionLsnr);
632
633         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
634         gridBagConstraints6.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
635         gridSizePanel.add(gridSizeVPButton, gridBagConstraints6);
636
637         gsRVButton = new javax.swing.JToggleButton JavaDoc();
638         gsRVButton.setIcon(new ImageIcon(Utilities.loadImage(
639             "org/netbeans/modules/form/layoutsupport/resources/remainder.gif"))); // NOI18N
640
gsRVButton.setMargin(new java.awt.Insets JavaDoc(5, 5, 5, 5));
641         gsRVButton.setActionCommand("VR"); // NOI18N
642
gsRVButton.addActionListener(actionLsnr);
643
644         gridBagConstraints6 = new java.awt.GridBagConstraints JavaDoc();
645         gridBagConstraints6.gridwidth = 0;
646         gridBagConstraints6.insets = new java.awt.Insets JavaDoc(0, 0, 4, 0);
647         gridSizePanel.add(gsRVButton, gridBagConstraints6);
648
649
650         gridBagConstraints1 = new java.awt.GridBagConstraints JavaDoc();
651         gridBagConstraints1.gridx = 1;
652         gridBagConstraints1.gridy = 2;
653         gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
654         gridBagConstraints1.weightx = 1.0;
655         gridBagConstraints1.weighty = 1.0;
656         add(gridSizePanel, gridBagConstraints1);
657
658     }
659
660     private void gridSizeButtonAction(java.awt.event.ActionEvent JavaDoc evt) {
661         int what = evt.getActionCommand().charAt(0) == 'H' ? GridBagCustomizer.HORIZONTAL : GridBagCustomizer.VERTICAL;
662         int action = 0;
663
664         switch (evt.getActionCommand().charAt(1)) {
665             case 'P':
666                 action = GridBagCustomizer.PLUS;
667                 break;
668             case 'M':
669                 action = GridBagCustomizer.MINUS;
670                 break;
671             case 'R':
672                 action = 0;
673                 break;
674             default:
675                 return;
676         }
677         customizer.modifyGridSize(action, what);
678     }
679
680     private void insetsButtonAction(java.awt.event.ActionEvent JavaDoc evt) {
681         int action = evt.getActionCommand().charAt(1) == 'P' ? GridBagCustomizer.PLUS : GridBagCustomizer.MINUS;
682         int what = 0;
683
684         switch (evt.getActionCommand().charAt(0)) {
685             case 't':
686                 what = GridBagCustomizer.TOP;
687                 break;
688             case 'l':
689                 what = GridBagCustomizer.LEFT;
690                 break;
691             case 'b':
692                 what = GridBagCustomizer.BOTTOM;
693                 break;
694             case 'r':
695                 what = GridBagCustomizer.RIGHT;
696                 break;
697             case 'H':
698                 what = GridBagCustomizer.HORIZONTAL;
699                 break;
700             case 'V':
701                 what = GridBagCustomizer.VERTICAL;
702                 break;
703             case 'B':
704                 what = GridBagCustomizer.HORIZONTAL + GridBagCustomizer.VERTICAL;
705                 break;
706         }
707         customizer.modifyInsets(action, what);
708     }
709
710     private void ipadButtonAction(java.awt.event.ActionEvent JavaDoc evt) {
711         if (evt.getActionCommand().equals("HM")) // NOI18N
712
customizer.modifyIPad(GridBagCustomizer.MINUS, GridBagCustomizer.HORIZONTAL);
713         else if (evt.getActionCommand().equals("HP")) // NOI18N
714
customizer.modifyIPad(GridBagCustomizer.PLUS, GridBagCustomizer.HORIZONTAL);
715         else if (evt.getActionCommand().equals("VM")) // NOI18N
716
customizer.modifyIPad(GridBagCustomizer.MINUS, GridBagCustomizer.VERTICAL);
717         else if (evt.getActionCommand().equals("VP")) // NOI18N
718
customizer.modifyIPad(GridBagCustomizer.PLUS, GridBagCustomizer.VERTICAL);
719     }
720
721     private void fillButtonAction(java.awt.event.ActionEvent JavaDoc evt) {
722         if (horizontalFillButton.isSelected() && verticalFillButton.isSelected())
723             customizer.setFill(java.awt.GridBagConstraints.BOTH);
724         else if (horizontalFillButton.isSelected())
725             customizer.setFill(java.awt.GridBagConstraints.HORIZONTAL);
726         else if (verticalFillButton.isSelected())
727             customizer.setFill(java.awt.GridBagConstraints.VERTICAL);
728         else
729             customizer.setFill(java.awt.GridBagConstraints.NONE);
730     }
731
732     private void anchorButtonAction(java.awt.event.ActionEvent JavaDoc evt) {
733         String JavaDoc command = evt.getActionCommand();
734
735         if (command.equals("NW")) // NOI18N
736
customizer.setAnchor(java.awt.GridBagConstraints.NORTHWEST);
737         else if (command.equals("N")) // NOI18N
738
customizer.setAnchor(java.awt.GridBagConstraints.NORTH);
739         else if (command.equals("NE")) // NOI18N
740
customizer.setAnchor(java.awt.GridBagConstraints.NORTHEAST);
741         else if (command.equals("W")) // NOI18N
742
customizer.setAnchor(java.awt.GridBagConstraints.WEST);
743         else if (command.equals("C")) // NOI18N
744
customizer.setAnchor(java.awt.GridBagConstraints.CENTER);
745         else if (command.equals("E")) // NOI18N
746
customizer.setAnchor(java.awt.GridBagConstraints.EAST);
747         else if (command.equals("SW")) // NOI18N
748
customizer.setAnchor(java.awt.GridBagConstraints.SOUTHWEST);
749         else if (command.equals("S")) // NOI18N
750
customizer.setAnchor(java.awt.GridBagConstraints.SOUTH);
751         else if (command.equals("SE")) // NOI18N
752
customizer.setAnchor(java.awt.GridBagConstraints.SOUTHEAST);
753     }
754
755
756     private javax.swing.JPanel JavaDoc anchorPanel;
757     private javax.swing.JToggleButton JavaDoc nwButton;
758     private javax.swing.JToggleButton JavaDoc nButton;
759     private javax.swing.JToggleButton JavaDoc neButton;
760     private javax.swing.JToggleButton JavaDoc wButton;
761     private javax.swing.JToggleButton JavaDoc cButton;
762     private javax.swing.JToggleButton JavaDoc eButton;
763     private javax.swing.JToggleButton JavaDoc swButton;
764     private javax.swing.JToggleButton JavaDoc sButton;
765     private javax.swing.JToggleButton JavaDoc seButton;
766     private javax.swing.JPanel JavaDoc fillPanel;
767     private javax.swing.JToggleButton JavaDoc horizontalFillButton;
768     private javax.swing.JToggleButton JavaDoc verticalFillButton;
769     private javax.swing.JPanel JavaDoc ipadPanel;
770     private javax.swing.JLabel JavaDoc jLabel1;
771     private javax.swing.JButton JavaDoc ipadHMButton;
772     private javax.swing.JButton JavaDoc ipadHPButton;
773     private javax.swing.JLabel JavaDoc jLabel2;
774     private javax.swing.JButton JavaDoc ipadVMButton;
775     private javax.swing.JButton JavaDoc ipadVPButton;
776     private javax.swing.JPanel JavaDoc insetsPanel;
777     private javax.swing.JButton JavaDoc topMButton;
778     private javax.swing.JButton JavaDoc topPButton;
779     private javax.swing.JButton JavaDoc leftPButton;
780     private javax.swing.JButton JavaDoc leftMButton;
781     private javax.swing.JButton JavaDoc rightPButton;
782     private javax.swing.JButton JavaDoc rightMButton;
783     private javax.swing.JButton JavaDoc bottomMButton;
784     private javax.swing.JButton JavaDoc bottomPButton;
785     private javax.swing.JLabel JavaDoc jLabel3;
786     private javax.swing.JButton JavaDoc HMButton;
787     private javax.swing.JButton JavaDoc HPButton;
788     private javax.swing.JLabel JavaDoc jLabel4;
789     private javax.swing.JButton JavaDoc VMButton;
790     private javax.swing.JButton JavaDoc VPButton;
791     private javax.swing.JLabel JavaDoc jLabel5;
792     private javax.swing.JButton JavaDoc BMButton;
793     private javax.swing.JButton JavaDoc BPButton;
794     private javax.swing.JPanel JavaDoc gridSizePanel;
795     private javax.swing.JLabel JavaDoc jLabel6;
796     private javax.swing.JButton JavaDoc gridSizeHMButton;
797     private javax.swing.JButton JavaDoc gridSizeHPButton;
798     private javax.swing.JToggleButton JavaDoc gsRHButton;
799     private javax.swing.JLabel JavaDoc jLabel8;
800     private javax.swing.JButton JavaDoc gridSizeVMButton;
801     private javax.swing.JButton JavaDoc gridSizeVPButton;
802     private javax.swing.JToggleButton JavaDoc gsRVButton;
803
804
805     void newSelection(java.util.List JavaDoc proxies) {
806
807         int anchor = -1;
808         boolean noAnchor = false;
809         int fill = -1;
810         boolean noFill = false;
811
812         boolean remainderH = true;
813         boolean remainderV = true;
814
815         java.util.Iterator JavaDoc it = proxies.iterator();
816
817
818         for (int i = 0; it.hasNext(); i++) {
819             GridBagCustomizer.GBComponentProxy p =(GridBagCustomizer.GBComponentProxy) it.next();
820             java.awt.GridBagConstraints JavaDoc con = p.getRealConstraints();
821
822             if (i == 0) {
823                 anchor = con.anchor;
824                 fill = con.fill;
825             }
826             else {
827                 if (con.anchor != anchor)
828                     noAnchor = true;
829                 if (con.fill != fill)
830                     noFill = true;
831             }
832
833             if (con.gridwidth != java.awt.GridBagConstraints.REMAINDER)
834                 remainderH = false;
835
836             if (con.gridheight != java.awt.GridBagConstraints.REMAINDER)
837                 remainderV = false;
838
839         }
840
841         // Set anchor buttons
842

843         nwButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.NORTHWEST);
844         nButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.NORTH);
845         neButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.NORTHEAST);
846         wButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.WEST);
847         cButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.CENTER);
848         eButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.EAST);
849         swButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.SOUTHWEST);
850         sButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.SOUTH);
851         seButton.setSelected((!noAnchor) && anchor == java.awt.GridBagConstraints.SOUTHEAST);
852
853         // Set fill buttons
854
horizontalFillButton.setSelected(!noFill &&
855                                          (fill == java.awt.GridBagConstraints.HORIZONTAL || fill == java.awt.GridBagConstraints.BOTH));
856
857         verticalFillButton.setSelected(!noFill &&
858                                        (fill == java.awt.GridBagConstraints.VERTICAL || fill == java.awt.GridBagConstraints.BOTH));
859
860         // Set remainder buttons
861
gsRHButton.setSelected(remainderH);
862         gsRVButton.setSelected(remainderV);
863     }
864
865     private class ActionL implements java.awt.event.ActionListener JavaDoc {
866         public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
867             Object JavaDoc src = evt.getSource();
868         if (nwButton.equals (src)
869         || nButton.equals (src)
870         || neButton.equals (src)
871         || wButton.equals (src)
872         || cButton.equals (src)
873         || eButton.equals (src)
874         || swButton.equals (src)
875         || sButton.equals (src)
876         || seButton.equals (src)
877         ) {
878                 anchorButtonAction(evt);
879         }
880             else if (horizontalFillButton.equals(src)
881              || verticalFillButton.equals(src)
882              )
883         {
884                 fillButtonAction(evt);
885             }
886             else if (ipadHMButton.equals(src)
887              || ipadHPButton.equals(src)
888              || ipadVMButton.equals(src)
889              || ipadVPButton.equals(src)
890              )
891         {
892                 ipadButtonAction(evt);
893             }
894             else if (BMButton.equals(src)
895         || BPButton.equals(src)
896         || HMButton.equals(src)
897         || HPButton.equals(src)
898         || VMButton.equals(src)
899         || VPButton.equals(src)
900         || topPButton.equals(src)
901         || topMButton.equals(src)
902         || leftPButton.equals(src)
903         || leftMButton.equals(src)
904         || rightPButton.equals(src)
905         || rightMButton.equals(src)
906         || bottomPButton.equals(src)
907         || bottomMButton.equals(src)
908         )
909         {
910                 insetsButtonAction(evt);
911             }
912             else if (gridSizeHMButton.equals(src)
913              || gridSizeHPButton.equals(src)
914              || gsRHButton.equals(src)
915              || gridSizeVMButton.equals(src)
916              || gridSizeVPButton.equals(src)
917              || gsRVButton.equals(src)
918              )
919         {
920                 gridSizeButtonAction(evt);
921             }
922         }
923     }
924 }
925
Popular Tags