KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > calipso > reportgenerator > userinterface > ChoosSemaphoreSelection


1 package com.calipso.reportgenerator.userinterface;
2
3 import com.calipso.reportgenerator.reportcalculator.expression.*;
4 import com.calipso.reportgenerator.common.InfoException;
5 import com.calipso.reportgenerator.common.ShowExceptionMessageDialog;
6
7 import javax.swing.*;
8 import java.awt.*;
9 import java.awt.event.ActionListener JavaDoc;
10 import java.awt.event.ActionEvent JavaDoc;
11 import java.text.MessageFormat JavaDoc;
12 import java.util.Vector JavaDoc;
13
14 /**
15  * Crea un Dialog de selleccion de Colores
16  */

17
18 public class ChoosSemaphoreSelection extends javax.swing.JDialog JavaDoc {
19   private Color bgColor;
20   private ColorCondition resultColorCondition;
21   private JPanel jPanel4;
22   private JLabel colorjLabel;
23   private JLabel valuejLabel;
24   private JButton okjButton;
25   private JTextField fromjTextField;
26   private JRadioButton greaterOrEqualTojRadioButton;
27   private JRadioButton greaterThanjRadioButton;
28   private JPanel jPanel3;
29   private Color storedColor;
30   private JButton canceljButton;
31   private JTextField colorjTextField;
32   private JRadioButton lessThanjRadioButton;
33   private JPanel jPanel2;
34   private JPanel jPanel5;
35   private ButtonGroup operatorbuttonGroup;
36   private JTextField tojTextField;
37   private JButton colorjButton;
38   private JPanel jPanel7;
39   private JLabel tojLabel;
40   private JPanel jPanel1;
41   private JPanel jPanel6;
42   private JRadioButton lessOrEqualTojRadioButton;
43   private JLabel fromjLabel;
44   private JTextField valuejTextField;
45   private JRadioButton equalTojRadioButton;
46   private JTabbedPane tabPanel;
47   private int seleccionRadioButton;
48   private MetricState metricState;
49
50
51   /**
52    * Obtiene un ColorCondition
53    * @param owner
54    * @param metricState
55    * @return
56    */

57   public static ColorCondition newColorCondition(Frame owner, MetricState metricState, ColorCondition condition) {
58     ChoosSemaphoreSelection dialog = new ChoosSemaphoreSelection(owner, metricState, condition);
59     ColorCondition colorCondition = dialog.execute();
60     dialog.dispose();
61     return colorCondition;
62   }
63
64   /**
65    * Muestra el Dialog y retorna un colorCondition nuevo
66    * @return
67    */

68   public ColorCondition execute() {
69     this.setVisible(true);
70     return this.resultColorCondition;
71   }
72
73   /**
74    * Crea un un Dialog modal ChoosSemaphoreSelection
75    * @param owner
76    * @param metricState
77    */

78   public ChoosSemaphoreSelection(Frame owner, MetricState metricState, ColorCondition condition) {
79     super(owner, true);
80     this.metricState = metricState;
81     resultColorCondition = null;
82     initComponents();
83     setValuesComponents(condition);
84   }
85
86   /**
87    * Setea los valores de los componentes para un <code>ColorCondition</code> determinado
88    * @param condition
89    */

90   private void setValuesComponents(ColorCondition condition) {
91     if(condition != null) {
92       storedColor = condition.getColor();
93       bgColor = storedColor;
94       Expression expression = condition.getExpression();
95       colorjTextField.setBackground(storedColor);
96       if(expression instanceof GreaterThan) {
97         greaterThanjRadioButton.setSelected(true);
98         greaterThanjRadioButtonMousePressed();
99         Float JavaDoc aFloat = Float.valueOf(expression.getArguments() [1].toString());
100         valuejTextField.setText(String.valueOf(aFloat.intValue()));
101       } else if(expression instanceof GreaterOrEqualTo) {
102         greaterOrEqualTojRadioButton.setSelected(true);
103         greaterOrEqualTojRadioButtonMousePressed();
104         Float JavaDoc aFloat = Float.valueOf(expression.getArguments() [1].toString());
105         valuejTextField.setText(String.valueOf(aFloat.intValue()));
106       } else if(expression instanceof LessThan) {
107         lessThanjRadioButton.setSelected(true);
108         lessThanjRadioButtonMousePressed();
109         Float JavaDoc aFloat = Float.valueOf(expression.getArguments() [1].toString());
110         valuejTextField.setText(String.valueOf(aFloat.intValue()));
111       } else if(expression instanceof LessOrEqualTo) {
112         lessOrEqualTojRadioButton.setSelected(true);
113         lessOrEqualTojRadioButtonMousePressed();
114         Float JavaDoc aFloat = Float.valueOf(expression.getArguments() [1].toString());
115         valuejTextField.setText(String.valueOf(aFloat.intValue()));
116       } else if(expression instanceof EqualTo) {
117         equalTojRadioButton.setSelected(true);
118         equalTojRadioButtonMousePressed();
119         Float JavaDoc aFloat = Float.valueOf(expression.getArguments() [1].toString());
120         valuejTextField.setText(String.valueOf(aFloat.intValue()));
121       } else if(expression instanceof AndExp) {
122         tabPanel.setSelectedIndex(1);
123         Expression [] expressions = expression.getArguments();
124         Expression greaterOrEqualTo = expressions [0];
125         Expression lessOrEqualTo = expressions [1];
126         Float JavaDoc aFloat = Float.valueOf(greaterOrEqualTo.getArguments() [1].toString());
127         fromjTextField.setText(String.valueOf(aFloat.intValue()));
128         aFloat = Float.valueOf(lessOrEqualTo.getArguments() [1].toString());
129         tojTextField.setText(String.valueOf(aFloat.intValue()));
130       }
131     }
132   }
133
134   /**
135    * Inicializa los componentes del Dialog
136    */

137   private void initComponents() {
138     operatorbuttonGroup = new javax.swing.ButtonGroup JavaDoc();
139     jPanel3 = new javax.swing.JPanel JavaDoc();
140     jPanel4 = new javax.swing.JPanel JavaDoc();
141     okjButton = new javax.swing.JButton JavaDoc();
142     canceljButton = new javax.swing.JButton JavaDoc();
143     jPanel6 = new javax.swing.JPanel JavaDoc();
144     tabPanel = new javax.swing.JTabbedPane JavaDoc();
145     jPanel2 = new javax.swing.JPanel JavaDoc();
146     greaterThanjRadioButton = new javax.swing.JRadioButton JavaDoc();
147     lessThanjRadioButton = new javax.swing.JRadioButton JavaDoc();
148     greaterOrEqualTojRadioButton = new javax.swing.JRadioButton JavaDoc();
149     lessOrEqualTojRadioButton = new javax.swing.JRadioButton JavaDoc();
150     equalTojRadioButton = new javax.swing.JRadioButton JavaDoc();
151     jPanel5 = new javax.swing.JPanel JavaDoc();
152     valuejLabel = new javax.swing.JLabel JavaDoc();
153     valuejTextField = new javax.swing.JTextField JavaDoc();
154     jPanel1 = new javax.swing.JPanel JavaDoc();
155     fromjLabel = new javax.swing.JLabel JavaDoc();
156     tojLabel = new javax.swing.JLabel JavaDoc();
157     fromjTextField = new javax.swing.JTextField JavaDoc();
158     tojTextField = new javax.swing.JTextField JavaDoc();
159     jPanel7 = new javax.swing.JPanel JavaDoc();
160     colorjLabel = new javax.swing.JLabel JavaDoc();
161     colorjTextField = new javax.swing.JTextField JavaDoc();
162     colorjButton = new javax.swing.JButton JavaDoc();
163
164     setResizable(false);
165     addWindowListener(new java.awt.event.WindowAdapter JavaDoc() {
166       public void windowClosing(java.awt.event.WindowEvent JavaDoc evt) {
167         setVisible(false);
168       }
169     });
170
171     getContentPane().add(jPanel3, java.awt.BorderLayout.NORTH);
172
173     jPanel4.setLayout(new java.awt.FlowLayout JavaDoc(java.awt.FlowLayout.RIGHT));
174
175     okjButton.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("112"));
176     okjButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
177     okjButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
178     jPanel4.add(okjButton);
179
180     canceljButton.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("113"));
181     canceljButton.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
182     canceljButton.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
183     jPanel4.add(canceljButton);
184
185     getContentPane().add(jPanel4, java.awt.BorderLayout.SOUTH);
186     jPanel6.setLayout(new java.awt.BorderLayout JavaDoc());
187     jPanel2.setLayout(new javax.swing.BoxLayout JavaDoc(jPanel2, javax.swing.BoxLayout.Y_AXIS));
188
189     greaterThanjRadioButton.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("117") + "(>)");
190     operatorbuttonGroup.add(greaterThanjRadioButton);
191     jPanel2.add(greaterThanjRadioButton);
192     seleccionRadioButton = 0;
193     greaterThanjRadioButton.setSelected(true);
194
195     lessThanjRadioButton.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("118") + "(<)");
196     operatorbuttonGroup.add(lessThanjRadioButton);
197     jPanel2.add(lessThanjRadioButton);
198
199     greaterOrEqualTojRadioButton.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("119") + "(>=)");
200     operatorbuttonGroup.add(greaterOrEqualTojRadioButton);
201     jPanel2.add(greaterOrEqualTojRadioButton);
202
203     lessOrEqualTojRadioButton.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("120") + "(<=)");
204     lessOrEqualTojRadioButton.setToolTipText("null");
205     operatorbuttonGroup.add(lessOrEqualTojRadioButton);
206     jPanel2.add(lessOrEqualTojRadioButton);
207
208     equalTojRadioButton.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("121") + "(=)");
209     operatorbuttonGroup.add(equalTojRadioButton);
210     jPanel2.add(equalTojRadioButton);
211
212     jPanel5.setLayout(null);
213
214     valuejLabel.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("122") + ":");
215     jPanel5.add(valuejLabel);
216     valuejLabel.setBounds(10, 8, 31, 16);
217
218     jPanel5.add(valuejTextField);
219     valuejTextField.setBounds(76, 4, 150, 20);
220
221     jPanel2.add(jPanel5);
222
223     tabPanel.addTab(com.calipso.reportgenerator.common.LanguageTraslator.traslate("123"), jPanel2);
224
225     jPanel1.setLayout(null);
226
227     fromjLabel.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("124") + ":");
228     jPanel1.add(fromjLabel);
229     fromjLabel.setBounds(10, 20, 39, 16);
230
231     tojLabel.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("125") + ":");
232     jPanel1.add(tojLabel);
233     tojLabel.setBounds(10, 50, 36, 16);
234
235     jPanel1.add(fromjTextField);
236     fromjTextField.setBounds(80, 20, 160, 20);
237
238     jPanel1.add(tojTextField);
239     tojTextField.setBounds(80, 50, 160, 20);
240
241     tabPanel.addTab(com.calipso.reportgenerator.common.LanguageTraslator.traslate("126"), jPanel1);
242
243     jPanel6.add(tabPanel, java.awt.BorderLayout.CENTER);
244
245     jPanel7.setLayout(null);
246
247     jPanel7.setBorder(new javax.swing.border.CompoundBorder JavaDoc(new javax.swing.border.SoftBevelBorder JavaDoc(javax.swing.border.BevelBorder.RAISED), null));
248     jPanel7.setPreferredSize(new java.awt.Dimension JavaDoc(10, 30));
249     colorjLabel.setText(com.calipso.reportgenerator.common.LanguageTraslator.traslate("127") + ":");
250     jPanel7.add(colorjLabel);
251     colorjLabel.setBounds(10, 6, 33, 16);
252
253     colorjTextField.setBackground(java.awt.Color.RED);
254     if(storedColor == null) {
255       bgColor = java.awt.Color.RED;
256     } else {
257       bgColor = storedColor;
258     }
259     colorjTextField.setEditable(false);
260     jPanel7.add(colorjTextField);
261     colorjTextField.setBounds(80, 6, 140, 20);
262
263     colorjButton.setText("...");
264     colorjButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
265       public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
266         colorjButtonActionPerformed();
267       }
268     });
269     okjButton.addActionListener(new java.awt.event.ActionListener JavaDoc() {
270       public void actionPerformed(java.awt.event.ActionEvent JavaDoc evt) {
271         try {
272           doPaint();
273         }
274         catch (Exception JavaDoc e) {
275           ShowExceptionMessageDialog.initExceptionDialogMessage(com.calipso.reportgenerator.common.LanguageTraslator.traslate("226"),e);
276         }
277       }
278     });
279
280     greaterThanjRadioButton.addMouseListener(new java.awt.event.MouseAdapter JavaDoc() {
281       public void mousePressed(java.awt.event.MouseEvent JavaDoc evt) {
282         greaterThanjRadioButtonMousePressed();
283       }
284     });
285
286     lessThanjRadioButton.addMouseListener(new java.awt.event.MouseAdapter JavaDoc() {
287       public void mousePressed(java.awt.event.MouseEvent JavaDoc evt) {
288         lessThanjRadioButtonMousePressed();
289       }
290     });
291
292     greaterOrEqualTojRadioButton.addMouseListener(new java.awt.event.MouseAdapter JavaDoc() {
293       public void mousePressed(java.awt.event.MouseEvent JavaDoc evt) {
294         greaterOrEqualTojRadioButtonMousePressed();
295       }
296     });
297     lessOrEqualTojRadioButton.addMouseListener(new java.awt.event.MouseAdapter JavaDoc() {
298       public void mousePressed(java.awt.event.MouseEvent JavaDoc evt) {
299         lessOrEqualTojRadioButtonMousePressed();
300       }
301     });
302     equalTojRadioButton.addMouseListener(new java.awt.event.MouseAdapter JavaDoc() {
303       public void mousePressed(java.awt.event.MouseEvent JavaDoc evt) {
304         equalTojRadioButtonMousePressed();
305       }
306     });
307
308     canceljButton.addActionListener(new ActionListener JavaDoc() {
309       public void actionPerformed(ActionEvent JavaDoc e) {
310         closeChoosSemaphoreSelection();
311
312       }
313     });
314
315
316     jPanel7.add(colorjButton);
317     colorjButton.setBounds(220, 6, 20, 20);
318
319     jPanel6.add(jPanel7, java.awt.BorderLayout.SOUTH);
320
321     getContentPane().add(jPanel6, java.awt.BorderLayout.CENTER);
322
323     pack();
324     java.awt.Dimension JavaDoc screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
325     setSize(new java.awt.Dimension JavaDoc(400, 300));
326     setLocation((screenSize.width - 400) / 2, (screenSize.height - 300) / 2);
327   }
328
329   /**
330    * Cierra el Dialog
331    */

