Revision 44855 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featurequery/DefaultFeatureQueryCalculatedColumnsPanelView.java
DefaultFeatureQueryCalculatedColumnsPanelView.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.dal.swing.impl.featurequery; |
2 |
|
|
2 | 3 |
import com.jeta.open.i18n.I18NUtils; |
3 | 4 |
import com.jgoodies.forms.layout.CellConstraints; |
4 | 5 |
import com.jgoodies.forms.layout.FormLayout; |
... | ... | |
6 | 7 |
import java.awt.ComponentOrientation; |
7 | 8 |
import java.awt.Container; |
8 | 9 |
import java.awt.Dimension; |
9 |
import java.awt.event.WindowAdapter; |
|
10 |
import java.awt.event.WindowEvent; |
|
11 | 10 |
import javax.swing.Box; |
12 | 11 |
import javax.swing.ImageIcon; |
13 | 12 |
import javax.swing.JButton; |
... | ... | |
17 | 16 |
import javax.swing.JList; |
18 | 17 |
import javax.swing.JPanel; |
19 | 18 |
import javax.swing.JScrollPane; |
19 |
import javax.swing.JTextArea; |
|
20 | 20 |
import javax.swing.JTextField; |
21 | 21 |
import javax.swing.border.EmptyBorder; |
22 | 22 |
|
... | ... | |
39 | 39 |
JComboBox cboColumnDataType = new JComboBox(); |
40 | 40 |
JButton btnApplyChanges = new JButton(); |
41 | 41 |
JButton btnColumnMore = new JButton(); |
42 |
JTextArea txtColumnExpression = new JTextArea(); |
|
43 |
JTextField txtColumnSize = new JTextField(); |
|
42 | 44 |
JLabel lblSize = new JLabel(); |
43 | 45 |
JLabel lblPrecision = new JLabel(); |
44 |
JLabel lblScale = new JLabel(); |
|
45 |
JTextField txtColumnExpression = new JTextField(); |
|
46 |
JTextField txtColumnSize = new JTextField(); |
|
47 | 46 |
JTextField txtColumnPrecision = new JTextField(); |
47 |
JLabel lblScale = new JLabel(); |
|
48 | 48 |
JTextField txtColumnScale = new JTextField(); |
49 | 49 |
|
50 | 50 |
/** |
... | ... | |
56 | 56 |
} |
57 | 57 |
|
58 | 58 |
/** |
59 |
* Main method for panel |
|
60 |
*/ |
|
61 |
public static void main(String[] args) |
|
62 |
{ |
|
63 |
JFrame frame = new JFrame(); |
|
64 |
frame.setSize(600, 400); |
|
65 |
frame.setLocation(100, 100); |
|
66 |
frame.getContentPane().add(new DefaultFeatureQueryCalculatedColumnsPanelView()); |
|
67 |
frame.setVisible(true); |
|
68 |
|
|
69 |
frame.addWindowListener( new WindowAdapter() |
|
70 |
{ |
|
71 |
public void windowClosing( WindowEvent evt ) |
|
72 |
{ |
|
73 |
System.exit(0); |
|
74 |
} |
|
75 |
}); |
|
76 |
} |
|
77 |
|
|
78 |
/** |
|
79 | 59 |
* Adds fill components to empty cells in the first row and first column of the grid. |
80 | 60 |
* This ensures that the grid spacing will be the same as shown in the designer. |
81 | 61 |
* @param cols an array of column indices in the first row where fill components should be added. |
... | ... | |
216 | 196 |
public JPanel createPanel2() |
217 | 197 |
{ |
218 | 198 |
JPanel jpanel1 = new JPanel(); |
219 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU: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");
|
|
199 |
FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE,FILL:DEFAULT:NONE","CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:4DLU:NONE,CENTER:DEFAULT:NONE");
|
|
220 | 200 |
CellConstraints cc = new CellConstraints(); |
221 | 201 |
jpanel1.setLayout(formlayout1); |
222 | 202 |
|
... | ... | |
230 | 210 |
|
231 | 211 |
lblExpression.setName("lblExpression"); |
232 | 212 |
lblExpression.setText("_Expression"); |
233 |
jpanel1.add(lblExpression,cc.xy(1,5));
|
|
213 |
jpanel1.add(lblExpression,new CellConstraints(1,11,1,1,CellConstraints.DEFAULT,CellConstraints.TOP));
|
|
234 | 214 |
|
235 | 215 |
btnColumnExpression.setActionCommand("..."); |
236 | 216 |
btnColumnExpression.setName("btnColumnExpression"); |
237 | 217 |
btnColumnExpression.setText("..."); |
238 | 218 |
EmptyBorder emptyborder1 = new EmptyBorder(2,2,2,2); |
239 | 219 |
btnColumnExpression.setBorder(emptyborder1); |
240 |
jpanel1.add(btnColumnExpression,cc.xy(5,5));
|
|
220 |
jpanel1.add(btnColumnExpression,new CellConstraints(5,11,1,1,CellConstraints.DEFAULT,CellConstraints.TOP));
|
|
241 | 221 |
|
242 | 222 |
btnColumnExpressionHistory.setActionCommand("..."); |
243 | 223 |
btnColumnExpressionHistory.setName("btnColumnExpressionHistory"); |
244 | 224 |
btnColumnExpressionHistory.setText("..."); |
245 | 225 |
EmptyBorder emptyborder2 = new EmptyBorder(2,2,2,2); |
246 | 226 |
btnColumnExpressionHistory.setBorder(emptyborder2); |
247 |
jpanel1.add(btnColumnExpressionHistory,cc.xy(7,5));
|
|
227 |
jpanel1.add(btnColumnExpressionHistory,new CellConstraints(7,11,1,1,CellConstraints.DEFAULT,CellConstraints.TOP));
|
|
248 | 228 |
|
249 | 229 |
btnColumnExpressionBookmarks.setActionCommand("..."); |
250 | 230 |
btnColumnExpressionBookmarks.setName("btnColumnExpressionBookmarks"); |
251 | 231 |
btnColumnExpressionBookmarks.setText("..."); |
252 | 232 |
EmptyBorder emptyborder3 = new EmptyBorder(2,2,2,2); |
253 | 233 |
btnColumnExpressionBookmarks.setBorder(emptyborder3); |
254 |
jpanel1.add(btnColumnExpressionBookmarks,cc.xy(9,5));
|
|
234 |
jpanel1.add(btnColumnExpressionBookmarks,new CellConstraints(9,11,1,1,CellConstraints.DEFAULT,CellConstraints.TOP));
|
|
255 | 235 |
|
256 | 236 |
txtColumnName.setName("txtColumnName"); |
257 | 237 |
jpanel1.add(txtColumnName,cc.xywh(3,1,7,1)); |
... | ... | |
266 | 246 |
cboColumnDataType.setName("cboColumnDataType"); |
267 | 247 |
jpanel1.add(cboColumnDataType,cc.xywh(3,3,5,1)); |
268 | 248 |
|
269 |
jpanel1.add(createPanel3(),cc.xywh(1,12,9,1)); |
|
249 |
jpanel1.add(createPanel3(),cc.xywh(1,13,9,1)); |
|
250 |
txtColumnExpression.setName("txtColumnExpression"); |
|
251 |
JScrollPane jscrollpane1 = new JScrollPane(); |
|
252 |
jscrollpane1.setViewportView(txtColumnExpression); |
|
253 |
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
|
254 |
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
|
255 |
jpanel1.add(jscrollpane1,cc.xy(3,11)); |
|
256 |
|
|
257 |
txtColumnSize.setName("txtColumnSize"); |
|
258 |
jpanel1.add(txtColumnSize,cc.xywh(3,5,7,1)); |
|
259 |
|
|
270 | 260 |
lblSize.setName("lblSize"); |
271 | 261 |
lblSize.setText("_Size"); |
272 |
jpanel1.add(lblSize,cc.xy(1,7));
|
|
262 |
jpanel1.add(lblSize,cc.xy(1,5));
|
|
273 | 263 |
|
274 | 264 |
lblPrecision.setName("lblPrecision"); |
275 | 265 |
lblPrecision.setText("_Precision"); |
276 |
jpanel1.add(lblPrecision,cc.xy(1,9));
|
|
266 |
jpanel1.add(lblPrecision,cc.xy(1,7));
|
|
277 | 267 |
|
268 |
txtColumnPrecision.setName("txtColumnPrecision"); |
|
269 |
jpanel1.add(txtColumnPrecision,cc.xywh(3,7,7,1)); |
|
270 |
|
|
278 | 271 |
lblScale.setName("lblScale"); |
279 | 272 |
lblScale.setText("_Scale"); |
280 |
jpanel1.add(lblScale,cc.xy(1,11));
|
|
273 |
jpanel1.add(lblScale,cc.xy(1,9));
|
|
281 | 274 |
|
282 |
txtColumnExpression.setName("txtColumnExpression"); |
|
283 |
jpanel1.add(txtColumnExpression,cc.xy(3,5)); |
|
284 |
|
|
285 |
txtColumnSize.setName("txtColumnSize"); |
|
286 |
jpanel1.add(txtColumnSize,cc.xywh(3,7,7,1)); |
|
287 |
|
|
288 |
txtColumnPrecision.setName("txtColumnPrecision"); |
|
289 |
jpanel1.add(txtColumnPrecision,cc.xywh(3,9,7,1)); |
|
290 |
|
|
291 | 275 |
txtColumnScale.setName("txtColumnScale"); |
292 |
jpanel1.add(txtColumnScale,cc.xywh(3,11,7,1));
|
|
276 |
jpanel1.add(txtColumnScale,cc.xywh(3,9,7,1));
|
|
293 | 277 |
|
294 |
addFillComponents(jpanel1,new int[]{ 2,4,5,6,7,8,9 },new int[]{ 2,4,6,8,10,12 }); |
|
278 |
addFillComponents(jpanel1,new int[]{ 2,4,5,6,7,8,9 },new int[]{ 2,4,6,8,10,12,13 });
|
|
295 | 279 |
return jpanel1; |
296 | 280 |
} |
297 | 281 |
|
Also available in: Unified diff