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