332   private void closeChoosSemaphoreSelection() {
333     this.setVisible(false);
334   }
335
336   /**
337    * Retorna el indicador de para el JRadioButton equalTo
338    */

339   private void equalTojRadioButtonMousePressed() {
340     seleccionRadioButton = 4;
341   }
342
343   /**
344    * Retorna el indicador de para el JRadioButton lessOrEqualTo
345    */

346   private void lessOrEqualTojRadioButtonMousePressed() {
347     seleccionRadioButton = 3;
348   }
349
350   /**
351    * Retorna el indicador de para el JRadioButton greaterOrEqualTo
352    */

353   private void greaterOrEqualTojRadioButtonMousePressed() {
354     seleccionRadioButton = 2;
355   }
356
357   /**
358    * Retorna el indicador de para el JRadioButton lessThan
359    */

360   private void lessThanjRadioButtonMousePressed() {
361     seleccionRadioButton = 1;
362   }
363
364   /**
365    * Retorna el indicador de para el JRadioButton greaterThan
366    */

367   private void greaterThanjRadioButtonMousePressed() {
368     seleccionRadioButton = 0;
369   }
370
371   /**
372    * Actualiza el colorcondition y cierra el Dialog
373    */

374   private void doPaint() throws InfoException {
375     switch (tabPanel.getSelectedIndex()) {
376       case 0:
377         {
378           resultColorCondition = doPaintSimpleSelectionMode();
379           break;
380         }
381       case 1:
382         {
383           resultColorCondition = doPaintRangoSeleccionMode();
384           break;
385         }
386     }
387     if (resultColorCondition != null) {
388       setVisible(false);
389     }
390   }
391
392   /**
393    * retorna un color condition , seteando la expresion segun corresponda
394    * @return
395    */

