gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.swing / org.gvsig.tools.swing.impl / src / main / java / org / gvsig / tools / swing / impl / dynclass / DynFieldView.java @ 1405
History | View | Annotate | Download (19.5 KB)
1 |
package org.gvsig.tools.swing.impl.dynclass; |
---|---|
2 |
|
3 |
import com.jeta.forms.components.separator.TitledSeparator; |
4 |
import com.jeta.open.i18n.I18NUtils; |
5 |
import com.jgoodies.forms.layout.CellConstraints; |
6 |
import com.jgoodies.forms.layout.FormLayout; |
7 |
import java.awt.BorderLayout; |
8 |
import java.awt.ComponentOrientation; |
9 |
import java.awt.Container; |
10 |
import java.awt.Dimension; |
11 |
import javax.swing.Box; |
12 |
import javax.swing.ImageIcon; |
13 |
import javax.swing.JButton; |
14 |
import javax.swing.JCheckBox; |
15 |
import javax.swing.JComboBox; |
16 |
import javax.swing.JFrame; |
17 |
import javax.swing.JLabel; |
18 |
import javax.swing.JPanel; |
19 |
import javax.swing.JScrollPane; |
20 |
import javax.swing.JSpinner; |
21 |
import javax.swing.JTabbedPane; |
22 |
import javax.swing.JTable; |
23 |
import javax.swing.JTextArea; |
24 |
import javax.swing.JTextField; |
25 |
|
26 |
|
27 |
public class DynFieldView extends JPanel |
28 |
{ |
29 |
JTabbedPane jtabbedpane1 = new JTabbedPane(); |
30 |
JComboBox cboCalculate = new JComboBox(); |
31 |
JSpinner spnOrder = new JSpinner(); |
32 |
JComboBox cboSubtype = new JComboBox(); |
33 |
JComboBox cboGroup = new JComboBox(); |
34 |
JTextArea txtDescription = new JTextArea(); |
35 |
JTextField txtName = new JTextField(); |
36 |
JTextField txtLabel = new JTextField(); |
37 |
JCheckBox chkMandatory = new JCheckBox(); |
38 |
JCheckBox chkHidden = new JCheckBox(); |
39 |
JCheckBox chkReadonly = new JCheckBox(); |
40 |
JComboBox cboType = new JComboBox(); |
41 |
JComboBox cboDynClassOfValue = new JComboBox(); |
42 |
JComboBox cboClassOfValue = new JComboBox(); |
43 |
JComboBox cboClassOfItems = new JComboBox(); |
44 |
JComboBox cboDynClassOfItems = new JComboBox(); |
45 |
JComboBox cboTypeOfItems = new JComboBox(); |
46 |
JTextField txtDefaultvalue = new JTextField(); |
47 |
JTextField txtMaxValue = new JTextField(); |
48 |
JTextField txtMinValue = new JTextField(); |
49 |
JComboBox cboAvailableValuesMethod = new JComboBox(); |
50 |
JTable tblAvailableValues = new JTable(); |
51 |
JButton btnModiyAvailableValue = new JButton(); |
52 |
JButton btnAddAvailableValue = new JButton(); |
53 |
JButton btnDeleteAvailableValue = new JButton(); |
54 |
JTable tblTags = new JTable(); |
55 |
JButton btnModifyTag = new JButton(); |
56 |
JButton btnAddTag = new JButton(); |
57 |
JButton btnDeleteTag = new JButton(); |
58 |
|
59 |
/**
|
60 |
* Default constructor
|
61 |
*/
|
62 |
public DynFieldView()
|
63 |
{ |
64 |
initializePanel(); |
65 |
} |
66 |
|
67 |
/**
|
68 |
* Adds fill components to empty cells in the first row and first column of the grid.
|
69 |
* This ensures that the grid spacing will be the same as shown in the designer.
|
70 |
* @param cols an array of column indices in the first row where fill components should be added.
|
71 |
* @param rows an array of row indices in the first column where fill components should be added.
|
72 |
*/
|
73 |
void addFillComponents( Container panel, int[] cols, int[] rows ) |
74 |
{ |
75 |
Dimension filler = new Dimension(10,10); |
76 |
|
77 |
boolean filled_cell_11 = false; |
78 |
CellConstraints cc = new CellConstraints();
|
79 |
if ( cols.length > 0 && rows.length > 0 ) |
80 |
{ |
81 |
if ( cols[0] == 1 && rows[0] == 1 ) |
82 |
{ |
83 |
/** add a rigid area */
|
84 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); |
85 |
filled_cell_11 = true;
|
86 |
} |
87 |
} |
88 |
|
89 |
for( int index = 0; index < cols.length; index++ ) |
90 |
{ |
91 |
if ( cols[index] == 1 && filled_cell_11 ) |
92 |
{ |
93 |
continue;
|
94 |
} |
95 |
panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); |
96 |
} |
97 |
|
98 |
for( int index = 0; index < rows.length; index++ ) |
99 |
{ |
100 |
if ( rows[index] == 1 && filled_cell_11 ) |
101 |
{ |
102 |
continue;
|
103 |
} |
104 |
panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); |
105 |
} |
106 |
|
107 |
} |
108 |
|
109 |
/**
|
110 |
* Helper method to load an image file from the CLASSPATH
|
111 |
* @param imageName the package and name of the file to load relative to the CLASSPATH
|
112 |
* @return an ImageIcon instance with the specified image file
|
113 |
* @throws IllegalArgumentException if the image resource cannot be loaded.
|
114 |
*/
|
115 |
public ImageIcon loadImage( String imageName ) |
116 |
{ |
117 |
try
|
118 |
{ |
119 |
ClassLoader classloader = getClass().getClassLoader();
|
120 |
java.net.URL url = classloader.getResource( imageName ); |
121 |
if ( url != null ) |
122 |
{ |
123 |
ImageIcon icon = new ImageIcon( url ); |
124 |
return icon;
|
125 |
} |
126 |
} |
127 |
catch( Exception e ) |
128 |
{ |
129 |
e.printStackTrace(); |
130 |
} |
131 |
throw new IllegalArgumentException( "Unable to load image: " + imageName ); |
132 |
} |
133 |
|
134 |
/**
|
135 |
* Method for recalculating the component orientation for
|
136 |
* right-to-left Locales.
|
137 |
* @param orientation the component orientation to be applied
|
138 |
*/
|
139 |
public void applyComponentOrientation( ComponentOrientation orientation ) |
140 |
{ |
141 |
// Not yet implemented...
|
142 |
// I18NUtils.applyComponentOrientation(this, orientation);
|
143 |
super.applyComponentOrientation(orientation);
|
144 |
} |
145 |
|
146 |
public JPanel createPanel() |
147 |
{ |
148 |
JPanel jpanel1 = new JPanel(); |
149 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE"); |
150 |
CellConstraints cc = new CellConstraints();
|
151 |
jpanel1.setLayout(formlayout1); |
152 |
|
153 |
jtabbedpane1.addTab("General",null,createPanel1()); |
154 |
jtabbedpane1.addTab("Values",null,createPanel4()); |
155 |
jtabbedpane1.addTab("Tags",null,createPanel6()); |
156 |
jpanel1.add(jtabbedpane1,cc.xy(2,2)); |
157 |
|
158 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3 }); |
159 |
return jpanel1;
|
160 |
} |
161 |
|
162 |
public JPanel createPanel1() |
163 |
{ |
164 |
JPanel jpanel1 = new JPanel(); |
165 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE"); |
166 |
CellConstraints cc = new CellConstraints();
|
167 |
jpanel1.setLayout(formlayout1); |
168 |
|
169 |
JLabel jlabel1 = new JLabel(); |
170 |
jlabel1.setText("Calculate");
|
171 |
jpanel1.add(jlabel1,cc.xy(2,14)); |
172 |
|
173 |
cboCalculate.setEditable(true);
|
174 |
cboCalculate.setName("cboCalculate");
|
175 |
cboCalculate.setRequestFocusEnabled(false);
|
176 |
cboCalculate.addItem(" ");
|
177 |
cboCalculate.addItem("DAL.getRelatedFeature");
|
178 |
cboCalculate.addItem("DAL.getRelatedFeatures");
|
179 |
jpanel1.add(cboCalculate,cc.xy(4,14)); |
180 |
|
181 |
JLabel jlabel2 = new JLabel(); |
182 |
jlabel2.setText("Order");
|
183 |
jpanel1.add(jlabel2,cc.xy(2,8)); |
184 |
|
185 |
spnOrder.setName("spnOrder");
|
186 |
jpanel1.add(spnOrder,new CellConstraints(4,8,1,1,CellConstraints.FILL,CellConstraints.DEFAULT)); |
187 |
|
188 |
JLabel jlabel3 = new JLabel(); |
189 |
jlabel3.setText("Group");
|
190 |
jpanel1.add(jlabel3,cc.xy(2,6)); |
191 |
|
192 |
JLabel jlabel4 = new JLabel(); |
193 |
jlabel4.setText("Subtype");
|
194 |
jpanel1.add(jlabel4,cc.xy(2,12)); |
195 |
|
196 |
cboSubtype.setEditable(true);
|
197 |
cboSubtype.setName("cboSubtype");
|
198 |
cboSubtype.setRequestFocusEnabled(false);
|
199 |
cboSubtype.addItem(" ");
|
200 |
cboSubtype.addItem("File");
|
201 |
cboSubtype.addItem("Folder");
|
202 |
cboSubtype.addItem("Date");
|
203 |
cboSubtype.addItem("Text");
|
204 |
cboSubtype.addItem("DAL.SimpleFeatureLink");
|
205 |
cboSubtype.addItem("DAL.SimpleFeaturesTableLink");
|
206 |
jpanel1.add(cboSubtype,cc.xy(4,12)); |
207 |
|
208 |
JLabel jlabel5 = new JLabel(); |
209 |
jlabel5.setText("Type");
|
210 |
jpanel1.add(jlabel5,new CellConstraints(2,10,1,1,CellConstraints.DEFAULT,CellConstraints.TOP)); |
211 |
|
212 |
cboGroup.setEditable(true);
|
213 |
cboGroup.setName("cboGroup");
|
214 |
cboGroup.setRequestFocusEnabled(false);
|
215 |
jpanel1.add(cboGroup,cc.xy(4,6)); |
216 |
|
217 |
txtDescription.setName("txtDescription");
|
218 |
txtDescription.setRows(2);
|
219 |
JScrollPane jscrollpane1 = new JScrollPane(); |
220 |
jscrollpane1.setViewportView(txtDescription); |
221 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
|
222 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
223 |
jpanel1.add(jscrollpane1,cc.xywh(2,20,3,1)); |
224 |
|
225 |
JLabel jlabel6 = new JLabel(); |
226 |
jlabel6.setText("Description");
|
227 |
jpanel1.add(jlabel6,cc.xy(2,18)); |
228 |
|
229 |
JLabel jlabel7 = new JLabel(); |
230 |
jlabel7.setText("Name");
|
231 |
jpanel1.add(jlabel7,cc.xy(2,4)); |
232 |
|
233 |
txtName.setName("txtName");
|
234 |
jpanel1.add(txtName,cc.xy(4,4)); |
235 |
|
236 |
JLabel jlabel8 = new JLabel(); |
237 |
jlabel8.setText("Label");
|
238 |
jpanel1.add(jlabel8,cc.xy(2,2)); |
239 |
|
240 |
txtLabel.setName("txtLabel");
|
241 |
jpanel1.add(txtLabel,cc.xy(4,2)); |
242 |
|
243 |
jpanel1.add(createPanel2(),cc.xy(4,16)); |
244 |
jpanel1.add(createPanel3(),cc.xy(4,10)); |
245 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5,6 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21 }); |
246 |
return jpanel1;
|
247 |
} |
248 |
|
249 |
public JPanel createPanel2() |
250 |
{ |
251 |
JPanel jpanel1 = new JPanel(); |
252 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
253 |
CellConstraints cc = new CellConstraints();
|
254 |
jpanel1.setLayout(formlayout1); |
255 |
|
256 |
chkMandatory.setActionCommand("Mandatory");
|
257 |
chkMandatory.setName("chkMandatory");
|
258 |
chkMandatory.setText("Mandatory");
|
259 |
jpanel1.add(chkMandatory,cc.xy(1,1)); |
260 |
|
261 |
chkHidden.setActionCommand("Hidden");
|
262 |
chkHidden.setName("chkHidden");
|
263 |
chkHidden.setText("Hidden");
|
264 |
jpanel1.add(chkHidden,cc.xy(3,1)); |
265 |
|
266 |
chkReadonly.setActionCommand("Read only");
|
267 |
chkReadonly.setName("chkReadonly");
|
268 |
chkReadonly.setText("Read only");
|
269 |
jpanel1.add(chkReadonly,cc.xy(5,1)); |
270 |
|
271 |
addFillComponents(jpanel1,new int[]{ 2,4,6 },new int[0]); |
272 |
return jpanel1;
|
273 |
} |
274 |
|
275 |
public JPanel createPanel3() |
276 |
{ |
277 |
JPanel jpanel1 = new JPanel(); |
278 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE"); |
279 |
CellConstraints cc = new CellConstraints();
|
280 |
jpanel1.setLayout(formlayout1); |
281 |
|
282 |
cboType.setName("cboType");
|
283 |
cboType.addItem("Unknown");
|
284 |
cboType.addItem("Boolean");
|
285 |
cboType.addItem("Byte");
|
286 |
cboType.addItem("Char");
|
287 |
cboType.addItem("Int");
|
288 |
cboType.addItem("Long");
|
289 |
cboType.addItem("Float");
|
290 |
cboType.addItem("Double");
|
291 |
cboType.addItem("String");
|
292 |
cboType.addItem("Date");
|
293 |
cboType.addItem("Time");
|
294 |
cboType.addItem("Timestamp");
|
295 |
cboType.addItem("Byte array");
|
296 |
cboType.addItem("File");
|
297 |
cboType.addItem("Folder");
|
298 |
cboType.addItem("DynObject");
|
299 |
cboType.addItem("URL");
|
300 |
cboType.addItem("URI");
|
301 |
cboType.addItem("Version");
|
302 |
cboType.addItem("List");
|
303 |
cboType.addItem("Set");
|
304 |
cboType.addItem("Map");
|
305 |
jpanel1.add(cboType,cc.xywh(1,1,12,1)); |
306 |
|
307 |
cboDynClassOfValue.setEditable(true);
|
308 |
cboDynClassOfValue.setName("cboDynClassOfValue");
|
309 |
cboDynClassOfValue.setRequestFocusEnabled(false);
|
310 |
jpanel1.add(cboDynClassOfValue,cc.xy(12,3)); |
311 |
|
312 |
JLabel jlabel1 = new JLabel(); |
313 |
jlabel1.setText("DynClass");
|
314 |
jpanel1.add(jlabel1,cc.xy(10,3)); |
315 |
|
316 |
cboClassOfValue.setEditable(true);
|
317 |
cboClassOfValue.setName("cboClassOfValue");
|
318 |
cboClassOfValue.setRequestFocusEnabled(false);
|
319 |
cboClassOfValue.addItem(" ");
|
320 |
cboClassOfValue.addItem("java.lang.String");
|
321 |
cboClassOfValue.addItem("java.lang.Integer");
|
322 |
cboClassOfValue.addItem("java.lang.Long");
|
323 |
cboClassOfValue.addItem("java.lang.Float");
|
324 |
cboClassOfValue.addItem("java.lang.Double");
|
325 |
jpanel1.add(cboClassOfValue,cc.xy(8,3)); |
326 |
|
327 |
JLabel jlabel2 = new JLabel(); |
328 |
jlabel2.setText("Class");
|
329 |
jpanel1.add(jlabel2,cc.xy(6,3)); |
330 |
|
331 |
JLabel jlabel3 = new JLabel(); |
332 |
jlabel3.setText("Value");
|
333 |
jpanel1.add(jlabel3,cc.xy(2,3)); |
334 |
|
335 |
JLabel jlabel4 = new JLabel(); |
336 |
jlabel4.setText("Items");
|
337 |
jpanel1.add(jlabel4,cc.xy(2,5)); |
338 |
|
339 |
JLabel jlabel5 = new JLabel(); |
340 |
jlabel5.setText("Class");
|
341 |
jpanel1.add(jlabel5,cc.xy(6,5)); |
342 |
|
343 |
JLabel jlabel6 = new JLabel(); |
344 |
jlabel6.setText("DynClass");
|
345 |
jpanel1.add(jlabel6,cc.xy(10,5)); |
346 |
|
347 |
cboClassOfItems.setEditable(true);
|
348 |
cboClassOfItems.setName("cboClassOfItems");
|
349 |
cboClassOfItems.setRequestFocusEnabled(false);
|
350 |
cboClassOfItems.addItem(" ");
|
351 |
cboClassOfItems.addItem("java.lang.String");
|
352 |
cboClassOfItems.addItem("java.lang.Integer");
|
353 |
cboClassOfItems.addItem("java.lang.Long");
|
354 |
cboClassOfItems.addItem("java.lang.Float");
|
355 |
cboClassOfItems.addItem("java.lang.Double");
|
356 |
jpanel1.add(cboClassOfItems,cc.xy(8,5)); |
357 |
|
358 |
cboDynClassOfItems.setEditable(true);
|
359 |
cboDynClassOfItems.setName("cboDynClassOfItems");
|
360 |
cboDynClassOfItems.setRequestFocusEnabled(false);
|
361 |
jpanel1.add(cboDynClassOfItems,cc.xy(12,5)); |
362 |
|
363 |
cboTypeOfItems.setName("cboTypeOfItems");
|
364 |
cboTypeOfItems.addItem("Unknown");
|
365 |
cboTypeOfItems.addItem("Boolean");
|
366 |
cboTypeOfItems.addItem("Byte");
|
367 |
cboTypeOfItems.addItem("Char");
|
368 |
cboTypeOfItems.addItem("Int");
|
369 |
cboTypeOfItems.addItem("Long");
|
370 |
cboTypeOfItems.addItem("Float");
|
371 |
cboTypeOfItems.addItem("Double");
|
372 |
cboTypeOfItems.addItem("String");
|
373 |
cboTypeOfItems.addItem("Date");
|
374 |
cboTypeOfItems.addItem("Time");
|
375 |
cboTypeOfItems.addItem("File");
|
376 |
cboTypeOfItems.addItem("Folder");
|
377 |
cboTypeOfItems.addItem("DynObject");
|
378 |
cboTypeOfItems.addItem("URL");
|
379 |
cboTypeOfItems.addItem("URI");
|
380 |
cboTypeOfItems.addItem("Version");
|
381 |
jpanel1.add(cboTypeOfItems,cc.xy(4,5)); |
382 |
|
383 |
addFillComponents(jpanel1,new int[]{ 2,3,4,5,6,7,8,9,10,11,12,13 },new int[]{ 2,3,4,5 }); |
384 |
return jpanel1;
|
385 |
} |
386 |
|
387 |
public JPanel createPanel4() |
388 |
{ |
389 |
JPanel jpanel1 = new JPanel(); |
390 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE"); |
391 |
CellConstraints cc = new CellConstraints();
|
392 |
jpanel1.setLayout(formlayout1); |
393 |
|
394 |
JLabel jlabel1 = new JLabel(); |
395 |
jlabel1.setText("Default value");
|
396 |
jpanel1.add(jlabel1,cc.xy(2,2)); |
397 |
|
398 |
JLabel jlabel2 = new JLabel(); |
399 |
jlabel2.setText("Max");
|
400 |
jpanel1.add(jlabel2,cc.xy(2,4)); |
401 |
|
402 |
JLabel jlabel3 = new JLabel(); |
403 |
jlabel3.setText("Min");
|
404 |
jpanel1.add(jlabel3,cc.xy(2,6)); |
405 |
|
406 |
txtDefaultvalue.setName("txtDefaultvalue");
|
407 |
jpanel1.add(txtDefaultvalue,cc.xy(4,2)); |
408 |
|
409 |
txtMaxValue.setName("txtMaxValue");
|
410 |
jpanel1.add(txtMaxValue,cc.xy(4,4)); |
411 |
|
412 |
txtMinValue.setName("txtMinValue");
|
413 |
jpanel1.add(txtMinValue,cc.xy(4,6)); |
414 |
|
415 |
TitledSeparator titledseparator1 = new TitledSeparator();
|
416 |
titledseparator1.setText("Available values");
|
417 |
jpanel1.add(titledseparator1,cc.xywh(2,8,3,1)); |
418 |
|
419 |
JLabel jlabel4 = new JLabel(); |
420 |
jlabel4.setText("Method");
|
421 |
jpanel1.add(jlabel4,cc.xy(2,10)); |
422 |
|
423 |
cboAvailableValuesMethod.setEditable(true);
|
424 |
cboAvailableValuesMethod.setName("cboAvailableValuesMethod");
|
425 |
cboAvailableValuesMethod.setRequestFocusEnabled(false);
|
426 |
jpanel1.add(cboAvailableValuesMethod,cc.xy(4,10)); |
427 |
|
428 |
JLabel jlabel5 = new JLabel(); |
429 |
jlabel5.setText("Values");
|
430 |
jpanel1.add(jlabel5,cc.xy(2,12)); |
431 |
|
432 |
tblAvailableValues.setName("tblAvailableValues");
|
433 |
JScrollPane jscrollpane1 = new JScrollPane(); |
434 |
jscrollpane1.setViewportView(tblAvailableValues); |
435 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
|
436 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
437 |
jpanel1.add(jscrollpane1,cc.xywh(2,14,3,1)); |
438 |
|
439 |
jpanel1.add(createPanel5(),new CellConstraints(2,16,3,1,CellConstraints.RIGHT,CellConstraints.FILL)); |
440 |
addFillComponents(jpanel1,new int[]{ 1,2,3,4,5 },new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17 }); |
441 |
return jpanel1;
|
442 |
} |
443 |
|
444 |
public JPanel createPanel5() |
445 |
{ |
446 |
JPanel jpanel1 = new JPanel(); |
447 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
448 |
CellConstraints cc = new CellConstraints();
|
449 |
jpanel1.setLayout(formlayout1); |
450 |
|
451 |
btnModiyAvailableValue.setActionCommand("Show");
|
452 |
btnModiyAvailableValue.setName("btnModiyAvailableValue");
|
453 |
btnModiyAvailableValue.setText("Modify");
|
454 |
jpanel1.add(btnModiyAvailableValue,cc.xy(6,1)); |
455 |
|
456 |
btnAddAvailableValue.setActionCommand("Add");
|
457 |
btnAddAvailableValue.setName("btnAddAvailableValue");
|
458 |
btnAddAvailableValue.setText("Add");
|
459 |
jpanel1.add(btnAddAvailableValue,cc.xy(4,1)); |
460 |
|
461 |
btnDeleteAvailableValue.setActionCommand("Delete");
|
462 |
btnDeleteAvailableValue.setName("btnDeleteAvailableValue");
|
463 |
btnDeleteAvailableValue.setText("Delete");
|
464 |
jpanel1.add(btnDeleteAvailableValue,cc.xy(2,1)); |
465 |
|
466 |
addFillComponents(jpanel1,new int[]{ 1,3,5 },new int[]{ 1 }); |
467 |
return jpanel1;
|
468 |
} |
469 |
|
470 |
public JPanel createPanel6() |
471 |
{ |
472 |
JPanel jpanel1 = new JPanel(); |
473 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE"); |
474 |
CellConstraints cc = new CellConstraints();
|
475 |
jpanel1.setLayout(formlayout1); |
476 |
|
477 |
tblTags.setName("tblTags");
|
478 |
JScrollPane jscrollpane1 = new JScrollPane(); |
479 |
jscrollpane1.setViewportView(tblTags); |
480 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
|
481 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
|
482 |
jpanel1.add(jscrollpane1,cc.xy(2,2)); |
483 |
|
484 |
jpanel1.add(createPanel7(),new CellConstraints(2,4,1,1,CellConstraints.RIGHT,CellConstraints.FILL)); |
485 |
addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5 }); |
486 |
return jpanel1;
|
487 |
} |
488 |
|
489 |
public JPanel createPanel7() |
490 |
{ |
491 |
JPanel jpanel1 = new JPanel(); |
492 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE"); |
493 |
CellConstraints cc = new CellConstraints();
|
494 |
jpanel1.setLayout(formlayout1); |
495 |
|
496 |
btnModifyTag.setActionCommand("Show");
|
497 |
btnModifyTag.setName("btnModifyTag");
|
498 |
btnModifyTag.setText("Modify");
|
499 |
jpanel1.add(btnModifyTag,cc.xy(6,1)); |
500 |
|
501 |
btnAddTag.setActionCommand("Add");
|
502 |
btnAddTag.setName("btnAddTag");
|
503 |
btnAddTag.setText("Add");
|
504 |
jpanel1.add(btnAddTag,cc.xy(4,1)); |
505 |
|
506 |
btnDeleteTag.setActionCommand("Delete");
|
507 |
btnDeleteTag.setName("btnDeleteTag");
|
508 |
btnDeleteTag.setText("Delete");
|
509 |
jpanel1.add(btnDeleteTag,cc.xy(2,1)); |
510 |
|
511 |
addFillComponents(jpanel1,new int[]{ 1,3,5 },new int[]{ 1 }); |
512 |
return jpanel1;
|
513 |
} |
514 |
|
515 |
/**
|
516 |
* Initializer
|
517 |
*/
|
518 |
protected void initializePanel() |
519 |
{ |
520 |
setLayout(new BorderLayout()); |
521 |
add(createPanel(), BorderLayout.CENTER);
|
522 |
} |
523 |
|
524 |
|
525 |
} |