svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.swing / org.gvsig.expressionevaluator.swing.impl / src / main / java / org / gvsig / expressionevaluator / swing / impl / DefaultJExpressionBuilderView2.java @ 44259
History | View | Annotate | Download (17 KB)
1 | 43939 | jjdelcerro | package org.gvsig.expressionevaluator.swing.impl; |
---|---|---|---|
2 | |||
3 | import java.awt.BorderLayout; |
||
4 | import java.awt.Color; |
||
5 | 44259 | jjdelcerro | import java.awt.GridBagConstraints; |
6 | import java.awt.GridBagLayout; |
||
7 | import java.awt.Insets; |
||
8 | 43939 | jjdelcerro | import javax.swing.ImageIcon; |
9 | import javax.swing.JButton; |
||
10 | 43983 | jjdelcerro | import javax.swing.JComboBox; |
11 | import javax.swing.JLabel; |
||
12 | 43939 | jjdelcerro | import javax.swing.JList; |
13 | import javax.swing.JPanel; |
||
14 | import javax.swing.JScrollPane; |
||
15 | 44259 | jjdelcerro | import javax.swing.JSplitPane; |
16 | 43939 | jjdelcerro | import javax.swing.JTabbedPane; |
17 | import javax.swing.JTextArea; |
||
18 | import javax.swing.JTextField; |
||
19 | import javax.swing.JTree; |
||
20 | import javax.swing.border.EmptyBorder; |
||
21 | |||
22 | 44259 | jjdelcerro | public class DefaultJExpressionBuilderView2 extends JPanel { |
23 | 43939 | jjdelcerro | |
24 | 44259 | jjdelcerro | private static class GridBagConstraintsBuilder { |
25 | 43939 | jjdelcerro | |
26 | 44259 | jjdelcerro | private GridBagConstraints gbc; |
27 | 43939 | jjdelcerro | |
28 | 44259 | jjdelcerro | public GridBagConstraintsBuilder() {
|
29 | this.gbc = new GridBagConstraints(); |
||
30 | this.gbc.insets = new Insets(1, 1, 1, 1); |
||
31 | } |
||
32 | 43939 | jjdelcerro | |
33 | 44259 | jjdelcerro | public GridBagConstraintsBuilder clear() {
|
34 | this.gbc = new GridBagConstraints(); |
||
35 | this.gbc.insets = new Insets(1, 1, 1, 1); |
||
36 | return this; |
||
37 | } |
||
38 | 43939 | jjdelcerro | |
39 | 44259 | jjdelcerro | public GridBagConstraints get() { |
40 | return this.gbc; |
||
41 | } |
||
42 | 43939 | jjdelcerro | |
43 | 44259 | jjdelcerro | public GridBagConstraintsBuilder insets(int top, int left, int bottom, int right) { |
44 | this.gbc.insets = new Insets(top, left, bottom, right); |
||
45 | return this; |
||
46 | } |
||
47 | 43939 | jjdelcerro | |
48 | 44259 | jjdelcerro | public GridBagConstraintsBuilder anchor(int anchor) { |
49 | this.gbc.anchor = anchor;
|
||
50 | return this; |
||
51 | } |
||
52 | 43939 | jjdelcerro | |
53 | 44259 | jjdelcerro | public GridBagConstraintsBuilder fill(int fill) { |
54 | this.gbc.fill = fill;
|
||
55 | return this; |
||
56 | } |
||
57 | 43939 | jjdelcerro | |
58 | 44259 | jjdelcerro | public GridBagConstraintsBuilder growx(float growx) { |
59 | this.gbc.weightx = growx;
|
||
60 | return this; |
||
61 | } |
||
62 | 43939 | jjdelcerro | |
63 | 44259 | jjdelcerro | public GridBagConstraintsBuilder growy(float growy) { |
64 | this.gbc.weighty = growy;
|
||
65 | return this; |
||
66 | } |
||
67 | 43939 | jjdelcerro | |
68 | 44259 | jjdelcerro | public GridBagConstraintsBuilder grow(float growx, float growy) { |
69 | this.gbc.weightx = growx;
|
||
70 | this.gbc.weighty = growy;
|
||
71 | return this; |
||
72 | } |
||
73 | 43939 | jjdelcerro | |
74 | 44259 | jjdelcerro | public GridBagConstraintsBuilder nogrow() {
|
75 | this.gbc.weightx = 0; |
||
76 | this.gbc.weighty = 0; |
||
77 | return this; |
||
78 | } |
||
79 | 43939 | jjdelcerro | |
80 | 44259 | jjdelcerro | public GridBagConstraintsBuilder xy(int x, int y) { |
81 | this.gbc.gridx = x;
|
||
82 | this.gbc.gridy = y;
|
||
83 | return this; |
||
84 | } |
||
85 | 43939 | jjdelcerro | |
86 | 44259 | jjdelcerro | private GridBagConstraintsBuilder colspan(int n) { |
87 | this.gbc.gridwidth = n;
|
||
88 | return this; |
||
89 | } |
||
90 | 43939 | jjdelcerro | |
91 | 44259 | jjdelcerro | private GridBagConstraintsBuilder rowspan(int n) { |
92 | this.gbc.gridheight = n;
|
||
93 | return this; |
||
94 | } |
||
95 | 43939 | jjdelcerro | |
96 | 44259 | jjdelcerro | private GridBagConstraintsBuilder span(int cols, int rows) { |
97 | this.gbc.gridwidth = cols;
|
||
98 | this.gbc.gridheight = rows;
|
||
99 | return this; |
||
100 | } |
||
101 | 44006 | jjdelcerro | |
102 | 44259 | jjdelcerro | private GridBagConstraintsBuilder nospan() {
|
103 | this.gbc.gridwidth = 1; |
||
104 | this.gbc.gridheight = 1; |
||
105 | return this; |
||
106 | } |
||
107 | 43939 | jjdelcerro | |
108 | 44259 | jjdelcerro | } |
109 | 43939 | jjdelcerro | |
110 | 44259 | jjdelcerro | JTabbedPane tabExpressionBuilder = new JTabbedPane(); |
111 | 43939 | jjdelcerro | |
112 | 44259 | jjdelcerro | JList lstSimpleElement = new JList(); |
113 | JScrollPane scrSimpleElement = new JScrollPane(); |
||
114 | 43939 | jjdelcerro | |
115 | 44259 | jjdelcerro | JTree treeElements = new JTree(); |
116 | JScrollPane scrElements = new JScrollPane(); |
||
117 | 43939 | jjdelcerro | |
118 | 44259 | jjdelcerro | JTextArea txtExpression = new JTextArea(); |
119 | JScrollPane scrExpression = new JScrollPane(); |
||
120 | 43939 | jjdelcerro | |
121 | 44259 | jjdelcerro | JButton btnHistory = new JButton(); |
122 | JButton btnBookmarks = new JButton(); |
||
123 | JButton btnEq = new JButton(); |
||
124 | JButton btnNeq = new JButton(); |
||
125 | JButton btnAdd = new JButton(); |
||
126 | JButton btnSubst = new JButton(); |
||
127 | JButton btnMult = new JButton(); |
||
128 | JButton btnDiv = new JButton(); |
||
129 | JButton btnParentOpen = new JButton(); |
||
130 | JButton btnParentClose = new JButton(); |
||
131 | JLabel lblMsg = new JLabel(); |
||
132 | JButton btnTip = new JButton(); |
||
133 | JLabel lblColumn = new JLabel(); |
||
134 | JTextField txtGroupElement = new JTextField(); |
||
135 | JButton btnGroupElementInsert = new JButton(); |
||
136 | JButton btnSimpleElementInsert = new JButton(); |
||
137 | JButton btnSimpleElementSortDown = new JButton(); |
||
138 | JButton btnSimpleElementSortUp = new JButton(); |
||
139 | JLabel lblSimpleElementsMsg = new JLabel(); |
||
140 | JButton btnSimpleElementTimeLimit = new JButton(); |
||
141 | JTextField txtSimpleElementFilter = new JTextField(); |
||
142 | JButton btnSimpleElementFilter = new JButton(); |
||
143 | JPanel pnlDescription = new JPanel(); |
||
144 | JPanel pnlScriptEditorContainer = new JPanel(); |
||
145 | JComboBox cboPickerScripts = new JComboBox(); |
||
146 | JButton btnPickerRemove = new JButton(); |
||
147 | JButton btnPickerSelectScript = new JButton(); |
||
148 | 43987 | jjdelcerro | |
149 | 44259 | jjdelcerro | JSplitPane spnlExpression = new JSplitPane(JSplitPane.VERTICAL_SPLIT); |
150 | JSplitPane spnlBottom = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
||
151 | JSplitPane spnlItem = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
||
152 | 43939 | jjdelcerro | |
153 | 44259 | jjdelcerro | JPanel pnlTop;
|
154 | JPanel pnlElement;
|
||
155 | 43939 | jjdelcerro | |
156 | 44259 | jjdelcerro | /**
|
157 | * Default constructor
|
||
158 | */
|
||
159 | public DefaultJExpressionBuilderView2() {
|
||
160 | initComponents(); |
||
161 | } |
||
162 | 43939 | jjdelcerro | |
163 | 44259 | jjdelcerro | private void initComponents() { |
164 | EmptyBorder emptyborder2x2 = new EmptyBorder(2, 2, 2, 2); |
||
165 | 43939 | jjdelcerro | |
166 | 44259 | jjdelcerro | lstSimpleElement.setName("lstSimpleElement");
|
167 | 43939 | jjdelcerro | |
168 | 44259 | jjdelcerro | treeElements.setName("treeElements");
|
169 | pnlDescription.setName("pnlDescription");
|
||
170 | txtExpression.setLineWrap(true);
|
||
171 | txtExpression.setName("txtExpression");
|
||
172 | txtExpression.setRows(2);
|
||
173 | 43939 | jjdelcerro | |
174 | |||
175 | 44259 | jjdelcerro | btnHistory.setActionCommand("+");
|
176 | btnHistory.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-history.png"));
|
||
177 | btnHistory.setName("btnHistory");
|
||
178 | btnHistory.setText("");
|
||
179 | btnHistory.setBorder(emptyborder2x2); |
||
180 | 44098 | jjdelcerro | |
181 | 44259 | jjdelcerro | btnBookmarks.setActionCommand("+");
|
182 | btnBookmarks.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-bookmarks.png"));
|
||
183 | btnBookmarks.setName("btnBookmarks");
|
||
184 | btnBookmarks.setText("");
|
||
185 | btnBookmarks.setBorder(emptyborder2x2); |
||
186 | 44098 | jjdelcerro | |
187 | 44259 | jjdelcerro | btnEq.setActionCommand("+");
|
188 | btnEq.setName("btnEq");
|
||
189 | btnEq.setText("=");
|
||
190 | btnEq.setBorder(emptyborder2x2); |
||
191 | 44098 | jjdelcerro | |
192 | 44259 | jjdelcerro | btnNeq.setActionCommand("+");
|
193 | btnNeq.setName("btnNeq");
|
||
194 | btnNeq.setText("<>");
|
||
195 | btnNeq.setBorder(emptyborder2x2); |
||
196 | 44098 | jjdelcerro | |
197 | 44259 | jjdelcerro | btnAdd.setActionCommand("+");
|
198 | btnAdd.setName("btnAdd");
|
||
199 | btnAdd.setText("+");
|
||
200 | btnAdd.setBorder(emptyborder2x2); |
||
201 | 44098 | jjdelcerro | |
202 | 44259 | jjdelcerro | btnSubst.setActionCommand("+");
|
203 | btnSubst.setName("btnSubst");
|
||
204 | btnSubst.setText("-");
|
||
205 | btnSubst.setBorder(emptyborder2x2); |
||
206 | 43939 | jjdelcerro | |
207 | 44259 | jjdelcerro | btnMult.setActionCommand("+");
|
208 | btnMult.setName("btnMult");
|
||
209 | btnMult.setText("*");
|
||
210 | btnMult.setBorder(emptyborder2x2); |
||
211 | 43939 | jjdelcerro | |
212 | 44259 | jjdelcerro | btnDiv.setActionCommand("+");
|
213 | btnDiv.setName("btnDiv");
|
||
214 | btnDiv.setText("/");
|
||
215 | btnDiv.setBorder(emptyborder2x2); |
||
216 | 43939 | jjdelcerro | |
217 | 44259 | jjdelcerro | btnParentOpen.setActionCommand("+");
|
218 | btnParentOpen.setName("btnParentOpen");
|
||
219 | btnParentOpen.setText("(");
|
||
220 | btnParentOpen.setBorder(emptyborder2x2); |
||
221 | 43939 | jjdelcerro | |
222 | 44259 | jjdelcerro | btnParentClose.setActionCommand("+");
|
223 | btnParentClose.setName("btnParentClose");
|
||
224 | btnParentClose.setText(")");
|
||
225 | btnParentClose.setBorder(emptyborder2x2); |
||
226 | 43939 | jjdelcerro | |
227 | 44259 | jjdelcerro | lblMsg.setName("lblMsg");
|
228 | 43939 | jjdelcerro | |
229 | 44259 | jjdelcerro | btnTip.setActionCommand("+");
|
230 | btnTip.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-tip.png.png"));
|
||
231 | btnTip.setName("btnTip");
|
||
232 | btnTip.setBorder(emptyborder2x2); |
||
233 | 43983 | jjdelcerro | |
234 | 44259 | jjdelcerro | lblColumn.setName("lblColumn");
|
235 | lblColumn.setText("0");
|
||
236 | 43939 | jjdelcerro | |
237 | 44259 | jjdelcerro | txtGroupElement.setBackground(new Color(236, 233, 216)); |
238 | txtGroupElement.setEditable(false);
|
||
239 | txtGroupElement.setName("txtGroupElement");
|
||
240 | 43983 | jjdelcerro | |
241 | 44259 | jjdelcerro | btnGroupElementInsert.setActionCommand("+");
|
242 | btnGroupElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-insert-text.png"));
|
||
243 | btnGroupElementInsert.setName("btnGroupElementInsert");
|
||
244 | btnGroupElementInsert.setBorder(emptyborder2x2); |
||
245 | 43987 | jjdelcerro | |
246 | 44259 | jjdelcerro | btnSimpleElementInsert.setActionCommand("+");
|
247 | btnSimpleElementInsert.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-insert-text.png"));
|
||
248 | btnSimpleElementInsert.setName("btnSimpleElementInsert");
|
||
249 | btnSimpleElementInsert.setBorder(emptyborder2x2); |
||
250 | 43939 | jjdelcerro | |
251 | 44259 | jjdelcerro | btnSimpleElementSortDown.setActionCommand("+");
|
252 | btnSimpleElementSortDown.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-sortdown.png"));
|
||
253 | btnSimpleElementSortDown.setName("btnSimpleElementSortDown");
|
||
254 | btnSimpleElementSortDown.setBorder(emptyborder2x2); |
||
255 | 43939 | jjdelcerro | |
256 | 44259 | jjdelcerro | btnSimpleElementSortUp.setActionCommand("+");
|
257 | btnSimpleElementSortUp.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-sortup.png"));
|
||
258 | btnSimpleElementSortUp.setName("btnSimpleElementSortUp");
|
||
259 | btnSimpleElementSortUp.setBorder(emptyborder2x2); |
||
260 | 43939 | jjdelcerro | |
261 | 44259 | jjdelcerro | lblSimpleElementsMsg.setName("lblSimpleElementsMsg");
|
262 | 43939 | jjdelcerro | |
263 | 44259 | jjdelcerro | btnSimpleElementTimeLimit.setActionCommand("+");
|
264 | btnSimpleElementTimeLimit.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-time-limit.png"));
|
||
265 | btnSimpleElementTimeLimit.setName("btnSimpleElementTimeLimit");
|
||
266 | btnSimpleElementTimeLimit.setBorder(emptyborder2x2); |
||
267 | 43939 | jjdelcerro | |
268 | 44259 | jjdelcerro | txtSimpleElementFilter.setName("txtSimpleElementFilter");
|
269 | 43939 | jjdelcerro | |
270 | 44259 | jjdelcerro | btnSimpleElementFilter.setActionCommand("+");
|
271 | btnSimpleElementFilter.setIcon(loadImage("datos/devel/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.swing/org.gvsig.expressionevaluator.swing.impl/src/main/resources/org/gvsig/expressionevaluator/swing/impl/expressionbuilder-filter-values.png"));
|
||
272 | btnSimpleElementFilter.setName("btnSimpleElementFilter");
|
||
273 | btnSimpleElementFilter.setBorder(emptyborder2x2); |
||
274 | 43983 | jjdelcerro | |
275 | 44259 | jjdelcerro | pnlScriptEditorContainer.setName("pnlScriptEditorContainer");
|
276 | 43939 | jjdelcerro | |
277 | 44259 | jjdelcerro | cboPickerScripts.setName("cboPickerScripts");
|
278 | 43983 | jjdelcerro | |
279 | 44259 | jjdelcerro | btnPickerRemove.setActionCommand("+");
|
280 | btnPickerRemove.setName("btnPickerRemove");
|
||
281 | btnPickerRemove.setText("R");
|
||
282 | btnPickerRemove.setBorder(emptyborder2x2); |
||
283 | 43983 | jjdelcerro | |
284 | 44259 | jjdelcerro | btnPickerSelectScript.setActionCommand("+");
|
285 | btnPickerSelectScript.setName("btnPickerSelectScript");
|
||
286 | btnPickerSelectScript.setText("S");
|
||
287 | btnPickerSelectScript.setBorder(emptyborder2x2); |
||
288 | 43983 | jjdelcerro | |
289 | 44259 | jjdelcerro | this.scrExpression = new JScrollPane(); |
290 | this.scrExpression.setViewportView(txtExpression);
|
||
291 | this.scrExpression.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
||
292 | this.scrExpression.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); |
||
293 | 43983 | jjdelcerro | |
294 | 44259 | jjdelcerro | this.scrElements = new JScrollPane(); |
295 | this.scrElements.setViewportView(treeElements);
|
||
296 | this.scrElements.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
||
297 | this.scrElements.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
||
298 | 43983 | jjdelcerro | |
299 | 44259 | jjdelcerro | this.scrSimpleElement = new JScrollPane(); |
300 | this.scrSimpleElement.setViewportView(lstSimpleElement);
|
||
301 | this.scrSimpleElement.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); |
||
302 | this.scrSimpleElement.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); |
||
303 | 43939 | jjdelcerro | |
304 | 44259 | jjdelcerro | this.spnlExpression.setTopComponent(this.getPanelTop()); |
305 | this.spnlExpression.setBottomComponent(this.spnlBottom); |
||
306 | this.spnlExpression.setBorder(emptyborder2x2);
|
||
307 | this.spnlExpression.setOneTouchExpandable(true); |
||
308 | 43939 | jjdelcerro | |
309 | 44259 | jjdelcerro | this.spnlBottom.setLeftComponent(this.scrElements); |
310 | this.spnlBottom.setRightComponent(this.spnlItem); |
||
311 | this.spnlBottom.setBorder(emptyborder2x2);
|
||
312 | this.spnlBottom.setOneTouchExpandable(true); |
||
313 | |||
314 | this.spnlItem.setLeftComponent(this.getPanelElement()); |
||
315 | this.spnlItem.setRightComponent(this.pnlDescription); |
||
316 | this.spnlItem.setBorder(emptyborder2x2);
|
||
317 | this.spnlItem.setOneTouchExpandable(true); |
||
318 | |||
319 | this.tabExpressionBuilder.setName("tabExpressionBuilder"); |
||
320 | this.tabExpressionBuilder.addTab("_Expression", null, this.spnlExpression); |
||
321 | this.tabExpressionBuilder.addTab("_Scripts", null, this.pnlScriptEditorContainer); |
||
322 | |||
323 | this.setLayout(new BorderLayout()); |
||
324 | this.add(tabExpressionBuilder, BorderLayout.CENTER); |
||
325 | |||
326 | } |
||
327 | |||
328 | private JPanel getPanelTop() { |
||
329 | if (this.pnlTop == null) { |
||
330 | GridBagConstraintsBuilder cs = new GridBagConstraintsBuilder();
|
||
331 | cs.anchor(GridBagConstraints.CENTER);
|
||
332 | cs.fill(GridBagConstraints.BOTH);
|
||
333 | |||
334 | JPanel pnlRight = new JPanel(); |
||
335 | pnlRight.setLayout(new GridBagLayout()); |
||
336 | pnlRight.add(this.btnHistory, cs.xy(0, 0).get()); |
||
337 | pnlRight.add(this.btnBookmarks, cs.xy(1, 0).get()); |
||
338 | pnlRight.add(this.btnEq, cs.xy(0, 1).get()); |
||
339 | pnlRight.add(this.btnNeq, cs.xy(1, 1).get()); |
||
340 | pnlRight.add(this.btnAdd, cs.xy(2, 1).get()); |
||
341 | pnlRight.add(this.btnSubst, cs.xy(3, 1).get()); |
||
342 | pnlRight.add(this.btnMult, cs.xy(0, 2).get()); |
||
343 | pnlRight.add(this.btnDiv, cs.xy(1, 2).get()); |
||
344 | pnlRight.add(this.btnParentOpen, cs.xy(2, 2).get()); |
||
345 | pnlRight.add(this.btnParentClose, cs.xy(3, 2).get()); |
||
346 | pnlRight.add(new JLabel(), cs.xy(0, 3).span(4,0).grow(1, 1).get()); |
||
347 | |||
348 | JPanel pnlLeft = new JPanel(); |
||
349 | pnlLeft.setLayout(new GridBagLayout()); |
||
350 | pnlLeft.add(this.scrExpression, cs.xy(0, 0).span(3, 1).grow(1, 1).get()); |
||
351 | pnlLeft.add(this.lblMsg, cs.xy(0, 1).nospan().grow(1, 0).get()); |
||
352 | pnlLeft.add(this.btnTip, cs.xy(1, 1).nospan().nogrow().get()); |
||
353 | pnlLeft.add(this.lblColumn, cs.xy(2, 1).nospan().nogrow().get()); |
||
354 | |||
355 | JPanel panel = new JPanel(); |
||
356 | panel.setLayout(new GridBagLayout()); |
||
357 | panel.add(pnlLeft, cs.xy(0, 0).nospan().grow(1, 1).get()); |
||
358 | panel.add(pnlRight, cs.xy(1, 0).nospan().nogrow().anchor(GridBagConstraints.NORTH).get()); |
||
359 | |||
360 | this.pnlTop = panel;
|
||
361 | } |
||
362 | return this.pnlTop; |
||
363 | } |
||
364 | |||
365 | private JPanel getPanelElement() { |
||
366 | if (this.pnlElement == null) { |
||
367 | GridBagConstraintsBuilder cs = new GridBagConstraintsBuilder();
|
||
368 | cs.anchor(GridBagConstraints.CENTER);
|
||
369 | cs.fill(GridBagConstraints.BOTH);
|
||
370 | |||
371 | JPanel panel = new JPanel(); |
||
372 | panel.setLayout(new GridBagLayout()); |
||
373 | panel.add(this.txtGroupElement, cs.xy(0, 0).span(4, 1).grow(1,0).get()); |
||
374 | panel.add(this.btnGroupElementInsert, cs.xy(4, 0).nospan().nogrow().get()); |
||
375 | panel.add(this.txtSimpleElementFilter, cs.xy(0, 1).span(4, 1).grow(1,0).get()); |
||
376 | panel.add(this.btnSimpleElementInsert, cs.xy(4, 1).nospan().nogrow().get()); |
||
377 | panel.add(this.scrSimpleElement, cs.xy(0, 2).span(5, 1).grow(1, 1).get()); |
||
378 | panel.add(new JLabel(), cs.xy(0, 3).nospan().grow(1,0).get()); |
||
379 | panel.add(this.btnSimpleElementTimeLimit, cs.xy(1, 3).nospan().nogrow().get()); |
||
380 | panel.add(this.btnSimpleElementSortUp, cs.xy(2, 3).nospan().nogrow().get()); |
||
381 | panel.add(this.btnSimpleElementSortDown, cs.xy(3, 3).nospan().nogrow().get()); |
||
382 | panel.add(this.btnSimpleElementInsert, cs.xy(4, 3).nospan().nogrow().get()); |
||
383 | |||
384 | this.pnlElement = panel;
|
||
385 | } |
||
386 | return this.pnlElement; |
||
387 | } |
||
388 | |||
389 | public ImageIcon loadImage(String imageName) { |
||
390 | try {
|
||
391 | ClassLoader classloader = getClass().getClassLoader();
|
||
392 | java.net.URL url = classloader.getResource(imageName); |
||
393 | if (url != null) { |
||
394 | ImageIcon icon = new ImageIcon(url); |
||
395 | return icon;
|
||
396 | } |
||
397 | } catch (Exception e) { |
||
398 | e.printStackTrace(); |
||
399 | } |
||
400 | throw new IllegalArgumentException("Unable to load image: " + imageName); |
||
401 | } |
||
402 | 43939 | jjdelcerro | } |