396   private ColorCondition doPaintSimpleSelectionMode() throws InfoException {
397     switch (seleccionRadioButton) {
398       case 0:
399         {
400           return greaterThan();
401         }
402       case 1:
403         {
404           return lessThan();
405         }
406       case 2:
407         {
408           return greaterOrEqualTo();
409         }
410       case 3:
411         {
412           return lessOrEqualTo();
413         }
414       case 4:
415         {
416           return equalTo();
417         }
418     }
419     return null;
420   }
421
422   /**
423    * Retorna el colorCondition cuando la expresion es igual a un numero determinaddo
424    * @return
425    */

426   private ColorCondition equalTo() throws InfoException {
427     Vector JavaDoc errors = new Vector JavaDoc();
428     float value = 0;
429     try {
430       value = Float.parseFloat(this.valuejTextField.getText());
431     }
432     catch (NumberFormatException JavaDoc e) {
433       errors.add(valuejTextField.getText());
434       toString();
435     }
436     if (errors.size() == 0) {
437       value = Float.parseFloat(this.valuejTextField.getText());
438       Expression expression = (new VariableExp("VALUE")).newEqualTo(new ConstantExp(new Float JavaDoc(value)));
439       return newColorCondition(expression);
440     }
441     else {
442       if (errors.size() == 1) {
443         String JavaDoc message = MessageFormat.format(com.calipso.reportgenerator.common.LanguageTraslator.traslate("128"), new Object JavaDoc[]{this.valuejTextField.getText()});
444        throw new InfoException(message);
445       }
446       return null;
447     }
448   }
449
450   /**
451    * Retorna el colorCondition y actualiza su color
452    * @return
453    */

