Revision 9367 trunk/libraries/libUI/src/org/gvsig/gui/beans/filterPanel/filterButtons/FilterButtonsJPanel.java
FilterButtonsJPanel.java | ||
---|---|---|
13 | 13 |
import java.text.DateFormat; |
14 | 14 |
import java.util.Date; |
15 | 15 |
import java.util.HashMap; |
16 |
import java.util.HashSet; |
|
17 |
import java.util.Set; |
|
16 | 18 |
|
17 | 19 |
import javax.swing.JPanel; |
18 | 20 |
|
... | ... | |
127 | 129 |
|
128 | 130 |
// Action listener for notify (fire) some events that had happened to this component |
129 | 131 |
private ActionListener actionListener = null; |
132 |
|
|
133 |
// A set with all simbols or operator names used |
|
134 |
private Set operatorNamesAndSymbols; |
|
130 | 135 |
|
131 | 136 |
/** |
132 | 137 |
* @see JPanel#JPanel() |
... | ... | |
134 | 139 |
public FilterButtonsJPanel() { |
135 | 140 |
super(); |
136 | 141 |
map = new HashMap(); |
142 |
operatorNamesAndSymbols = new HashSet(); |
|
137 | 143 |
referenceToFilterButtonsJPanel = this; |
138 | 144 |
initialize(); |
139 | 145 |
} |
... | ... | |
144 | 150 |
public FilterButtonsJPanel(boolean isDoubleBuffered) { |
145 | 151 |
super(isDoubleBuffered); |
146 | 152 |
map = new HashMap(); |
153 |
operatorNamesAndSymbols = new HashSet(); |
|
147 | 154 |
referenceToFilterButtonsJPanel = this; |
148 | 155 |
initialize(); |
149 | 156 |
} |
... | ... | |
154 | 161 |
public FilterButtonsJPanel(LayoutManager layout, boolean isDoubleBuffered) { |
155 | 162 |
super(layout, isDoubleBuffered); |
156 | 163 |
map = new HashMap(); |
164 |
operatorNamesAndSymbols = new HashSet(); |
|
157 | 165 |
referenceToFilterButtonsJPanel = this; |
158 | 166 |
initialize(); |
159 | 167 |
} |
... | ... | |
164 | 172 |
public FilterButtonsJPanel(LayoutManager layout) { |
165 | 173 |
super(layout); |
166 | 174 |
map = new HashMap(); |
175 |
operatorNamesAndSymbols = new HashSet(); |
|
167 | 176 |
referenceToFilterButtonsJPanel = this; |
168 | 177 |
initialize(); |
169 | 178 |
} |
... | ... | |
222 | 231 |
btnAnd.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
223 | 232 |
btnAnd.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
224 | 233 |
map.put("And", new Integer(FilterButtonsJPanel.AND)); |
234 |
operatorNamesAndSymbols.add("And"); |
|
225 | 235 |
|
226 | 236 |
btnAnd.addActionListener(this.getActionListener()); |
227 | 237 |
} |
... | ... | |
241 | 251 |
btnDistinct.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
242 | 252 |
btnDistinct.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
243 | 253 |
map.put("!=", new Integer(FilterButtonsJPanel.DISTINCT)); |
254 |
operatorNamesAndSymbols.add("!="); |
|
244 | 255 |
|
245 | 256 |
btnDistinct.addActionListener(this.getActionListener()); |
246 | 257 |
} |
... | ... | |
261 | 272 |
btnEqual.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
262 | 273 |
btnEqual.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
263 | 274 |
map.put("=", new Integer(FilterButtonsJPanel.EQUAL)); |
275 |
operatorNamesAndSymbols.add("="); |
|
264 | 276 |
|
265 | 277 |
btnEqual.addActionListener(this.getActionListener()); |
266 | 278 |
} |
... | ... | |
280 | 292 |
btnGreater.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
281 | 293 |
btnGreater.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
282 | 294 |
map.put(">", new Integer(FilterButtonsJPanel.GREATER)); |
295 |
operatorNamesAndSymbols.add(">"); |
|
283 | 296 |
|
284 | 297 |
btnGreater.addActionListener(this.getActionListener()); |
285 | 298 |
} |
... | ... | |
299 | 312 |
btnEqualGreater.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
300 | 313 |
btnEqualGreater.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
301 | 314 |
map.put(">=", new Integer(FilterButtonsJPanel.EQUALGREATER)); |
315 |
operatorNamesAndSymbols.add(">="); |
|
302 | 316 |
|
303 | 317 |
btnEqualGreater.addActionListener(this.getActionListener()); |
304 | 318 |
} |
... | ... | |
318 | 332 |
btnSmaller.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
319 | 333 |
btnSmaller.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
320 | 334 |
map.put("<", new Integer(FilterButtonsJPanel.SMALLER)); |
335 |
operatorNamesAndSymbols.add("<"); |
|
321 | 336 |
|
322 | 337 |
btnSmaller.addActionListener(this.getActionListener()); |
323 | 338 |
} |
... | ... | |
337 | 352 |
btnEqualSmaller.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
338 | 353 |
btnEqualSmaller.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
339 | 354 |
map.put("<=", new Integer(FilterButtonsJPanel.EQUALSMALLER)); |
355 |
operatorNamesAndSymbols.add("<="); |
|
340 | 356 |
|
341 | 357 |
btnEqualSmaller.addActionListener(this.getActionListener()); |
342 | 358 |
} |
... | ... | |
356 | 372 |
btnDate.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
357 | 373 |
btnDate.setPreferredSize(new java.awt.Dimension(86, buttonHeight)); |
358 | 374 |
map.put("Date", new Integer(FilterButtonsJPanel.DATE)); |
375 |
operatorNamesAndSymbols.add("Date"); |
|
359 | 376 |
|
360 | 377 |
btnDate.addMouseListener(new MouseAdapter() { |
361 | 378 |
/* |
... | ... | |
413 | 430 |
btnNot.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
414 | 431 |
btnNot.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
415 | 432 |
map.put("Not", new Integer(FilterButtonsJPanel.NOT)); |
433 |
operatorNamesAndSymbols.add("Not"); |
|
416 | 434 |
|
417 | 435 |
btnNot.addMouseListener(new MouseAdapter() { |
418 | 436 |
/* |
... | ... | |
443 | 461 |
btnOr.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
444 | 462 |
btnOr.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
445 | 463 |
map.put("Or", new Integer(FilterButtonsJPanel.OR)); |
464 |
operatorNamesAndSymbols.add("Or"); |
|
446 | 465 |
|
447 | 466 |
btnOr.addMouseListener(new MouseAdapter() { |
448 | 467 |
/* |
... | ... | |
472 | 491 |
btnParenthesis.setMargin(new java.awt.Insets(2, 2, 2, 2)); |
473 | 492 |
btnParenthesis.setPreferredSize(new java.awt.Dimension(buttonWidthUnit, buttonHeight)); |
474 | 493 |
map.put("()", new Integer(FilterButtonsJPanel.PARENTHESIS)); |
494 |
operatorNamesAndSymbols.add("("); |
|
495 |
operatorNamesAndSymbols.add(")"); |
|
475 | 496 |
|
476 | 497 |
btnParenthesis.addMouseListener(new MouseAdapter() { |
477 | 498 |
/* |
... | ... | |
519 | 540 |
} |
520 | 541 |
|
521 | 542 |
/** |
543 |
* Returns a set with all symbols and names used as operators or auxiliar symbols |
|
544 |
* |
|
545 |
* @return A set |
|
546 |
*/ |
|
547 |
public Set getOperatorNamesAndSymbols() { |
|
548 |
return operatorNamesAndSymbols; |
|
549 |
} |
|
550 |
|
|
551 |
/** |
|
522 | 552 |
* This method initializes the "actionListener" ActionListener |
523 | 553 |
* |
524 | 554 |
* @return ActionListener |
Also available in: Unified diff