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