454   private ColorCondition newColorCondition(Expression expression) {
455     if (bgColor == null) {
456       //bgColor = Color.RED;
457

458       bgColor = colorjTextField.getBackground();
459     }
460     return new ColorCondition(expression, bgColor, metricState);
461   }
462
463   /**
464    * Retorna el colorCondition cuando la expresion sea menor o igual a un numero determinaddo
465    * @return
466    */

467   private ColorCondition lessOrEqualTo() throws InfoException {
468     Vector JavaDoc errors = new Vector JavaDoc();
469     float value = 0;
470     try {
471       value = Float.parseFloat(this.valuejTextField.getText());
472     }
473     catch (NumberFormatException JavaDoc e) {
474       errors.add(valuejTextField.getText());
475     }
476     if (errors.size() == 0) {
477       value = Float.parseFloat(this.valuejTextField.getText());
478       Expression expression = (new VariableExp("VALUE")).newLessOrEquealTo(new ConstantExp(new Float JavaDoc(value)));
479       return newColorCondition(expression);
480     }
481     else {
482       if (errors.size() == 1) {
483         String JavaDoc message = MessageFormat.format(com.calipso.reportgenerator.common.LanguageTraslator.traslate("128"), new Object JavaDoc[]{this.valuejTextField.getText()});
484         throw new InfoException(message);
485       }
486       return null;
487     }
488   }
489
490   /**
491    * Retorna el colorCondition cuando la expresion sea mayor o igual a un numero determinaddo
492    * @return
493    */

494   private ColorCondition greaterOrEqualTo() throws InfoException {
495     Vector JavaDoc errors = new Vector JavaDoc();
496     float value = 0;
497     try {
498       value = Float.parseFloat(this.valuejTextField.getText());
499     }
500     catch (NumberFormatException JavaDoc e) {
501       errors.add(valuejTextField.getText());
502     }
503     if (errors.size() == 0) {
504       value = Float.parseFloat(this.valuejTextField.getText());
505       Expression expression = (new VariableExp("VALUE")).newGreaterOrEqualTo(new ConstantExp(new Float JavaDoc(value)));
506       return newColorCondition(expression);
507     }
508     else {
509       if (errors.size() == 1) {
510         String JavaDoc message = MessageFormat.format(com.calipso.reportgenerator.common.LanguageTraslator.traslate("128"), new Object JavaDoc[]{this.valuejTextField.getText()});
511        throw new InfoException(message);
512       }
513       return null;
514     }
515   }
516
517   /**
518    * Retorna el colorCondition cuando la expresion sea menor a un numero determinaddo
519    * @return
520    */

521   private ColorCondition lessThan() throws InfoException {
522     Vector JavaDoc errors = new Vector JavaDoc();
523     float value = 0;
524     try {
525       value = Float.parseFloat(this.valuejTextField.getText());
526     }
527     catch (NumberFormatException JavaDoc e) {
528       errors.add(valuejTextField.getText());
529     }
530     if (errors.size() == 0) {
531       value = Float.parseFloat(this.valuejTextField.getText());
532       Expression expression = (new VariableExp("VALUE")).newLessThan(new ConstantExp(new Float JavaDoc(value)));
533       return newColorCondition(expression);
534     }
535     else {
536       if (errors.size() == 1) {
537         String JavaDoc message = MessageFormat.format(com.calipso.reportgenerator.common.LanguageTraslator.traslate("128"), new Object JavaDoc[]{this.valuejTextField.getText()});
538         throw new InfoException(message);
539       }
540       return null;
541     }
542   }
543
544   /**
545    * Retorna el colorCondition cuando la expresion sea mayor a un numero determinaddo
546    * @return
547    */

548
549   private ColorCondition greaterThan() throws InfoException {
550     Vector JavaDoc errors = new Vector JavaDoc();
551     float value = 0;
552     try {
553       value = Float.parseFloat(this.valuejTextField.getText());
554     }
555     catch (NumberFormatException JavaDoc e) {
556       errors.add(valuejTextField.getText());
557     }
558     if (errors.size() == 0) {
559       value = Float.parseFloat(this.valuejTextField.getText());
560       Expression expression = (new VariableExp("VALUE")).newGreaterThan(new ConstantExp(new Float JavaDoc(value)));
561       return newColorCondition(expression);
562     }
563     else {
564       if (errors.size() == 1) {
565         String JavaDoc message = MessageFormat.format(com.calipso.reportgenerator.common.LanguageTraslator.traslate("128"), new Object JavaDoc[]{this.valuejTextField.getText()});
566         throw new InfoException(message);
567       }
568       return null;
569     }
570   }
571
572   /**
573    * Evento del boton de seleccion de colores
574    */

575   private void colorjButtonActionPerformed() {
576     this.executeJColorChooser();
577   }
578
579   /**
580    * Retona un colorCondition comprendido en un determinado rango de valores
581    * @return
582    */

583   private ColorCondition doPaintRangoSeleccionMode() throws InfoException {
584     float desdeValue = 0;
585     float hastaValue = 0;
586     Vector JavaDoc errors = new Vector JavaDoc();
587     Expression exp = null;
588     try {
589       desdeValue = Float.parseFloat(this.fromjTextField.getText());
590     }
591     catch (NumberFormatException JavaDoc e) {
592       errors.add(fromjTextField.getText());
593     }
594     try {
595       hastaValue = Float.parseFloat(this.tojTextField.getText());
596     }
597     catch (NumberFormatException JavaDoc e) {
598       errors.add(tojTextField.getText());
599     }
600     if (errors.size() == 0) {
601       Expression subexp1 = (new VariableExp("VALUE")).newGreaterOrEqualTo(new ConstantExp(new Float JavaDoc(desdeValue)));
602       Expression subexp2 = (new VariableExp("VALUE")).newLessOrEquealTo((new ConstantExp(new Float JavaDoc(hastaValue))));
603       exp = subexp1.newAnd(subexp2);
604       return newColorCondition(exp);
605     }
606     else {
607       if (errors.size() == 1) {
608         String JavaDoc message = MessageFormat.format(com.calipso.reportgenerator.common.LanguageTraslator.traslate("128"), new Object JavaDoc[]{errors.get(0)});
609         throw new InfoException(message);
610       }
611       else {
612         String JavaDoc message = MessageFormat.format(com.calipso.reportgenerator.common.LanguageTraslator.traslate("129"), new Object JavaDoc[]{errors.get(0), errors.get(1)});
613         throw new InfoException(message);
614       }
615     }
616   }
617
618   /**
619    * Pone no visible el JColorChooser y setea el color que se quiere utilizar
620    */

621   private void executeJColorChooser() {
622     if(storedColor != null) {
623       bgColor = JColorChooser.showDialog(this, "", storedColor);
624     } else {
625       bgColor = JColorChooser.showDialog(this, "", getBackground());
626     }
627     if (bgColor != null) {
628       colorjTextField.setBackground(bgColor);
629     }
630   }
631 }
Popular Tags