KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > it > businesslogic > ireport > gui > sheet > ReportElementSheetPanel


1 /*
2  * Copyright (C) 2005 - 2006 JasperSoft Corporation. All rights reserved.
3  * http://www.jaspersoft.com.
4  *
5  * Unless you have purchased a commercial license agreement from JasperSoft,
6  * the following license terms apply:
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as published by
10  * the Free Software Foundation.
11  *
12  * This program is distributed WITHOUT ANY WARRANTY; and without the
13  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
18  * or write to:
19  *
20  * Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330,
22  * Boston, MA USA 02111-1307
23  *
24  *
25  *
26  *
27  * ReportElementSheetPanel.java
28  *
29  * Created on 16 febbraio 2005, 6.57
30  *
31  */

32
33 package it.businesslogic.ireport.gui.sheet;
34
35 import it.businesslogic.ireport.*;
36 import it.businesslogic.ireport.BarcodeReportElement;
37 import it.businesslogic.ireport.FontListLoader;
38 import it.businesslogic.ireport.GraphicReportElement;
39 import it.businesslogic.ireport.IReportFont;
40 import it.businesslogic.ireport.LineReportElement;
41 import it.businesslogic.ireport.RectangleReportElement;
42 import it.businesslogic.ireport.TextFieldReportElement;
43 import it.businesslogic.ireport.TextReportElement;
44 import it.businesslogic.ireport.crosstab.CrosstabCell;
45 import it.businesslogic.ireport.gui.*;
46 import it.businesslogic.ireport.gui.JNumberComboBox;
47 import it.businesslogic.ireport.gui.JNumberField;
48 import it.businesslogic.ireport.gui.event.*;
49 import it.businesslogic.ireport.util.*;
50 import it.businesslogic.ireport.util.LanguageChangedEvent;
51 import it.businesslogic.ireport.util.LanguageChangedListener;
52 import java.awt.Point JavaDoc;
53 import java.util.*;
54 import javax.swing.FocusManager JavaDoc;
55 import javax.swing.JCheckBox JavaDoc;
56 import javax.swing.JComboBox JavaDoc;
57 import javax.swing.JComponent JavaDoc;
58
59 /**
60  *
61  * @author Administrator
62  */

63 public class ReportElementSheetPanel extends CategorySheetPanel implements ReportListener, LanguageChangedListener, ReportFrameActivatedListener {
64     
65     // Sheet properties
66
private ComboBoxSheetProperty spBands;
67     private SheetProperty spTop;
68     private SheetProperty spLeft;
69     private SheetProperty spHeight;
70     private SheetProperty spWidth;
71     private SheetProperty spFgColor;
72     private SheetProperty spBgColor;
73     private SheetProperty spMode;
74     
75     private SheetProperty spPrintRepeatedValues;
76     private SheetProperty spPrintWhenDetailOverflows;
77     private SheetProperty spPrintInFirstWholeBand;
78     private SheetProperty spRemoveLineWhenBlank;
79     private SheetProperty spPositionType;
80     private SheetProperty spElementKey;
81     private SheetProperty spStretchType;
82     private ComboBoxSheetProperty spStyle;
83     
84     private ComboBoxSheetProperty spGroups;
85     private ExpressionSheetProperty spPrintWhenExpression;
86     
87     private SheetProperty spFill;
88     private SheetProperty spPen;
89     
90     private SheetProperty spRadius;
91     private SheetProperty spDirection;
92     
93     private SheetProperty spTextHAlign;
94     private SheetProperty spTextVAlign;
95     private SheetProperty spStyledText;
96     private SheetProperty spLineSpacing;
97     private SheetProperty spRotate;
98     
99     private SheetProperty spFontName;
100     private NumberComboBoxSheetProperty spFontSize;
101     private SheetProperty spPdfFontName;
102     private SheetProperty spBold;
103     private SheetProperty spItalic;
104     private SheetProperty spUnderline;
105     private SheetProperty spStriketrough;
106     private SheetProperty spPdfEmbedded;
107     private SheetProperty spPdfEncoding;
108     
109     private ExpressionSheetProperty spStaticText;
110     private ExpressionSheetProperty spTextfieldExpression;
111     private SheetProperty spTextfieldExpressionClass;
112     private SheetProperty spTextfieldEvaluationTime;
113     private ComboBoxSheetProperty spTextfieldEvaluationGroup;
114     private SheetProperty spStretchWithOverflow;
115     private SheetProperty spTextfieldBlankWhenNull;
116     private PatternSheetProperty spPattern;
117     
118     private ExpressionSheetProperty spImageExpression;
119     private SheetProperty spImageExpressionClass;
120     private SheetProperty spImageEvaluationTime;
121     private ComboBoxSheetProperty spImageEvaluationGroup;
122     private SheetProperty spImageScale;
123     private SheetProperty spImageError;
124     private SheetProperty spImageHAlign;
125     private SheetProperty spImageVAlign;
126     private SheetProperty spImageLazy;
127     private SheetProperty spImageCache;
128     
129     
130     private SheetProperty spBCType;
131     private SheetProperty spBCChecksum;
132     private SheetProperty spBCShowText;
133     private ExpressionSheetProperty spBCExpression;
134     private SheetProperty spBCBarWidth;
135     private SheetProperty spBCBarHeight;
136     private ExpressionSheetProperty spBCApplicationIdentifier;
137     private SheetProperty spBCScale;
138     private SheetProperty spBCError;
139     private SheetProperty spBCHAlign;
140     private SheetProperty spBCVAlign;
141     private SheetProperty spBCEvaluationTime;
142     private ComboBoxSheetProperty spBCEvaluationGroup;
143     
144     private SheetProperty spBreakType;
145     
146     // --- CAHRT ---
147
private SheetProperty spChartEvaluationTime;
148     private ComboBoxSheetProperty spChartEvaluationGroup;
149     
150     
151     public static java.awt.Color JavaDoc sharedDifferentValueLabelColor = java.awt.Color.red.darker().darker();
152     public static java.awt.Color JavaDoc mandatoryPropertiesLabelColor = java.awt.Color.blue;
153     public static java.awt.Color JavaDoc notMandatoryPropertiesLabelColor = java.awt.Color.black;
154         
155     private JReportFrame jrf = null;
156     private boolean init = false;
157     
158     private Vector elementSelection = new Vector();
159     
160     /** Creates a new instance of ReportElementSheetPanel */
161     public ReportElementSheetPanel() {
162         super();
163         
164         initSheetProperties();
165         // We have to register for element changes...
166
MainFrame mf = MainFrame.getMainInstance();
167         mf.addReportListener( this );
168         mf.addReportFrameActivatedListener( this);
169         
170         I18n.addOnLanguageChangedListener( this );
171         
172         MainFrame.getMainInstance().addFontsListChangedListener( new FontsListChangedListener() {
173             public void fontsListChanged(FontsListChangedEvent evt) {
174                 
175                 boolean localinit = isInit();
176                 setInit(true);
177                 updateReportFonts();
178                 setInit(localinit);
179             }
180         } );
181     }
182
183     public void reportFrameActivated(ReportFrameActivatedEvent evt) {
184     
185         if (evt.getReportFrame() == null)
186         {
187             updateSelection(evt.getReportFrame());
188         }
189         
190     }
191     
192     public void languageChanged(LanguageChangedEvent evt) {
193         this.removeAllProperties();
194         initSheetProperties();
195         updateSelection();
196     }
197
198     
199      public void updateSelection()
200      {
201          JReportFrame newJrf = MainFrame.getMainInstance().getActiveReportFrame();
202          updateSelection(newJrf);
203      }
204      
205      /**
206       * Numbers do not change when the focus is lost due to a selection change.
207       * This apply the value....
208       */

209      public void applyValueForNumbers()
210      {
211          Enumeration e = getProperties().elements();
212          while (e.hasMoreElements())
213          {
214              SheetProperty sp = (SheetProperty)e.nextElement();
215
216              //if (sp instanceof NumberComboBoxSheetProperty)
217
//{
218
// JNumberComboBox c = (JNumberComboBox)sp.getEditor();
219
// System.out.println("NNNN");
220
// if (c.hasFocus())
221
// {
222
// FocusManager.getCurrentManager().clearGlobalFocusOwner();
223
// System.out.println(FocusManager.getCurrentManager().getFocusOwner());
224
// return; // Only a component can be focused at time...
225
// }
226
//}
227
if (sp.getType() == sp.INTEGER || sp.getType() == sp.NUMBER)
228              {
229                  JComponent JavaDoc c = sp.getEditor();
230                  if (c.hasFocus() && c instanceof JNumberField)
231                  {
232                     ((JNumberField)c).focusLost(null);
233                     return; // Only a component can be focused at time...
234
}
235              }
236              
237          }
238      }
239      
240     /**
241      * Update all the element properties...
242      *
243      */

244      public void updateSelection(JReportFrame newJrf)
245      {
246         // Fix for numbers focus losing...
247
applyValueForNumbers();
248                 
249         setInit(true);
250         if (newJrf != null)
251         {
252              if (newJrf.getSelectedCrosstabEditorPanel() == null)
253              {
254                 setElementSelection( newJrf.getSelectedElements() );
255              }
256              else
257              {
258                 setElementSelection( newJrf.getSelectedCrosstabEditorPanel().getSelectedElements() );
259              }
260         }
261         else
262         {
263              getElementSelection().removeAllElements();
264         }
265         
266         this.removeAllProperties();
267         
268         this.jrf = newJrf;
269         
270         if (jrf == null || getElementSelection().size() == 0)
271         {
272             this.recreateSheet();
273             return;
274         }
275         
276         updateAllComboBoxes();
277       
278         try {
279         Vector selectedElements = getElementSelection();
280         
281         
282         boolean sameBand = true;
283         boolean sameTop = true;
284         boolean sameLeft = true;
285         boolean sameWidth = true;
286         boolean sameHeight = true;
287         boolean sameForeground = true;
288         boolean sameBackground = true;
289         boolean sameMode = true;
290         boolean samePrintRepeatedValues = true;
291         boolean samePrintWhenDetailOverflows = true;
292         boolean samePrintInFirstWholeBand = true;
293         boolean sameRemoveLineWhenBlank = true;
294         boolean samePositionType = true;
295         boolean samePrintWhenGroupChanges = true;
296         boolean sameStretchType = true;
297         boolean sameStyle = true;
298         boolean samePrintWhenExpression = true;
299         
300         // ---- GRAPHICS ELEMENT -----
301
boolean areAllGraphicsElements = true;
302         boolean sameFill = true;
303         boolean samePen = true;
304         
305         // ---- RECTANGLE ELEMENT -----
306
boolean areAllRectangleElements = true;
307         boolean sameRadius = true;
308         
309         // ---- LINE ELEMENT -----
310
boolean areAllLineElements = true;
311         boolean sameDirection = true;
312         
313         // ---- TEXT ELEMENT ELEMENT -----
314
boolean areAllTextElements = true;
315         boolean sameHAlign = true;
316         boolean sameVAlign = true;
317         boolean sameStyledText = true;
318         boolean sameLineSpacing = true;
319         boolean sameRotate = true;
320         boolean sameBold = true;
321         boolean sameItalic = true;
322         boolean sameUnderline = true;
323         boolean sameStrikethrough = true;
324         boolean samePdfEmbedded = true;
325         boolean sameFontSize = true;
326         boolean sameFontName = true;
327         boolean samePDFFontName = true;
328         boolean samePdfEncoding = true;
329         
330         // ---- BREAK ELEMENT ELEMENT -----
331
boolean areAllBreakElements = true;
332         boolean sameBreakType = true;
333         
334         // ---- SATIC TEXT ELEMENT ELEMENT -----
335
boolean areAllStaticTextElements = true;
336         boolean sameText = true;
337         
338         // ---- TEXTFIELD ELEMENT ELEMENT -----
339
boolean areAllTextfieldElements = true;
340         boolean sameTextfieldExpression = true;
341         boolean sameTextfieldExpressionClass = true;
342         boolean sameTextfieldEvaluationTime = true;
343         boolean sameTextfieldEvaluationGroup = true;
344         boolean sameStrtchWithOverflow = true;
345         boolean sameBlankWhenNull = true;
346         boolean samePattern = true;
347         
348         // ---- IAMGE ELEMENT -----
349
boolean areAllImageElements = true;
350         boolean sameImageExpression = true;
351         boolean sameImageExpressionClass = true;
352         boolean sameImageEvaluationTime = true;
353         boolean sameImageEvaluationGroup = true;
354         boolean sameImageLazy = true;
355         boolean sameImageCache = true;
356         boolean sameImageScale = true;
357         boolean sameImageOnError = true;
358         boolean sameImageVAlign = true;
359         boolean sameImageHAlign = true;
360         
361         // ---- BARCODE ELEMENT ----
362
boolean areAllBarcodeElements = true;
363         boolean sameBCType = true;
364         boolean sameBCChecksum = true;
365         boolean sameBCShowText = true;
366         boolean sameBCExpression = true;
367         boolean sameBCBarWidth = true;
368         boolean sameBCBarHeight = true;
369         boolean sameBCApplicationIdentifier = true;
370         boolean sameBCScale = true;
371         boolean sameBCError = true;
372         boolean sameBCHAlign = true;
373         boolean sameBCVAlign = true;
374         boolean sameBCEvaluationTime = true;
375         boolean sameBCEvaluationGroup = true;
376         
377         // --- CHART ELEMENT ----
378
boolean areAllChartElements = true;
379         boolean sameChartEvaluationTime = true;
380         boolean sameChartEvaluationGroup = true;
381
382         boolean isTheFirstElement = true;
383         
384         //spBands.setSetting(true);
385
Band last_band = null;
386         int y_location = 0;
387         
388         for (int i=0; i<selectedElements.size(); ++i)
389         {
390             ReportElement re = (ReportElement)selectedElements.elementAt(i);
391             if (re.getBand() != null && (last_band == null || last_band != re.getBand())) {
392                y_location = this.jrf.getReport().getBandYLocation(re.getBand());
393                last_band = re.getBand();
394             }
395
396             int x_location = this.jrf.getReport().getLeftMargin();
397
398             if (re.getBand() == null && re.getCell() != null)
399             {
400                 y_location = re.getCell().getTop();
401                 x_location = re.getCell().getLeft();
402             }
403                 
404             if (sameBand) sameBand = setComboBox(isTheFirstElement, (re.getBand() == null) ? (Object JavaDoc)re.getCell() : (Object JavaDoc)re.getBand(), (JComboBox JavaDoc)spBands.getEditor());
405             
406             if (sameTop)
407             {
408                 int position_y = re.getPosition().y;
409                 if (re.getParentElement() != null) position_y -= re.getParentElement().getPosition().y;
410                 else position_y = position_y - y_location - 10;
411                 
412                 sameTop = this.setElementNumber(isTheFirstElement, (double)position_y, (JNumberField)spTop.getEditor());
413             }
414             
415             if (sameLeft)
416             {
417                 int position_x = re.getPosition().x;
418                 if (re.getParentElement() != null) position_x -= re.getParentElement().getPosition().x;
419                 else position_x = position_x - 10 - x_location;
420                 
421                 sameLeft = this.setElementNumber(isTheFirstElement,position_x, (JNumberField)spLeft.getEditor());
422             }
423             if (sameWidth) sameWidth = this.setElementNumber(isTheFirstElement, re.getWidth(), (JNumberField)spWidth.getEditor());
424             if (sameHeight) sameHeight = this.setElementNumber(isTheFirstElement, re.getHeight(), (JNumberField)spHeight.getEditor());
425             if (sameForeground) sameForeground = this.setColorProperty(isTheFirstElement, re.getColorValue(re.FGCOLOR, null), spFgColor);
426             if (sameBackground) sameBackground = this.setColorProperty(isTheFirstElement, re.getColorValue(re.BGCOLOR, null), spBgColor);
427             
428             if (sameMode) sameMode = this.setCheckBox(isTheFirstElement, re.getTransparent().equals("Transparent"), re.getPropertyValue(re.MODE)==null, spMode );
429             if (samePrintRepeatedValues) samePrintRepeatedValues = this.setCheckBox(isTheFirstElement, re.isIsPrintRepeatedValues(), false, spPrintRepeatedValues );
430             if (samePrintWhenDetailOverflows) samePrintWhenDetailOverflows= this.setCheckBox(isTheFirstElement, re.isIsPrintWhenDetailOverflows(), false, spPrintWhenDetailOverflows );
431             if (samePrintInFirstWholeBand) samePrintInFirstWholeBand = this.setCheckBox(isTheFirstElement, re.isIsPrintInFirstWholeBand(), false, spPrintInFirstWholeBand );
432             if (sameRemoveLineWhenBlank) sameRemoveLineWhenBlank = this.setCheckBox(isTheFirstElement, re.isIsRemoveLineWhenBlank(), false, spRemoveLineWhenBlank );
433             if (samePositionType) samePositionType = setTagComboBox(isTheFirstElement, re.getPositionType(), spPositionType);
434             if (samePrintWhenGroupChanges) samePrintWhenGroupChanges = setTagComboBox(isTheFirstElement, re.getPrintWhenGroupChanges(), spGroups);
435             if (sameStretchType) sameStretchType = setTagComboBox(isTheFirstElement, re.getStretchType(), spStretchType);
436             if (sameStyle) sameStyle = setTagComboBox(isTheFirstElement, (re.getStyle() == null) ? (Object JavaDoc)"" : (Object JavaDoc)re.getStyle(), spStyle);
437             if (samePrintWhenExpression) samePrintWhenExpression = setTextArea(isTheFirstElement, re.getPrintWhenExpression(), spPrintWhenExpression);
438             if (i==0) spElementKey.setValue(re.getKey());
439             
440             // ---- GRAPHIC ELEMENTS ----
441
if (areAllGraphicsElements && (re instanceof GraphicReportElement))
442             {
443                 GraphicReportElement gre = (GraphicReportElement)re;
444                 if (samePen) samePen = setTagComboBox(isTheFirstElement, re.getPropertyValue(gre.PEN), spPen);
445                 if (sameFill) sameFill = setTagComboBox(isTheFirstElement, re.getPropertyValue(gre.FILL), spFill);
446             }
447             else
448             {
449                 areAllGraphicsElements = false;
450             }
451             
452             // ---- RECTANGLE ELEMENTS ----
453
if (areAllRectangleElements && (re instanceof RectangleReportElement))
454             {
455                 RectangleReportElement rre = (RectangleReportElement)re;
456                 if (sameRadius) sameRadius = setGenericSheetProperty(isTheFirstElement, rre.getPropertyValue(rre.RADIUS), spRadius);
457             }
458             else
459             {
460                 areAllRectangleElements = false;
461             }
462             
463             // ---- LINE ELEMENTS ----
464
if (areAllLineElements && (re instanceof LineReportElement))
465             {
466                 LineReportElement rre = (LineReportElement)re;
467                 if (sameDirection) sameDirection = setTagComboBox(isTheFirstElement, rre.getDirection(), spDirection);
468             }
469             else
470             {
471                 areAllLineElements = false;
472             }
473             
474             // ---- TEXT ELEMENTS ----
475
if (areAllTextElements && (re instanceof TextReportElement))
476             {
477                 TextReportElement rre = (TextReportElement)re;
478                 if (sameHAlign) sameHAlign = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.ALIGN), spTextHAlign);
479                 if (sameVAlign) sameVAlign = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.VERTICAL_ALIGN), spTextVAlign);
480                 if (sameStyledText) sameStyledText = this.setCheckBox(isTheFirstElement, rre.isIsStyledText(), re.getPropertyValue(rre.IS_STYLED_TEXT)==null, spStyledText );
481                 if (sameLineSpacing) sameLineSpacing = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.LINE_SPACING), spLineSpacing);
482                 if (sameRotate) sameRotate = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.ROTATE), spRotate);
483                 
484                 if (sameBold) sameBold = this.setCheckBox(isTheFirstElement, rre.isBold(), rre.getIReportFont().getPropertyValue( IReportFont.IS_BOLD)==null, spBold );
485                 if (sameItalic) sameItalic = this.setCheckBox(isTheFirstElement, rre.isItalic(), rre.getIReportFont().getPropertyValue( IReportFont.IS_ITALIC)==null, spItalic );
486                 if (sameUnderline) sameUnderline = this.setCheckBox(isTheFirstElement, rre.isUnderline(), rre.getIReportFont().getPropertyValue( IReportFont.IS_UNDERLINE)==null, spUnderline );
487                 if (sameStrikethrough) sameStrikethrough = this.setCheckBox(isTheFirstElement, rre.isStrikeTrought(), rre.getIReportFont().getPropertyValue( IReportFont.IS_STRIKETROUGHT)==null, spStriketrough );
488                 if (samePdfEmbedded) samePdfEmbedded = this.setCheckBox(isTheFirstElement, rre.isPdfEmbedded(), rre.getIReportFont().getPropertyValue( IReportFont.IS_PDF_EMBEDDED)==null, spPdfEmbedded );
489                 if (sameFontSize) sameFontSize = this.setElementNumber(isTheFirstElement, rre.getFontSize(), rre.getIReportFont().getPropertyValue( IReportFont.FONT_SIZE), spFontSize);
490                 if (sameFontName) sameFontName = setTagComboBox(isTheFirstElement, rre.getIReportFont().getPropertyValue( IReportFont.FONT_NAME), spFontName);
491                 if (samePDFFontName) samePDFFontName = this.setTagComboBox(isTheFirstElement, rre.getIReportFont().getPropertyValue( IReportFont.PDF_FONT_NAME) , spPdfFontName );
492                 if (samePdfEncoding) samePdfEncoding = this.setTagComboBox(isTheFirstElement, rre.getIReportFont().getPropertyValue( IReportFont.PDF_ENCODING) , spPdfEncoding );
493                 
494             }
495             else
496             {
497                 areAllTextElements = false;
498             }
499             
500             // ---- STATIC TEXT ELEMENTS ----
501
if (areAllStaticTextElements && (re instanceof StaticTextReportElement))
502             {
503                 StaticTextReportElement rre = (StaticTextReportElement)re;
504                 if (sameText) sameText = setTextArea(isTheFirstElement, rre.getText(), spStaticText);
505             }
506             else
507             {
508                 areAllStaticTextElements = false;
509             }
510             
511             // ---- TEXTFIELD ELEMENTS ----
512
if (areAllTextfieldElements && (re instanceof TextFieldReportElement))
513             {
514                 TextFieldReportElement rre = (TextFieldReportElement)re;
515                 if (sameTextfieldExpression) sameTextfieldExpression = setTextArea(isTheFirstElement, rre.getText(), spTextfieldExpression);
516                 if (sameTextfieldExpressionClass) sameTextfieldExpressionClass = setTagComboBox(isTheFirstElement, rre.getClassExpression(), spTextfieldExpressionClass);
517                 if (sameTextfieldEvaluationTime) sameTextfieldEvaluationTime = setTagComboBox(isTheFirstElement, rre.getEvaluationTime(), spTextfieldEvaluationTime);
518                 if (sameTextfieldEvaluationGroup && sameTextfieldEvaluationTime) sameTextfieldEvaluationGroup = setTagComboBox(isTheFirstElement, rre.getGroup(), spTextfieldEvaluationGroup);
519                 if (sameStrtchWithOverflow) sameStrtchWithOverflow = setCheckBox(isTheFirstElement, rre.isStretchWithOverflow(), false, spStretchWithOverflow);
520                 if (sameBlankWhenNull) sameBlankWhenNull = setCheckBox(isTheFirstElement, rre.isBlankWhenNull(), false, spTextfieldBlankWhenNull);
521                 if (samePattern) samePattern = setTextPattern(isTheFirstElement, re.getPropertyValue( rre.PATTERN ), spPattern);
522             }
523             else
524             {
525                 areAllTextfieldElements = false;
526             }
527             
528             // ---- IMAGE ELEMENTS ----
529
if (areAllImageElements && (re instanceof ImageReportElement) && !(re instanceof BarcodeReportElement))
530             {
531                 ImageReportElement rre = (ImageReportElement)re;
532                 if (sameImageExpression) sameImageExpression = setTextArea(isTheFirstElement, rre.getImageExpression(), spImageExpression);
533                 if (sameImageExpressionClass) sameImageExpressionClass = setTagComboBox(isTheFirstElement, rre.getImageClass(), spImageExpressionClass);
534                 if (sameImageEvaluationTime) sameImageEvaluationTime = setTagComboBox(isTheFirstElement, rre.getEvaluationTime(), spImageEvaluationTime);
535                 if (sameImageEvaluationGroup && sameImageEvaluationTime) sameImageEvaluationGroup = setTagComboBox(isTheFirstElement, rre.getEvaluationGroup(), spImageEvaluationGroup);
536                 if (sameImageLazy) sameImageLazy = setCheckBox(isTheFirstElement, rre.isIsLazy(), false, spImageLazy);
537                 if (sameImageScale) sameImageScale = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.SCALE), spImageScale);
538                 if (sameImageCache) sameImageCache = setCheckBox(isTheFirstElement, rre.isIsUsingCache(), rre.getPropertyValue(rre.USING_CACHE)==null, spImageCache);
539                 if (sameImageVAlign) sameImageVAlign = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.VERTICAL_ALIGN), spImageVAlign);
540                 if (sameImageHAlign) sameImageHAlign = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.HORIZONTAL_ALIGN), spImageHAlign);
541             }
542             else
543             {
544                 areAllImageElements = false;
545             }
546         
547             // ---- IMAGE ELEMENTS ----
548
if (areAllBarcodeElements && re instanceof BarcodeReportElement)
549             {
550                 BarcodeReportElement rre = (BarcodeReportElement)re;
551                 if (sameBCType) sameBCType = setTagComboBox(isTheFirstElement, rre.getType()+"", spBCType);
552                 if (sameBCBarWidth) sameBCBarWidth = setGenericSheetProperty(isTheFirstElement, ""+rre.getImageWidth(), spBCBarWidth);
553                 if (sameBCBarHeight) sameBCBarHeight = setGenericSheetProperty(isTheFirstElement, ""+rre.getImageHeight(), spBCBarHeight);
554                 if (sameBCExpression) sameBCExpression = setTextArea(isTheFirstElement, rre.getText(), spBCExpression);
555                 if (sameBCApplicationIdentifier) sameBCApplicationIdentifier = setTextArea(isTheFirstElement, rre.getApplicationIdentifier(), spBCApplicationIdentifier);
556                 if (sameBCEvaluationTime) sameBCEvaluationTime = setTagComboBox(isTheFirstElement, rre.getEvaluationTime(), spBCEvaluationTime);
557                 if (sameBCEvaluationGroup && sameBCEvaluationTime) sameBCEvaluationGroup = setTagComboBox(isTheFirstElement, rre.getEvaluationGroup(), spBCEvaluationGroup);
558                 if (sameBCShowText) sameBCShowText = setCheckBox(isTheFirstElement, rre.isShowText(), false, spBCShowText);
559                 if (sameBCChecksum) sameBCChecksum = setCheckBox(isTheFirstElement, rre.isCheckSum(), false, spBCChecksum);
560                 if (sameBCScale) sameBCScale = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.SCALE), spBCScale);
561                 if (sameBCVAlign) sameBCVAlign = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.VERTICAL_ALIGN), spBCVAlign);
562                 if (sameBCHAlign) sameBCHAlign = setTagComboBox(isTheFirstElement, re.getPropertyValue(rre.HORIZONTAL_ALIGN), spBCHAlign);
563             }
564             else
565             {
566                 areAllBarcodeElements = false;
567             }
568             
569             if (areAllBreakElements && (re instanceof BreakReportElement))
570             {
571                 BreakReportElement rre = (BreakReportElement)re;
572                 if (sameBreakType) sameBreakType = setTagComboBox(isTheFirstElement, rre.getType(), spBreakType);
573                 
574             }
575             else
576             {
577                 areAllBreakElements = false;
578             }
579             
580             // ---- IMAGE ELEMENTS ----
581
if (areAllChartElements && re instanceof ChartReportElement2)
582             {
583                 ChartReportElement2 rre = (ChartReportElement2)re;
584                 if (sameChartEvaluationTime) sameChartEvaluationTime = setTagComboBox(isTheFirstElement, rre.getEvaluationTime(), spChartEvaluationTime);
585                 if (sameChartEvaluationGroup && sameChartEvaluationTime) sameChartEvaluationGroup = setTagComboBox(isTheFirstElement, rre.getEvaluationGroup(), spChartEvaluationGroup);
586                 }
587             else
588             {
589                 areAllChartElements = false;
590             }
591             
592             if (sameBand) sameBand = setComboBox(isTheFirstElement, (re.getBand() == null) ? (Object JavaDoc)re.getCell() : (Object JavaDoc)re.getBand(), (JComboBox JavaDoc)spBands.getEditor());
593             
594             isTheFirstElement = false;
595         }
596         
597         
598         spBands.setLabelColor( (sameBand) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
599         spTop.setLabelColor( (sameTop) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
600         spLeft.setLabelColor( (sameLeft) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
601         spHeight.setLabelColor( (sameHeight) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
602         spWidth.setLabelColor( (sameWidth) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
603         spFgColor.setLabelColor( (sameForeground) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
604         spBgColor.setLabelColor( (sameBackground) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
605         spMode.setLabelColor( (sameMode) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
606         spPrintRepeatedValues.setLabelColor( (samePrintRepeatedValues) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
607         spPrintWhenDetailOverflows.setLabelColor( (samePrintWhenDetailOverflows) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
608         spPrintInFirstWholeBand.setLabelColor( (samePrintInFirstWholeBand) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
609         spRemoveLineWhenBlank.setLabelColor( (sameRemoveLineWhenBlank) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
610         spPositionType.setLabelColor( (samePositionType) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
611         spGroups.setLabelColor( (samePrintWhenGroupChanges) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
612         spStretchType.setLabelColor( (sameStretchType) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
613         spStyle.setLabelColor( (sameStyle) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
614         spPrintWhenExpression.setLabelColor( (samePrintWhenExpression) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
615         spPen.setLabelColor( (samePen) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
616         spFill.setLabelColor( (sameFill) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
617         spRadius.setLabelColor( (sameRadius) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
618         spDirection.setLabelColor( (sameDirection) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
619         spBreakType.setLabelColor( (sameBreakType) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
620         spTextHAlign.setLabelColor( (sameHAlign) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
621         spTextVAlign.setLabelColor( (sameVAlign) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
622         spStyledText.setLabelColor( (sameStyledText) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
623         spLineSpacing.setLabelColor( (sameLineSpacing) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
624         spRotate.setLabelColor( (sameRotate) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
625         spBold.setLabelColor( (sameBold) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
626         spItalic.setLabelColor( (sameItalic) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
627         spUnderline.setLabelColor( (sameUnderline) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
628         spStriketrough.setLabelColor( (sameStrikethrough) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
629         spPdfEmbedded.setLabelColor( (samePdfEmbedded) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
630         spFontSize.setLabelColor( (sameFontSize) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
631         spFontName.setLabelColor( (sameFontName) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
632         spPdfFontName.setLabelColor( (samePDFFontName) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
633         spPdfEncoding.setLabelColor( (samePdfEncoding) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
634         spStaticText.setLabelColor( (sameText) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
635         spTextfieldExpression.setLabelColor( (sameTextfieldExpression) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
636         spTextfieldExpressionClass.setLabelColor( (sameTextfieldExpressionClass) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
637         spTextfieldEvaluationTime.setLabelColor( (sameTextfieldEvaluationTime) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
638         spTextfieldEvaluationGroup.setLabelColor( (sameTextfieldEvaluationGroup) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
639         spStretchWithOverflow.setLabelColor( (sameStrtchWithOverflow) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
640         spTextfieldBlankWhenNull.setLabelColor( (sameBlankWhenNull) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
641         spPattern.setLabelColor( (sameBlankWhenNull) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
642         
643         spImageExpression.setLabelColor( (sameImageExpression) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
644         spImageExpressionClass.setLabelColor( (sameImageExpressionClass) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
645         spImageEvaluationTime.setLabelColor( (sameImageEvaluationTime) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
646         spImageEvaluationGroup.setLabelColor( (sameImageEvaluationGroup) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
647         spImageLazy.setLabelColor( (sameImageLazy) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
648         spImageCache.setLabelColor( (sameImageCache) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
649         spImageScale.setLabelColor( (sameImageScale) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
650         spImageError.setLabelColor( (sameImageOnError) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
651         spImageVAlign.setLabelColor( (sameImageVAlign) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
652         spImageHAlign.setLabelColor( (sameImageHAlign) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
653         spBCType.setLabelColor( (sameBCType) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
654         spBCChecksum.setLabelColor( (sameBCChecksum) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
655         spBCShowText.setLabelColor( (sameBCShowText) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
656         spBCExpression.setLabelColor( (sameBCExpression) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
657         spBCBarWidth.setLabelColor( (sameBCBarWidth) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
658         spBCBarHeight.setLabelColor( (sameBCBarHeight) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
659         spBCApplicationIdentifier.setLabelColor( (sameBCApplicationIdentifier) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
660         spBCScale.setLabelColor( (sameBCScale) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
661         spBCError.setLabelColor( (sameBCError) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
662         spBCHAlign.setLabelColor( (sameBCHAlign) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
663         spBCVAlign.setLabelColor( (sameBCVAlign) ? notMandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
664         spBCEvaluationTime.setLabelColor( (sameBCEvaluationTime) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
665         spBCEvaluationGroup.setLabelColor( (sameBCEvaluationGroup) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
666         spChartEvaluationTime.setLabelColor( (sameChartEvaluationTime) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
667         spChartEvaluationGroup.setLabelColor( (sameChartEvaluationGroup) ? mandatoryPropertiesLabelColor : sharedDifferentValueLabelColor );
668
669         
670         ExpressionContext ec = new ExpressionContext();
671         if (jrf.getSelectedCrosstabEditorPanel() == null)
672         {
673             ec.setSubDataset( jrf.getReport() );
674         }
675         else
676         {
677             ec.addCrosstabReportElement( jrf.getSelectedCrosstabEditorPanel().getCrosstabElement());
678         }
679         spPrintWhenExpression.setExpressionContext( ec );
680         spTextfieldExpression.setExpressionContext( ec );
681         spImageExpression.setExpressionContext( ec );
682         spBCExpression.setExpressionContext( ec );
683         spBCApplicationIdentifier.setExpressionContext( ec );
684         
685         String JavaDoc commonStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.common","Common");
686         this.addSheetProperty(commonStr, spBands);
687         this.addSheetProperty(commonStr, spTop);
688         this.addSheetProperty(commonStr, spLeft);
689         this.addSheetProperty(commonStr, spHeight);
690         this.addSheetProperty(commonStr, spWidth);
691         this.addSheetProperty(commonStr, spFgColor);
692         this.addSheetProperty(commonStr, spBgColor);
693         this.addSheetProperty(commonStr, spMode);
694         
695         spPrintRepeatedValues.setDefaultValue( new Boolean JavaDoc(true));
696         
697         this.addSheetProperty(commonStr, spRemoveLineWhenBlank);
698         this.addSheetProperty(commonStr, spPrintInFirstWholeBand);
699         this.addSheetProperty(commonStr, spPrintWhenDetailOverflows);
700         this.addSheetProperty(commonStr, spPrintRepeatedValues);
701         this.addSheetProperty(commonStr, spPositionType);
702         this.addSheetProperty(commonStr, spGroups);
703         if (selectedElements.size() == 1)
704         {
705             this.addSheetProperty(commonStr, spElementKey);
706         }
707         this.addSheetProperty(commonStr, spStretchType);
708         this.addSheetProperty(commonStr, spStyle);
709         this.addSheetProperty(commonStr, spPrintWhenExpression);
710         
711         if (areAllGraphicsElements)
712         {
713             String JavaDoc graphicStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.graphic","Graphic");
714             this.addSheetProperty(graphicStr, spPen);
715             this.addSheetProperty(graphicStr, spFill);
716         }
717         
718         if (areAllRectangleElements)
719         {
720             String JavaDoc rectangleStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.rectangle","Rectangle");
721             this.addSheetProperty(rectangleStr, spRadius);
722         }
723         
724         if (areAllLineElements)
725         {
726             String JavaDoc lineStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.line","Line");
727             this.addSheetProperty(lineStr, spDirection);
728         }
729         
730         if (areAllBreakElements)
731         {
732             String JavaDoc breakStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.break","Break");
733             this.addSheetProperty(breakStr, spBreakType);
734         }
735         
736         
737         if (areAllTextElements)
738         {
739             String JavaDoc textStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.text","Text");
740             
741             this.addSheetProperty(textStr, spFontName);
742             this.addSheetProperty(textStr, spFontSize);
743             this.addSheetProperty(textStr, spBold);
744             this.addSheetProperty(textStr, spItalic);
745             this.addSheetProperty(textStr, spUnderline);
746             this.addSheetProperty(textStr, spStriketrough);
747             this.addSheetProperty(textStr, spPdfFontName);
748             this.addSheetProperty(textStr, spPdfEmbedded);
749             this.addSheetProperty(textStr, spPdfEncoding);
750             this.addSheetProperty(textStr, spTextHAlign);
751             this.addSheetProperty(textStr, spTextVAlign);
752             this.addSheetProperty(textStr, spLineSpacing);
753             this.addSheetProperty(textStr, spRotate);
754             this.addSheetProperty(textStr, spStyledText);
755                       
756         }
757         
758         if (areAllStaticTextElements)
759         {
760             String JavaDoc staticTextStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.staticText","Static text");
761             this.addSheetProperty(staticTextStr, spStaticText);
762         }
763         
764         if (areAllTextfieldElements)
765         {
766             String JavaDoc textFieldStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textField","Textfield");
767             this.addSheetProperty(textFieldStr, spTextfieldExpression);
768             this.addSheetProperty(textFieldStr, spTextfieldExpressionClass);
769             this.addSheetProperty(textFieldStr, spTextfieldEvaluationTime);
770             this.addSheetProperty(textFieldStr, spTextfieldEvaluationGroup);
771             this.addSheetProperty(textFieldStr, spStretchWithOverflow);
772             this.addSheetProperty(textFieldStr, spTextfieldBlankWhenNull);
773             this.addSheetProperty(textFieldStr, spPattern);
774             
775             if (!sameTextfieldEvaluationTime || !spTextfieldEvaluationTime.getValue().equals("Group"))
776             {
777                 spTextfieldEvaluationGroup.setReadOnly(true);
778             }
779             else
780             {
781                 spTextfieldEvaluationGroup.setReadOnly(false);
782             }
783         }
784         
785         if (areAllImageElements)
786         {
787             String JavaDoc imageStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.image","Image");
788             this.addSheetProperty(imageStr, spImageExpression);
789             this.addSheetProperty(imageStr, spImageExpressionClass);
790             this.addSheetProperty(imageStr, spImageEvaluationTime);
791             this.addSheetProperty(imageStr, spImageEvaluationGroup);
792             this.addSheetProperty(imageStr, spImageScale);
793             this.addSheetProperty(imageStr, spImageError);
794             this.addSheetProperty(imageStr, spImageVAlign);
795             this.addSheetProperty(imageStr, spImageHAlign);
796             this.addSheetProperty(imageStr, spImageLazy);
797             this.addSheetProperty(imageStr, spImageCache);
798             
799             if (!sameImageEvaluationTime || !spImageEvaluationTime.getValue().equals("Group"))
800             {
801                 spImageEvaluationGroup.setReadOnly(true);
802             }
803             else
804             {
805                 spImageEvaluationGroup.setReadOnly(false);
806             }
807         }
808         
809         if (areAllBarcodeElements)
810         {
811             String JavaDoc barcodeStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcode","Barcode");
812             this.addSheetProperty(barcodeStr, spBCType);
813             this.addSheetProperty(barcodeStr, spBCChecksum);
814             this.addSheetProperty(barcodeStr, spBCShowText);
815             this.addSheetProperty(barcodeStr, spBCExpression);
816             this.addSheetProperty(barcodeStr, spBCBarWidth);
817             this.addSheetProperty(barcodeStr, spBCBarHeight);
818             this.addSheetProperty(barcodeStr, spBCApplicationIdentifier);
819             this.addSheetProperty(barcodeStr, spBCScale);
820             this.addSheetProperty(barcodeStr, spBCError);
821             this.addSheetProperty(barcodeStr, spBCHAlign);
822             this.addSheetProperty(barcodeStr, spBCVAlign);
823             this.addSheetProperty(barcodeStr, spBCEvaluationTime);
824             this.addSheetProperty(barcodeStr, spBCEvaluationGroup);
825             
826             if (!sameBCEvaluationTime || !spBCEvaluationTime.getValue().equals("Group"))
827             {
828                 spBCEvaluationGroup.setReadOnly(true);
829             }
830             else
831             {
832                 spBCEvaluationGroup.setReadOnly(false);
833             }
834         }
835         
836         if (areAllChartElements)
837         {
838             String JavaDoc chartStr = it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.chart","Chart");
839             this.addSheetProperty(chartStr, spChartEvaluationTime);
840             this.addSheetProperty(chartStr, spChartEvaluationGroup);
841             
842             if (!sameChartEvaluationTime || !spChartEvaluationTime.getValue().equals("Group"))
843             {
844                 spChartEvaluationGroup.setReadOnly(true);
845             }
846             else
847             {
848                 spChartEvaluationGroup.setReadOnly(false);
849             }
850         }
851         
852         this.recreateSheet();
853
854         } catch (Exception JavaDoc ex)
855         {
856             ex.printStackTrace();
857         }
858         finally
859         {
860             
861         }
862         
863         setInit(false);
864      }
865      
866      
867      /*
868       * This method remove the first entry in comboboxes if the first entry
869       * is something like "<Different values>"....
870       *
871       */

872      public void removeNullItem(SheetProperty comboProperty)
873      {
874          if (comboProperty == null) return;
875           if (comboProperty.getEditor() instanceof JComboBox JavaDoc)
876           {
877              JComboBox JavaDoc combobox = (JComboBox JavaDoc)comboProperty.getEditor();
878              if (combobox.getSelectedIndex() > 0)
879              {
880                 Object JavaDoc obj = combobox.getItemAt(0);
881                 if ((obj+"").equals(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.differentValues","<different values>")))
882                 {
883                     combobox.removeItemAt(0);
884                 }
885              }
886           }
887      }
888      
889      /*
890       * This method says if the selected value is actually something like "<Different values>"....
891       *
892       */

893      public boolean isNullItem(SheetProperty comboProperty)
894      {
895          if (comboProperty == null) return false;
896           if (comboProperty.getEditor() instanceof JComboBox JavaDoc)
897           {
898              JComboBox JavaDoc combobox = (JComboBox JavaDoc)comboProperty.getEditor();
899              if (combobox.getSelectedIndex() == 0)
900              {
901                 Object JavaDoc obj = combobox.getItemAt(0);
902                 if ((obj+"").equals(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.differentValues","<different values>")))
903                 {
904                     return true;
905                 }
906              }
907           }
908          return false;
909      }
910      
911      
912      /**
913       * This methos is called when a property changes...
914       */

915      public void sheetPropertyValueChanged(SheetPropertyValueChangedEvent evt)
916      {
917          if (isInit()) return;
918          
919          
920          
921          //System.out.println("Changed: " + evt.getPropertyName());
922
if (isNullItem((SheetProperty)evt.getSource())) return;
923          
924          removeNullItem( (SheetProperty)evt.getSource() );
925          
926          Vector selectedElements = getElementSelection();
927          
928          for (int i=0; i<selectedElements.size(); ++i)
929          {
930              
931              ReportElement re = (ReportElement)selectedElements.elementAt(i);
932              applyNewProperty(re,evt.getPropertyName(), evt.getOldValue(), evt.getNewValue());
933          }
934          repaintEditor();
935          
936          ReportElementChangedEvent changedEvent = new ReportElementChangedEvent(jrf , selectedElements , ReportElementChangedEvent.CHANGED);
937          changedEvent.setEventSource( this );
938          if (evt.getPropertyName().equals("textfieldEvaluationTime"))
939          {
940             changedEvent.setPropertyChanged( evt.getPropertyName() );
941             changedEvent.setNewValue( evt.getNewValue() );
942          }
943          jrf.fireReportListenerReportElementsChanged(changedEvent);
944          MainFrame.getMainInstance().getElementPropertiesDialog().updateSelection();
945      }
946      
947      
948      /*
949       * This method apply the new value for the specified property
950       * The oldValue can be wrong or null if a multiselection was performed
951       */

952      private void applyNewProperty(ReportElement re, String JavaDoc propertyName, Object JavaDoc oldValue, Object JavaDoc newValue)
953      {
954          
955          
956          if (propertyName == null) return;
957          if (isInit()) return;
958          
959          if (propertyName.equals("band"))
960          {
961             if (newValue != null && newValue instanceof Band) re.setBand((Band)newValue);
962             else if (newValue != null && newValue instanceof CrosstabCell) re.setCell((CrosstabCell)newValue);
963          }
964          else if (propertyName.equals("top"))
965          {
966             if (newValue != null && !newValue.equals(""))
967             {
968                 int val = Integer.parseInt(""+newValue);
969                 int y_location = 0;
970                 // For each panel, search
971
if (re.getBand() != null) {
972                     y_location = this.jrf.getReport().getBandYLocation(re.getBand());
973                 }
974             
975                 if (re.getBand() == null && re.getCell() !=null)
976                 {
977                     y_location = re.getCell().getTop();
978                 }
979                 
980                 if (re.getParentElement() != null)
981                 {
982                     y_location = (int)(re.getParentElement().getPosition().getY())-10;
983                 }
984             
985                 //System.out.println("Imposto position a: " + (val - (re.getPosition().y - 10 - y_location) ));
986
re.trasform( new Point JavaDoc(0, val - (re.getPosition().y - 10 - y_location) ) , TransformationType.TRANSFORMATION_MOVE);
987             }
988          }
989          else if (propertyName.equals("left"))
990          {
991             if (newValue != null && !newValue.equals("") && !(re instanceof BreakReportElement))
992             {
993                 int val = Integer.parseInt(""+newValue);
994                 
995                 int normalization = 0;
996                 if (re.getParentElement() != null)
997                 {
998                     normalization = (int)(re.getParentElement().getPosition().getX()) - 10;
999                 }
1000                else if (re.getCell() != null)
1001                {
1002                    normalization = re.getCell().getLeft();
1003                }
1004                else
1005                {
1006                    normalization = jrf.getReport().getLeftMargin();
1007                }
1008                            
1009                re.trasform( new Point JavaDoc( val - (re.getPosition().x-10-normalization) ,0 ), TransformationType.TRANSFORMATION_MOVE);
1010            }
1011         }
1012         else if (propertyName.equals("width"))
1013         {
1014            if (newValue != null && !newValue.equals("") && !(re instanceof BreakReportElement))
1015            {
1016                int val = Integer.parseInt(""+newValue);
1017                re.trasform( new Point JavaDoc( val - re.getWidth(),0 ), TransformationType.TRANSFORMATION_RESIZE_E);
1018            }
1019         }
1020         else if (propertyName.equals("height"))
1021         {
1022            if (newValue != null && !newValue.equals("") && !(re instanceof BreakReportElement))
1023            {
1024                int val = Integer.parseInt(""+newValue);
1025                re.trasform( new Point JavaDoc(0, val- re.getHeight() ), TransformationType.TRANSFORMATION_RESIZE_S);
1026            }
1027         }
1028         else if (propertyName.equals("fgcolor"))
1029         {
1030            re.setPropertyValue( re.FGCOLOR, ColorSelectorPanel.parseColorString((String JavaDoc)newValue));
1031         }
1032         else if (propertyName.equals("bgcolor"))
1033         {
1034            re.setPropertyValue( re.BGCOLOR, ColorSelectorPanel.parseColorString((String JavaDoc)newValue));
1035         }
1036         else if (propertyName.equals("mode"))
1037         {
1038            if (newValue == null ) re.setPropertyValue( re.MODE, null);
1039            else
1040            {
1041                re.setPropertyValue( re.MODE, (newValue+"").equals("true") ? "Transparent" : "Opaque");
1042            }
1043         }
1044         else if (propertyName.equals("printRepeatedValues"))
1045         {
1046            if (newValue == null ) re.setPropertyValue( re.PRINT_REPEATED_VALUES, null);
1047            else
1048            {
1049                re.setPropertyValue( re.PRINT_REPEATED_VALUES, newValue+"" );
1050            }
1051         }
1052         else if (propertyName.equals("printWhenDetailOverflows"))
1053         {
1054            if (newValue == null ) re.setPropertyValue( re.PRINT_WHEN_DETAIL_OVERFLOW, null);
1055            else
1056            {
1057                re.setPropertyValue( re.PRINT_WHEN_DETAIL_OVERFLOW, newValue+"" );
1058            }
1059         }
1060         else if (propertyName.equals("printInFirstWholeBand"))
1061         {
1062            if (newValue == null ) re.setPropertyValue( re.PRINT_IN_FIRST_WHOLE_BAND, null);
1063            else
1064            {
1065                re.setPropertyValue( re.PRINT_IN_FIRST_WHOLE_BAND, newValue+"" );
1066            }
1067         }
1068         else if (propertyName.equals("removeLineWhenBlank"))
1069         {
1070            if (newValue == null ) re.setPropertyValue( re.REMOVE_LINE_WHEN_BLANK, null);
1071            else
1072            {
1073                re.setPropertyValue( re.REMOVE_LINE_WHEN_BLANK, newValue+"" );
1074            }
1075         }
1076         else if (propertyName.equals("positionType"))
1077         {
1078            if (newValue == null ) re.setPropertyValue( re.POSITION_TYPE, null);
1079            else
1080            {
1081                re.setPropertyValue( re.POSITION_TYPE, newValue+"" );
1082            }
1083         }
1084         else if (propertyName.equals("printWhenGroupChanges"))
1085         {
1086            if (newValue != null)
1087            {
1088                re.setPrintWhenGroupChanges(""+newValue);
1089            }
1090         }
1091         else if (propertyName.equals("stretchType"))
1092         {
1093            if (newValue != null)
1094            {
1095                re.setStretchType(""+newValue);
1096            }
1097         }
1098         else if (propertyName.equals("style"))
1099         {
1100            if ((newValue+"").equals("")) newValue = null;
1101            re.setStyle( (Style)newValue );
1102         }
1103         else if (propertyName.equals("printWhenExpression"))
1104         {
1105            if (newValue != null)
1106            {
1107                re.setPrintWhenExpression( ""+newValue );
1108            }
1109         }
1110         else if (propertyName.equals("pen"))
1111         {
1112            if ((newValue+"").equals("")) newValue = null;
1113            re.setPropertyValue( GraphicReportElement.PEN, newValue );
1114         }
1115         else if (propertyName.equals("fill"))
1116         {
1117            if ((newValue+"").equals("")) newValue = null;
1118            re.setPropertyValue( GraphicReportElement.FILL, newValue );
1119         }
1120         else if (propertyName.equals("radius"))
1121         {
1122            if (newValue != null)
1123            {
1124                try {
1125                    
1126                   newValue = ""+(int)Double.parseDouble(""+ newValue);
1127                } catch (Exception JavaDoc ex)
1128                {
1129                    newValue = null;
1130                }
1131            }
1132            re.setPropertyValue( RectangleReportElement.RADIUS, newValue );
1133         }
1134         else if (propertyName.equals("direction"))
1135         {
1136            if (newValue != null)
1137            {
1138                ((LineReportElement)re).setDirection(""+newValue );
1139            }
1140         }
1141         else if (propertyName.equals("hAlign"))
1142         {
1143            re.setPropertyValue( ((TextReportElement)re).ALIGN, newValue );
1144         }
1145         else if (propertyName.equals("vAlign"))
1146         {
1147           re.setPropertyValue( ((TextReportElement)re).VERTICAL_ALIGN, newValue );
1148         }
1149         else if (propertyName.equals("styledText"))
1150         {
1151             if (newValue == null) re.setPropertyValue( ((TextReportElement)re).IS_STYLED_TEXT, null );
1152             else re.setPropertyValue( ((TextReportElement)re).IS_STYLED_TEXT, newValue+"" );
1153         }
1154         else if (propertyName.equals("lineSpacing"))
1155         {
1156           re.setPropertyValue( ((TextReportElement)re).LINE_SPACING, newValue );
1157         }
1158         else if (propertyName.equals("rotate"))
1159         {
1160           re.setPropertyValue( ((TextReportElement)re).ROTATE, newValue );
1161         }
1162         else if (propertyName.equals("bold"))
1163         {
1164             ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.IS_BOLD, (newValue == null) ? null : ""+newValue);
1165         }
1166         else if (propertyName.equals("italic"))
1167         {
1168             ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.IS_ITALIC, (newValue == null) ? null : ""+newValue);
1169         }
1170         else if (propertyName.equals("underline"))
1171         {
1172             ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.IS_UNDERLINE, (newValue == null) ? null : ""+newValue);
1173         }
1174         else if (propertyName.equals("strikethrough"))
1175         {
1176             ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.IS_STRIKETROUGHT, (newValue == null) ? null : ""+newValue);
1177         }
1178         else if (propertyName.equals("pdfEmbedded"))
1179         {
1180             ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.IS_PDF_EMBEDDED, (newValue == null) ? null : ""+newValue);
1181         }
1182         else if (propertyName.equals("fontSize"))
1183         {
1184             try {
1185                 if (newValue == null || Integer.parseInt(""+newValue) != ((TextReportElement)re).getFontSize())
1186                 {
1187                    ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.FONT_SIZE, (newValue == null) ? null : ""+newValue);
1188                 }
1189             } catch (Exception JavaDoc ex) {}
1190         }
1191         else if (propertyName.equals("fontName"))
1192         {
1193             ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.FONT_NAME, (newValue == null) ? null : ""+newValue);
1194         }
1195         else if (propertyName.equals("pdfFontName"))
1196         {
1197            ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.PDF_FONT_NAME, (newValue == null) ? null : ""+newValue);
1198         }
1199         else if (propertyName.equals("pdfEncoding"))
1200         {
1201            ((TextReportElement)re).getIReportFont().setPropertyValue( IReportFont.PDF_ENCODING, (newValue == null) ? null : ""+newValue);
1202         }
1203         else if (propertyName.equals("text"))
1204         {
1205             ((TextReportElement)re).setText( (newValue == null) ? "" : ""+newValue);
1206         }
1207         else if (propertyName.equals("textfieldExpression"))
1208         {
1209             ((TextReportElement)re).setText( (newValue == null) ? "" : ""+newValue);
1210         }
1211         else if (propertyName.equals("textfieldExpressionClass"))
1212         {
1213             ((TextFieldReportElement)re).setClassExpression( (newValue == null) ? "" : ""+newValue);
1214         }
1215         else if (propertyName.equals("textfieldEvaluationTime"))
1216         {
1217             ((TextFieldReportElement)re).setEvaluationTime( (newValue == null) ? "" : ""+newValue);
1218             if (newValue != null && newValue.equals("Group"))
1219             {
1220                spTextfieldEvaluationGroup.setReadOnly(false);
1221                ((TextFieldReportElement)re).setGroup(spTextfieldEvaluationGroup.getValue() +"");
1222             }
1223             else
1224             {
1225                 spTextfieldEvaluationGroup.setReadOnly(true);
1226                 ((TextFieldReportElement)re).setGroup("");
1227             }
1228             spTextfieldEvaluationGroup.updateLabel();
1229         }
1230         else if (propertyName.equals("textfieldEvaluationGroup"))
1231         {
1232             ((TextFieldReportElement)re).setGroup( (newValue == null) ? "" : ""+newValue);
1233         }
1234         else if (propertyName.equals("blankWhenNull"))
1235         {
1236             try {
1237             ((TextFieldReportElement)re).setBlankWhenNull( Boolean.valueOf( newValue+"").booleanValue() );
1238            } catch (Exception JavaDoc ex) {}
1239         }
1240         else if (propertyName.equals("stretchWithOverflow"))
1241         {
1242             try {
1243             ((TextFieldReportElement)re).setStretchWithOverflow( Boolean.valueOf( newValue+"").booleanValue() );
1244            } catch (Exception JavaDoc ex) {}
1245         }
1246         else if (propertyName.equals("pattern"))
1247         {
1248             if ((newValue+"").equals("")) newValue = null;
1249             re.setPropertyValue(TextFieldReportElement.PATTERN, newValue);
1250         }
1251         else if (propertyName.equals("imageExpression"))
1252         {
1253             ((ImageReportElement)re).setImageExpression( (newValue == null) ? "" : ""+newValue);
1254         }
1255         else if (propertyName.equals("imageExpressionClass"))
1256         {
1257             ((ImageReportElement)re).setImageClass( (newValue == null) ? "" : ""+newValue);
1258         }
1259         else if (propertyName.equals("imageEvaluationTime"))
1260         {
1261             ((ImageReportElement)re).setEvaluationTime( (newValue == null) ? "" : ""+newValue);
1262             if (newValue != null && newValue.equals("Group"))
1263             {
1264                spImageEvaluationGroup.setReadOnly(false);
1265                ((ImageReportElement)re).setEvaluationGroup(spImageEvaluationGroup.getValue() +"");
1266             }
1267             else
1268             {
1269                 spImageEvaluationGroup.setReadOnly(true);
1270                 ((ImageReportElement)re).setEvaluationGroup("");
1271             }
1272             spImageEvaluationGroup.updateLabel();
1273         }
1274         else if (propertyName.equals("imageEvaluationGroup"))
1275         {
1276             ((ImageReportElement)re).setEvaluationGroup( (newValue == null) ? "" : ""+newValue);
1277         }
1278         else if (propertyName.equals("imageLazy"))
1279         {
1280             try {
1281             ((ImageReportElement)re).setIsLazy( Boolean.valueOf( newValue+"").booleanValue() );
1282            } catch (Exception JavaDoc ex) {}
1283         }
1284         else if (propertyName.equals("imageCache"))
1285         {
1286             re.setPropertyValue(ImageReportElement.USING_CACHE, newValue);
1287         }
1288         else if (propertyName.equals("imageScale"))
1289         {
1290            re.setPropertyValue(ImageReportElement.SCALE, newValue);
1291         }
1292         else if (propertyName.equals("imageError"))
1293         {
1294             ((ImageReportElement)re).setOnErrorType( ""+ newValue );
1295         }
1296         else if (propertyName.equals("imageVAlign"))
1297         {
1298            re.setPropertyValue(ImageReportElement.VERTICAL_ALIGN, newValue);
1299         }
1300         else if (propertyName.equals("imageHAlign"))
1301         {
1302            re.setPropertyValue(ImageReportElement.HORIZONTAL_ALIGN, newValue);
1303         }
1304         else if (propertyName.equals("barcodeType"))
1305         {
1306             System.out.println("Setting barcode type to" + newValue);
1307            ((BarcodeReportElement)re).setType( Integer.parseInt( (newValue == null) ? "13" : ""+newValue));
1308            ((BarcodeReportElement)re).update();
1309            
1310         }
1311         else if (propertyName.equals("barcodeBarWidth"))
1312         {
1313            ((BarcodeReportElement)re).setImageWidth( Integer.parseInt( (newValue == null) ? "1" : ""+newValue));
1314            
1315         }
1316         else if (propertyName.equals("barcodeBarHeight"))
1317         {
1318            ((BarcodeReportElement)re).setImageHeight( Integer.parseInt( (newValue == null) ? "1" : ""+newValue));
1319            
1320         }
1321         else if (propertyName.equals("barcodeExpression"))
1322         {
1323             ((BarcodeReportElement)re).setText( (newValue == null) ? "" : ""+newValue);
1324         }
1325         else if (propertyName.equals("barcodeAppIdentifierExpression"))
1326         {
1327             ((BarcodeReportElement)re).setApplicationIdentifier( (newValue == null) ? "" : ""+newValue);
1328         }
1329         else if (propertyName.equals("barcodeEvaluationTime"))
1330         {
1331             ((ImageReportElement)re).setEvaluationTime( (newValue == null) ? "" : ""+newValue);
1332             if (newValue != null && newValue.equals("Group"))
1333             {
1334                spBCEvaluationGroup.setReadOnly(false);
1335                ((ImageReportElement)re).setEvaluationGroup(spBCEvaluationGroup.getValue() +"");
1336             }
1337             else
1338             {
1339                 spBCEvaluationGroup.setReadOnly(true);
1340                 ((ImageReportElement)re).setEvaluationGroup("");
1341             }
1342             spBCEvaluationGroup.updateLabel();
1343         }
1344         else if (propertyName.equals("barcodeEvaluationGroup"))
1345         {
1346             ((ImageReportElement)re).setEvaluationGroup( (newValue == null) ? "" : ""+newValue);
1347         }
1348         else if (propertyName.equals("barcodeShowText"))
1349         {
1350             try {
1351             ((BarcodeReportElement)re).setShowText( Boolean.valueOf( newValue+"").booleanValue() );
1352            } catch (Exception JavaDoc ex) {}
1353         }
1354         else if (propertyName.equals("barcodeChecksum"))
1355         {
1356             try {
1357             ((BarcodeReportElement)re).setCheckSum( Boolean.valueOf( newValue+"").booleanValue() );
1358            } catch (Exception JavaDoc ex) {}
1359         }
1360         else if (propertyName.equals("barcodeScale"))
1361         {
1362            re.setPropertyValue(ImageReportElement.SCALE, newValue);
1363         }
1364         else if (propertyName.equals("barcodeError"))
1365         {
1366             ((ImageReportElement)re).setOnErrorType( ""+ newValue );
1367         }
1368         else if (propertyName.equals("barcodeVAlign"))
1369         {
1370            re.setPropertyValue(ImageReportElement.VERTICAL_ALIGN, newValue);
1371         }
1372         else if (propertyName.equals("barcodeHAlign"))
1373         {
1374            re.setPropertyValue(ImageReportElement.HORIZONTAL_ALIGN, newValue);
1375         }
1376         else if (propertyName.equals("chartEvaluationTime"))
1377         {
1378             ((ChartReportElement2)re).setEvaluationTime( (newValue == null) ? "" : ""+newValue);
1379             if (newValue != null && newValue.equals("Group"))
1380             {
1381                spChartEvaluationGroup.setReadOnly(false);
1382                ((ChartReportElement2)re).setEvaluationGroup(spChartEvaluationGroup.getValue() +"");
1383             }
1384             else
1385             {
1386                 spChartEvaluationGroup.setReadOnly(true);
1387                 ((ChartReportElement2)re).setEvaluationGroup("");
1388             }
1389             spChartEvaluationGroup.updateLabel();
1390         }
1391         else if (propertyName.equals("chartEvaluationGroup"))
1392         {
1393             ((ChartReportElement2)re).setEvaluationGroup( (newValue == null) ? "" : ""+newValue);
1394         }
1395     }
1396     
1397     /**
1398      * This method is called when a new element is selected,
1399      * or deselected.
1400      */

1401     public void reportElementsSelectionChanged(ReportElementsSelectionEvent evt){
1402         updateSelection();
1403     }
1404   
1405     /*
1406      * This method is called when an element is removed, changed or added.
1407      */

1408      public void reportElementsChanged(ReportElementChangedEvent evt){
1409        
1410          if (evt.getEventSource() == null || evt.getEventSource() != this)
1411          {
1412              if (evt.getType() == evt.CHANGED && evt.getPropertyChanged() != null &&
1413                  !evt.getPropertyChanged().equals("textfieldEvaluationTime"))
1414              {
1415                    setPropertyValue(evt.getPropertyChanged(), evt.getNewValue());
1416              }
1417              else
1418              {
1419                  updateSelection();
1420              }
1421          }
1422      }
1423      
1424     /*
1425      * This method is called when a band is removed, changed or added.
1426      */

1427     public void reportBandChanged(ReportBandChangedEvent evt ) {
1428         updateSelection();
1429     }
1430     
1431     protected void initSheetProperties()
1432     {
1433        spBands = new ComboBoxSheetProperty("band",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.band","Band"));
1434        spBands.setShowResetButton(false);
1435        
1436        spLeft = new SheetProperty("left",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.left","Left"), SheetProperty.INTEGER);
1437        spLeft.setShowResetButton(false);
1438        
1439        spTop = new SheetProperty("top",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.top","Top"), SheetProperty.INTEGER);
1440        spTop.setShowResetButton(false);
1441        
1442        spWidth = new SheetProperty("width",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.width","Width"), SheetProperty.INTEGER);
1443        spWidth.setShowResetButton(false);
1444        
1445        spHeight = new SheetProperty("height",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.height","Height"), SheetProperty.INTEGER);
1446        spHeight.setShowResetButton(false);
1447        
1448        spFgColor = new SheetProperty("fgcolor",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.fgcolor","Foreground"), SheetProperty.COLOR);
1449        spBgColor = new SheetProperty("bgcolor",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.bgcolor","Background"), SheetProperty.COLOR);
1450        spMode = new SheetProperty("mode",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.mode","Transparent"), SheetProperty.BOOLEAN);
1451        spPrintRepeatedValues = new SheetProperty("printRepeatedValues",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.printRepeatedValues","Print repeated values"), SheetProperty.BOOLEAN);
1452        spPrintRepeatedValues.setShowResetButton(false);
1453        spPrintWhenDetailOverflows = new SheetProperty("printWhenDetailOverflows",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.printWhenDetailOverflows","Print when detail overflows"), SheetProperty.BOOLEAN);
1454        spPrintWhenDetailOverflows.setShowResetButton(false);
1455        spPrintInFirstWholeBand = new SheetProperty("printInFirstWholeBand",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.printInFirstWholeBand","Print in first whole band"), SheetProperty.BOOLEAN);
1456        spPrintInFirstWholeBand.setShowResetButton(false);
1457        spRemoveLineWhenBlank = new SheetProperty("removeLineWhenBlank",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.removeLineWhenBlank","Remove line when blank"), SheetProperty.BOOLEAN);
1458        spRemoveLineWhenBlank.setShowResetButton(false);
1459        
1460        
1461        spPositionType = new SheetProperty("positionType",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.positionType","Position type"), SheetProperty.COMBOBOX);
1462        spPositionType.setTags( new Tag[]{ new Tag("FixRelativeToTop",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.positionType.FixRelativeToTop","Fix relative to top")),
1463                                           new Tag("Float",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.positionType.Float","Float")),
1464                                           new Tag("FixRelativeToBottom",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.positionType.FixRelativeToBottom","Fix relative to bottom"))});
1465        spPositionType.setDefaultValue("FixRelativeToTop");
1466        spPositionType.setShowResetButton(false);
1467                                           
1468                                           
1469        spGroups = new ComboBoxSheetProperty("printWhenGroupChanges",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.printWhenGroupChanges","Print when group changes"));
1470        spGroups.setShowResetButton(false);
1471        spElementKey = new SheetProperty("elementKey",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.elementKey","Element key"), SheetProperty.STRING);
1472        spElementKey.setShowResetButton(false);
1473        
1474        spStretchType = new SheetProperty("stretchType",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.stretchType","Stretch type"), SheetProperty.COMBOBOX);
1475        spStretchType.setTags( new Tag[]{ new Tag("NoStretch",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.stretchType.NoStretch","Fix relative to top")),
1476                                           new Tag("RelativeToTallestObject",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.stretchType.RelativeToTallestObject","Float")),
1477                                           new Tag("RelativeToBandHeight",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.stretchType.RelativeToBandHeight","Fix relative to bottom"))});
1478        spStretchType.setDefaultValue("NoStretch");
1479        spStretchType.setShowResetButton(false);
1480        
1481        spStyle = new ComboBoxSheetProperty("style",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.style","Style"));
1482        spStyle.setShowResetButton(false);
1483        spStyle.setDefaultValue("");
1484        
1485        spPrintWhenExpression = new ExpressionSheetProperty("printWhenExpression",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.printWhenExpression","Print When Expression"));
1486        spPrintWhenExpression.setShowResetButton(false);
1487
1488        spPen = new SheetProperty("pen",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pen","Pen"), SheetProperty.COMBOBOX);
1489        spPen.setTags( new Tag[]{ new Tag("",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.default","Default")),
1490                                          new Tag("None",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pen.None","None")),
1491                                          new Tag("Thin",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pen.Thin","Thin")),
1492                                          new Tag("1Point",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pen.1Point","1Point")),
1493                                          new Tag("2Point",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pen.2Point","2Point")),
1494                                          new Tag("4Point",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pen.4Point","4Point")),
1495                                          new Tag("Dotted",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pen.Dotted","Dotted"))});
1496        spPen.setDefaultValue("");
1497        
1498        spFill = new SheetProperty("fill",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.fill","Fill"), SheetProperty.COMBOBOX);
1499        spFill.setTags( new Tag[]{ new Tag("",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.default","Default")),
1500                                          new Tag("Solid",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.fill.Solid","Solid"))});
1501        spFill.setDefaultValue("");
1502        
1503        spRadius = new SheetProperty("radius",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.radius","Radius"), SheetProperty.NUMBER);
1504        try {
1505        ((JNumberField)(spRadius.getEditor())).setDecimals(0);
1506        } catch (Exception JavaDoc ex) {};
1507        
1508        spDirection = new SheetProperty("direction",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.direction","Direction"), SheetProperty.COMBOBOX);
1509        spDirection.setTags( new Tag[]{ new Tag("TopDown",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.direction.TopDown","Top-down (\\)")),
1510                                          new Tag("BottomUp",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.direction.BottomUp","Bottom-up (/)"))});
1511        spDirection.setShowResetButton(false);
1512        
1513        
1514        spBreakType = new SheetProperty("breakType",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.breakType","Type"), SheetProperty.COMBOBOX);
1515        spBreakType.setTags( new Tag[]{ new Tag("Page",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.breakType.page","Page")),
1516                                          new Tag("Column",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.breakType.column","Column"))});
1517        spBreakType.setShowResetButton(false);
1518        
1519        spTextHAlign = new SheetProperty("hAlign",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign","Align"), SheetProperty.COMBOBOX);
1520        spTextHAlign.setTags( new Tag[]{ new Tag("Left",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Left","Left")),
1521                                          new Tag("Center",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Center","Center")),
1522                                          new Tag("Right",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Right","Right")),
1523                                          new Tag("Justified",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Justified","Justified"))});
1524        spTextHAlign.setDefaultValue("Left");
1525        
1526        spTextVAlign = new SheetProperty("vAlign",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign","Vertical align"), SheetProperty.COMBOBOX);
1527        spTextVAlign.setTags( new Tag[]{ new Tag("Top",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Top","Top")),
1528                                          new Tag("Middle",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Middle","Middle")),
1529                                          new Tag("Bottom",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Bottom","Bottom"))});
1530        spTextVAlign.setDefaultValue("Top");
1531        
1532        spStyledText = new SheetProperty("styledText",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.styledText","Styled text"), SheetProperty.BOOLEAN);
1533        
1534        spLineSpacing = new SheetProperty("lineSpacing",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.lineSpacing","Line spacing"), SheetProperty.COMBOBOX);
1535        spLineSpacing.setTags( new Tag[]{ new Tag("Single",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.lineSpacing.Single","Single")),
1536                                          new Tag("1_1_2",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.lineSpacing.1_1_2","1_1_2")),
1537                                          new Tag("Double",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.lineSpacing.Double","Double"))});
1538        spLineSpacing.setDefaultValue("Single");
1539                                          
1540        spRotate = new SheetProperty("rotate",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.rotate","Ratation"), SheetProperty.COMBOBOX);
1541        spRotate.setTags( new Tag[]{ new Tag("None",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.rotate.None","None")),
1542                                          new Tag("Left",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.rotate.Left","Left")),
1543                                          new Tag("Right",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.rotate.Right","Right")),
1544                                          new Tag("UpsideDown",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.rotate.UpsideDown","Upside down")) });
1545        spRotate.setDefaultValue("None");
1546        
1547        spFontName = new SheetProperty("fontName",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.fontName","Font"), SheetProperty.COMBOBOX);
1548        Vector fontsVec = new Vector();
1549        String JavaDoc[] fontFamilies = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
1550        for (int i=0; i<fontFamilies.length; ++i) {
1551            fontsVec.add( new Tag(fontFamilies[i]));
1552        }
1553        spFontName.setTags( fontsVec );
1554        spFontName.setDefaultValue("SansSerif");
1555        
1556        
1557        spFontSize = new NumberComboBoxSheetProperty("fontSize",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.fontSize","Font size"));
1558        spFontSize.addEntry("3",3);
1559        spFontSize.addEntry("5",5);
1560        spFontSize.addEntry("8",8);
1561        spFontSize.addEntry("10",10);
1562        spFontSize.addEntry("12",12);
1563        spFontSize.addEntry("14",14);
1564        spFontSize.addEntry("18",18);
1565        spFontSize.addEntry("24",24);
1566        spFontSize.addEntry("36",36);
1567        spFontSize.addEntry("48",48);
1568
1569        //spPdfFontName;
1570
spPdfFontName = new SheetProperty("pdfFontName",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pdfFontName","PDF Font"), SheetProperty.COMBOBOX);
1571        fontsVec = new Vector();
1572        fontsVec.addElement(new Tag("Helvetica"));
1573        fontsVec.addElement(new Tag("Helvetica-Bold"));
1574        fontsVec.addElement(new Tag("Helvetica-BoldOblique"));
1575        fontsVec.addElement(new Tag("Helvetica-Oblique"));
1576        fontsVec.addElement(new Tag("Courier"));
1577        fontsVec.addElement(new Tag("Courier-Bold"));
1578        fontsVec.addElement(new Tag("Courier-BoldOblique"));
1579        fontsVec.addElement(new Tag("Courier-Oblique"));
1580        fontsVec.addElement(new Tag("Symbol"));
1581        fontsVec.addElement(new Tag("Times-Roman"));
1582        fontsVec.addElement(new Tag("Times-Bold"));
1583        fontsVec.addElement(new Tag("Times-BoldItalic"));
1584        fontsVec.addElement(new Tag("Times-Italic"));
1585        fontsVec.addElement(new Tag("ZapfDingbats"));
1586        fontsVec.addElement(new Tag("STSong-Light"));
1587        fontsVec.addElement(new Tag("MHei-Medium"));
1588        fontsVec.addElement(new Tag("MSung-Light"));
1589        fontsVec.addElement(new Tag("HeiseiKakuGo-W5"));
1590        fontsVec.addElement(new Tag("HeiseiMin-W3"));
1591        fontsVec.addElement(new Tag("HYGoThic-Medium"));
1592        fontsVec.addElement(new Tag("HYSMyeongJo-Medium"));
1593        Vector iRfonts = MainFrame.getMainInstance().getTtfFonts();
1594        for (int i_f=0; i_f<iRfonts.size(); ++i_f)
1595        {
1596            fontsVec.addElement(new Tag( ((IRFont)iRfonts.elementAt(i_f)).getFile(),
1597                                   iRfonts.elementAt(i_f)+""));
1598        }
1599        
1600        spPdfFontName.setTags( fontsVec );
1601        spPdfFontName.setDefaultValue("Helvetica");
1602        ((JComboBox JavaDoc)(spPdfFontName.getEditor())).setEditable(true);
1603        
1604        
1605        spBold = new SheetProperty("bold",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.Bold","Bold"), SheetProperty.BOOLEAN);
1606        spItalic = new SheetProperty("italic",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.Italic","Italic"), SheetProperty.BOOLEAN);
1607        spUnderline = new SheetProperty("underline",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.Underline","Underline"), SheetProperty.BOOLEAN);
1608        spStriketrough = new SheetProperty("strikethrough",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.Strikethrough","Strike through"), SheetProperty.BOOLEAN);
1609        spPdfEmbedded = new SheetProperty("pdfEmbedded",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.PdfEmbedded","PDF embedded"), SheetProperty.BOOLEAN);
1610        //spPdfEncoding;
1611

1612        
1613        spPdfEncoding = new SheetProperty("pdfEncoding",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.pdfEncoding","PDF Encoding"), SheetProperty.COMBOBOX);
1614        fontsVec = new Vector();
1615        fontsVec.addElement(new Tag("Cp1250","CP1250 (Central European)"));
1616        fontsVec.addElement(new Tag("Cp1251","CP1251 (Cyrillic)"));
1617        fontsVec.addElement(new Tag("Cp1252","CP1252 (Western European ANSI aka WinAnsi)"));
1618        fontsVec.addElement(new Tag("Cp1253","CP1253 (Greek)"));
1619        fontsVec.addElement(new Tag("Cp1254","CP1254 (Turkish)"));
1620        fontsVec.addElement(new Tag("Cp1255","CP1255 (Hebrew)"));
1621        fontsVec.addElement(new Tag("Cp1256","CP1256 (Arabic)"));
1622        fontsVec.addElement(new Tag("Cp1257","CP1257 (Baltic)"));
1623        fontsVec.addElement(new Tag("Cp1258","CP1258 (Vietnamese)"));
1624        fontsVec.addElement(new Tag("UniGB-UCS2-H","UniGB-UCS2-H (Chinese Simplified)"));
1625        fontsVec.addElement(new Tag("UniGB-UCS2-V","UniGB-UCS2-V (Chinese Simplified)"));
1626        fontsVec.addElement(new Tag("UniCNS-UCS2-H","UniCNS-UCS2-H (Chinese traditional)"));
1627        fontsVec.addElement(new Tag("UniCNS-UCS2-V","UniCNS-UCS2-V (Chinese traditional)"));
1628        fontsVec.addElement(new Tag("UniJIS-UCS2-H","UniJIS-UCS2-H (Japanese)"));
1629        fontsVec.addElement(new Tag("UniJIS-UCS2-V","UniJIS-UCS2-V (Japanese)"));
1630        fontsVec.addElement(new Tag("UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-H (Japanese)"));
1631        fontsVec.addElement(new Tag("UniJIS-UCS2-HW-V","UniJIS-UCS2-HW-V (Japanese)"));
1632        fontsVec.addElement(new Tag("UniKS-UCS2-H","UniKS-UCS2-H (Korean)"));
1633        fontsVec.addElement(new Tag("UniKS-UCS2-V","UniKS-UCS2-V (Korean)"));
1634        fontsVec.addElement(new Tag("Identity-H","Identity-H (Unicode with horizontal writing)"));
1635        fontsVec.addElement(new Tag("Identity-V","Identity-V (Unicode with vertical writing)"));
1636
1637        spPdfEncoding.setTags( fontsVec );
1638        ((JComboBox JavaDoc)spPdfEncoding.getEditor()).setEditable(true);
1639        spPdfEncoding.setDefaultValue("Cp1250");
1640        
1641        spStaticText = new ExpressionSheetProperty("text",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.text","Text"));
1642        spStaticText.setPlainTextEditor(true);
1643        spStaticText.setShowResetButton(false);
1644        spTextfieldExpression = new ExpressionSheetProperty("textfieldExpression",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldExpression","Expression"));
1645        spTextfieldExpression.setShowResetButton(false);
1646        spTextfieldExpressionClass= new SheetProperty("textfieldExpressionClass",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldExpressionClass","Exp. class"), SheetProperty.COMBOBOX);
1647        fontsVec = new Vector();
1648        fontsVec.addElement(new Tag("java.lang.Boolean"));
1649        fontsVec.addElement(new Tag("java.lang.Byte"));
1650        fontsVec.addElement(new Tag("java.util.Date"));
1651        fontsVec.addElement(new Tag("java.sql.Timestamp"));
1652        fontsVec.addElement(new Tag("java.sql.Time"));
1653        fontsVec.addElement(new Tag("java.lang.Double"));
1654        fontsVec.addElement(new Tag("java.lang.Float"));
1655        fontsVec.addElement(new Tag("java.lang.Integer"));
1656        fontsVec.addElement(new Tag("java.lang.Long"));
1657        fontsVec.addElement(new Tag("java.lang.Short"));
1658        fontsVec.addElement(new Tag("java.math.BigDecimal"));
1659        fontsVec.addElement(new Tag("java.lang.String"));
1660        fontsVec.addElement(new Tag("java.lang.Number"));
1661        spTextfieldExpressionClass.setTags(fontsVec);
1662        spTextfieldExpressionClass.setDefaultValue("java.lang.String");
1663        spTextfieldExpressionClass.setShowResetButton(false);
1664        
1665        spTextfieldEvaluationTime = new SheetProperty("textfieldEvaluationTime",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime","Eval. time"), SheetProperty.COMBOBOX);
1666        // Text field Evaluation Time...
1667
fontsVec = new Vector();
1668        fontsVec.addElement(new Tag("Now",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Now","Now")));
1669        fontsVec.addElement(new Tag("Report",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Report","Report")));
1670        fontsVec.addElement(new Tag("Page",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Page","Page")));
1671        fontsVec.addElement(new Tag("Column",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Column","Column")));
1672        fontsVec.addElement(new Tag("Group",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Group","Group")));
1673        fontsVec.addElement(new Tag("Band",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Band","Bans")));
1674        fontsVec.addElement(new Tag("Auto",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Auto","Auto")));
1675        spTextfieldEvaluationTime.setTags(fontsVec);
1676        spTextfieldEvaluationTime.setDefaultValue("Now");
1677        spTextfieldEvaluationTime.setShowResetButton(false);
1678        
1679        spTextfieldEvaluationGroup = new ComboBoxSheetProperty("textfieldEvaluationGroup",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationGroup","Eval. group"));
1680        spTextfieldEvaluationGroup.setShowResetButton(false);
1681        
1682        spStretchWithOverflow = new SheetProperty("stretchWithOverflow",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.stretchWithOverflow","Stretch with overflow"), SheetProperty.BOOLEAN);
1683        spStretchWithOverflow.setShowResetButton(false);
1684        spTextfieldBlankWhenNull = new SheetProperty("blankWhenNull",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.blankWehnNull","Blank when null"), SheetProperty.BOOLEAN);
1685        spTextfieldBlankWhenNull.setShowResetButton(false);
1686        spPattern = new PatternSheetProperty("pattern",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.Pattern","Pattern"));
1687        spPattern.setDefaultValue("");
1688        
1689        spImageExpression = new ExpressionSheetProperty("imageExpression",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageExpression","Image expression"));
1690        spImageExpression.setShowResetButton(false);
1691        spImageExpressionClass= new SheetProperty("imageExpressionClass",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldExpressionClass","Exp. class"), SheetProperty.COMBOBOX);
1692        fontsVec = new Vector();
1693        fontsVec.addElement(new Tag("java.lang.String"));
1694        fontsVec.addElement(new Tag("java.io.File"));
1695        fontsVec.addElement(new Tag("java.net.URL"));
1696        fontsVec.addElement(new Tag("java.io.InputStream"));
1697        fontsVec.addElement(new Tag("java.awt.Image"));
1698        fontsVec.addElement(new Tag("net.sf.jasperreports.engine.JRRenderable"));
1699        spImageExpressionClass.setTags(fontsVec);
1700        //spImageExpressionClass.setDefaultValue("java.lang.String");
1701
spImageExpressionClass.setShowResetButton(false);
1702        
1703        spImageEvaluationTime = new SheetProperty("imageEvaluationTime",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime","Eval. time"), SheetProperty.COMBOBOX);
1704        // Text field Evaluation Time...
1705
fontsVec = new Vector();
1706        fontsVec.addElement(new Tag("Now",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Now","Now")));
1707        fontsVec.addElement(new Tag("Report",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Report","Report")));
1708        fontsVec.addElement(new Tag("Page",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Page","Page")));
1709        fontsVec.addElement(new Tag("Column",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Column","Column")));
1710        fontsVec.addElement(new Tag("Group",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Group","Group")));
1711        fontsVec.addElement(new Tag("Band",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Band","Bans")));
1712        fontsVec.addElement(new Tag("Auto",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Auto","Auto")));
1713        spImageEvaluationTime.setTags(fontsVec);
1714        spImageEvaluationTime.setDefaultValue("Now");
1715        spImageEvaluationTime.setShowResetButton(false);
1716        
1717        spImageEvaluationGroup = new ComboBoxSheetProperty("imageEvaluationGroup",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationGroup","Eval. group"));
1718        spImageEvaluationGroup.setShowResetButton(false);
1719        spImageScale = new SheetProperty("imageScale",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale","Image scale"), SheetProperty.COMBOBOX);
1720        fontsVec = new Vector();
1721        fontsVec.addElement(new Tag("Clip",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Clip","Clip")));
1722        fontsVec.addElement(new Tag("FillFrame",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.FillFrame","Fill frame")));
1723        fontsVec.addElement(new Tag("RetainShape",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.RetainShape","Retain shape")));
1724        spImageScale.setTags(fontsVec);
1725        spImageScale.setDefaultValue("FillFrame");
1726        
1727        spImageError = new SheetProperty("imageError",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageError","On error type"), SheetProperty.COMBOBOX);
1728        fontsVec = new Vector();
1729        fontsVec.addElement(new Tag("Error",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Error","Error")));
1730        fontsVec.addElement(new Tag("Blank",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Blank","Blank")));
1731        fontsVec.addElement(new Tag("Icon",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Icon","Icon")));
1732        spImageError.setTags(fontsVec);
1733        spImageError.setDefaultValue("Error");
1734        spImageError.setShowResetButton(false);
1735        
1736        spImageHAlign = new SheetProperty("imageHAlign",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign","Align"), SheetProperty.COMBOBOX);
1737        spImageHAlign.setTags( new Tag[]{ new Tag("Left",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Left","Left")),
1738                                          new Tag("Center",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Center","Center")),
1739                                          new Tag("Right",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Right","Right"))});
1740        spImageHAlign.setDefaultValue("Left");
1741        
1742        spImageVAlign = new SheetProperty("imageVAlign",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign","Vertical align"), SheetProperty.COMBOBOX);
1743        spImageVAlign.setTags( new Tag[]{ new Tag("Top",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Top","Top")),
1744                                          new Tag("Middle",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Middle","Middle")),
1745                                          new Tag("Bottom",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Bottom","Bottom"))});
1746        spImageVAlign.setDefaultValue("Top");
1747        
1748        spImageLazy = new SheetProperty("imageLazy",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageLazy","Is lazy"), SheetProperty.BOOLEAN);
1749        spImageLazy.setShowResetButton(false);
1750        
1751        spImageCache = new SheetProperty("imageCache",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageCache","Using cache"), SheetProperty.BOOLEAN);
1752        
1753        //spBarcodeGroup = new ComboBoxSheetProperty("barcode_group","Evaluation group");
1754

1755        spBCExpression = new ExpressionSheetProperty("barcodeExpression",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcodeExpression","Barcode expression"));
1756        spBCExpression.setShowResetButton(false);
1757        
1758        spBCApplicationIdentifier = new ExpressionSheetProperty("barcodeAppIdentifierExpression",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcodeApplicationIdentifier","Applic. identifier"));
1759        spBCApplicationIdentifier.setShowResetButton(false);
1760        
1761        spBCBarWidth = new SheetProperty("barcodeBarWidth",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcodeBarWidth","Bar width"), SheetProperty.INTEGER);
1762        spBCBarWidth.setShowResetButton(false);
1763        
1764        spBCBarHeight = new SheetProperty("barcodeBarHeight",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcodeBarHeight","Bar height"), SheetProperty.INTEGER);
1765        spBCBarHeight.setShowResetButton(false);
1766        
1767        spBCType= new SheetProperty("barcodeType",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcodeType","Type"), SheetProperty.COMBOBOX);
1768        fontsVec = new Vector();
1769        fontsVec.add(new Tag("1","2of7"));
1770        fontsVec.add(new Tag("2","3of9"));
1771        fontsVec.add(new Tag("3","Bookland"));
1772        fontsVec.add(new Tag("4","Codabar"));
1773        fontsVec.add(new Tag("5","Code128"));
1774        fontsVec.add(new Tag("6","Code128A"));
1775        fontsVec.add(new Tag("7","Code128B"));
1776        fontsVec.add(new Tag("8","Code128C"));
1777        fontsVec.add(new Tag("9","Code39"));
1778        fontsVec.add(new Tag("26","Code39 (Extended)"));
1779        fontsVec.add(new Tag("10","EAN128"));
1780        fontsVec.add(new Tag("11","EAN13"));
1781        fontsVec.add(new Tag("12","GlobalTradeItemNumber"));
1782        fontsVec.add(new Tag("13","Int2of5"));
1783        fontsVec.add(new Tag("14","Monarch"));
1784        fontsVec.add(new Tag("15","NW7"));
1785        fontsVec.add(new Tag("16","PDF417"));
1786        fontsVec.add(new Tag("17","SCC14ShippingCode"));
1787        fontsVec.add(new Tag("18","ShipmentIdentificationNumber"));
1788        fontsVec.add(new Tag("19","SSCC18"));
1789        fontsVec.add(new Tag("20","Std2of5"));
1790        fontsVec.add(new Tag("21","UCC128"));
1791        fontsVec.add(new Tag("22","UPCA"));
1792        fontsVec.add(new Tag("23","USD3"));
1793        fontsVec.add(new Tag("24","USD4"));
1794        fontsVec.add(new Tag("25","USPS"));
1795        spBCType.setTags(fontsVec);
1796        //spImageExpressionClass.setDefaultValue("java.lang.String");
1797
spBCType.setShowResetButton(false);
1798        
1799        spBCEvaluationTime = new SheetProperty("barcodeEvaluationTime",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime","Eval. time"), SheetProperty.COMBOBOX);
1800        // Text field Evaluation Time...
1801
fontsVec = new Vector();
1802        fontsVec.addElement(new Tag("Now",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Now","Now")));
1803        fontsVec.addElement(new Tag("Report",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Report","Report")));
1804        fontsVec.addElement(new Tag("Page",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Page","Page")));
1805        fontsVec.addElement(new Tag("Column",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Column","Column")));
1806        fontsVec.addElement(new Tag("Group",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Group","Group")));
1807        fontsVec.addElement(new Tag("Band",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Band","Bans")));
1808        fontsVec.addElement(new Tag("Auto",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Auto","Auto")));
1809        spBCEvaluationTime.setTags(fontsVec);
1810        spBCEvaluationTime.setDefaultValue("Now");
1811        spBCEvaluationTime.setShowResetButton(false);
1812        
1813        spBCEvaluationGroup = new ComboBoxSheetProperty("barcodeEvaluationGroup",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationGroup","Eval. group"));
1814        spBCEvaluationGroup.setShowResetButton(false);
1815        spBCScale = new SheetProperty("barcodeScale",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale","Image scale"), SheetProperty.COMBOBOX);
1816        fontsVec = new Vector();
1817        fontsVec.addElement(new Tag("Clip",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Clip","Clip")));
1818        fontsVec.addElement(new Tag("FillFrame",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.FillFrame","Fill frame")));
1819        fontsVec.addElement(new Tag("RetainShape",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.RetainShape","Retain shape")));
1820        spBCScale.setTags(fontsVec);
1821        spBCScale.setDefaultValue("FillFrame");
1822        
1823        spBCError = new SheetProperty("barcodeError",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageError","On error type"), SheetProperty.COMBOBOX);
1824        fontsVec = new Vector();
1825        fontsVec.addElement(new Tag("Error",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Error","Error")));
1826        fontsVec.addElement(new Tag("Blank",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Blank","Blank")));
1827        fontsVec.addElement(new Tag("Icon",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.imageScale.Icon","Icon")));
1828        spBCError.setTags(fontsVec);
1829        spBCError.setDefaultValue("Error");
1830        spBCError.setShowResetButton(false);
1831        
1832        spBCHAlign = new SheetProperty("barcodeHAlign",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign","Align"), SheetProperty.COMBOBOX);
1833        spBCHAlign.setTags( new Tag[]{ new Tag("Left",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Left","Left")),
1834                                          new Tag("Center",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Center","Center")),
1835                                          new Tag("Right",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.halign.Right","Right"))});
1836        spBCHAlign.setDefaultValue("Left");
1837        
1838        spBCVAlign = new SheetProperty("barcodeVAlign",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign","Vertical align"), SheetProperty.COMBOBOX);
1839        spBCVAlign.setTags( new Tag[]{ new Tag("Top",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Top","Top")),
1840                                          new Tag("Middle",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Middle","Middle")),
1841                                          new Tag("Bottom",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.valign.Bottom","Bottom"))});
1842        spBCVAlign.setDefaultValue("Top");
1843        
1844        spBCChecksum = new SheetProperty("barcodeChecksum",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcodeChecksum","Checksum"), SheetProperty.BOOLEAN);
1845        spBCChecksum.setShowResetButton(false);
1846        
1847        spBCShowText = new SheetProperty("barcodeShowText",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.barcodeShowText","Show Text"), SheetProperty.BOOLEAN);
1848        spBCShowText.setShowResetButton(false);
1849        
1850        
1851        spChartEvaluationTime = new SheetProperty("chartEvaluationTime",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime","Eval. time"), SheetProperty.COMBOBOX);
1852        // Text field Evaluation Time...
1853
fontsVec = new Vector();
1854        fontsVec.addElement(new Tag("Now",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Now","Now")));
1855        fontsVec.addElement(new Tag("Report",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Report","Report")));
1856        fontsVec.addElement(new Tag("Page",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Page","Page")));
1857        fontsVec.addElement(new Tag("Column",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Column","Column")));
1858        fontsVec.addElement(new Tag("Group",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Group","Group")));
1859        fontsVec.addElement(new Tag("Band",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Band","Bans")));
1860        fontsVec.addElement(new Tag("Auto",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationTime.Auto","Auto")));
1861        spChartEvaluationTime.setTags(fontsVec);
1862        spChartEvaluationTime.setDefaultValue("Now");
1863        spChartEvaluationTime.setShowResetButton(false);
1864        
1865        spChartEvaluationGroup = new ComboBoxSheetProperty("chartEvaluationGroup",it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.textfieldEvaluationGroup","Eval. group"));
1866        spChartEvaluationGroup.setShowResetButton(false);
1867     }
1868     
1869     /**
1870      * Update groups
1871      */

1872     protected void updateAllComboBoxes()
1873     {
1874         if (jrf == null) return;
1875         // Use the name of the group and not the group object....
1876
Vector group_names = new Vector();
1877         Enumeration e = jrf.getReport().getGroups().elements();
1878         while (e.hasMoreElements()) {
1879            group_names.addElement(""+e.nextElement());
1880         }
1881         
1882         spTextfieldEvaluationGroup.updateValues( group_names,false);
1883         spImageEvaluationGroup.updateValues( group_names,false);
1884         spBCEvaluationGroup.updateValues( group_names,false);
1885         spChartEvaluationGroup.updateValues( group_names,false);
1886         
1887         group_names.insertElementAt("",0);
1888         spGroups.updateValues( group_names,false);
1889         
1890         
1891         Vector styles = new Vector();
1892         e = jrf.getReport().getStyles().elements();
1893         while (e.hasMoreElements()) {
1894            styles.addElement(e.nextElement());
1895         }
1896         styles.insertElementAt("",0);
1897         spStyle.updateValues( styles , true);
1898         
1899         updateBandsCell();
1900         
1901     }
1902     
1903     
1904     protected void updateBandsCell()
1905     {
1906         // Put all the bands in a tag...
1907
this.setInit(true);
1908         
1909         if (jrf.getSelectedCrosstabEditorPanel() == null)
1910         {
1911           spBands.setName(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.band","Band"));
1912           Misc.updateComboBox( (JComboBox JavaDoc)spBands.getEditor(), jrf.getReport().getBands(), false);
1913         }
1914         else
1915         {
1916           spBands.setName(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.cell","Cell"));
1917           Misc.updateComboBox( (JComboBox JavaDoc)spBands.getEditor(), jrf.getSelectedCrosstabEditorPanel().getCrosstabElement().getCells(), false);
1918         }
1919         
1920         this.setInit(false);
1921    }
1922
1923    public boolean isInit() {
1924        return init;
1925    }
1926
1927    public void setInit(boolean init) {
1928        this.init = init;
1929    }
1930    
1931    
1932    protected boolean setComboBox( boolean firstTime, Object JavaDoc value, javax.swing.JComboBox JavaDoc comboField ) {
1933        if (( !firstTime ) && (!(comboField.getSelectedItem() == value))) {
1934
1935            comboField.insertItemAt(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.differentValues","<different values>"),0);
1936            comboField.setSelectedIndex(0);
1937            return false;
1938        }
1939        else {
1940            try {
1941                comboField.setSelectedItem( value );
1942            } catch (Exception JavaDoc ex){
1943                ex.printStackTrace();
1944            }
1945        }
1946        return true;
1947    }
1948    
1949    protected boolean setTextArea( boolean firstTime, String JavaDoc value, SheetProperty textProperty ) {
1950        
1951        if ((!firstTime) && (!(textProperty.getValue().equals(value) ))) {
1952            
1953            JComponent JavaDoc editor = textProperty.getEditor();
1954            if (editor instanceof ExpressionSheetPropertyComponent)
1955            {
1956                ((ExpressionSheetPropertyComponent)editor).setExpression("");
1957               ((ExpressionSheetPropertyComponent)editor).setText(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.differentValues","<different values>"));
1958            }
1959            return false;
1960        }
1961        else {
1962            try {
1963                textProperty.setValue(value);
1964            } catch (Exception JavaDoc ex){
1965                ex.printStackTrace();
1966            }
1967        }
1968        return true;
1969    }
1970    
1971    protected boolean setTextPattern( boolean firstTime, Object JavaDoc value, SheetProperty textProperty ) {
1972        
1973        if ((!firstTime) && (!((textProperty.getValue()+"").equals(value) ))) {
1974            
1975            JComponent JavaDoc editor = textProperty.getEditor();
1976            if (editor instanceof PatternSheetPropertyComponent)
1977            {
1978                ((PatternSheetPropertyComponent)editor).setExpression("");
1979               ((PatternSheetPropertyComponent)editor).setText(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.differentValues","<different values>"));
1980            }
1981            return false;
1982        }
1983        else {
1984            try {
1985                textProperty.setValue(value);
1986            } catch (Exception JavaDoc ex){
1987                ex.printStackTrace();
1988            }
1989        }
1990        return true;
1991    }
1992   
1993  
1994 /**
1995  * Set the value for a tagged combobox.
1996  */

1997 protected boolean setTagComboBox( boolean firstTime, Object JavaDoc value, SheetProperty sp ) {
1998        
1999      if (firstTime)
2000      {
2001        removeNullItem(sp);
2002        sp.setValue( value );
2003        return true;
2004      }
2005      else
2006      {
2007          Object JavaDoc s = sp.getValue();
2008          if (s == null && value == null) return true;
2009          if (s!= null && s.equals(value)) return true;;
2010          
2011          sp.setSetting(true);
2012          
2013          JComboBox JavaDoc combobox = (JComboBox JavaDoc)sp.getEditor();
2014          if (combobox.getItemCount() > 0)
2015          {
2016             Object JavaDoc obj = combobox.getItemAt(0);
2017             sp.setValue(null);
2018             if ((obj+"").equals(it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.differentValues","<different values>")))
2019             {
2020                // null item already present...
2021
}
2022             else
2023             {
2024                 ((JComboBox JavaDoc)sp.getEditor()).insertItemAt(new Tag(null,it.businesslogic.ireport.util.I18n.getString("gui.elementpropertiessheet.differentValues","<different values>")),0);
2025             }
2026          }
2027          ((JComboBox JavaDoc)sp.getEditor()).setSelectedIndex(0);
2028          sp.setSetting(false);
2029          return false;
2030      }
2031    }
2032    
2033    protected boolean setElementNumber( boolean firstTime, double value, JNumberField numberField ) {
2034        if (( ! firstTime ) && (!(numberField.getValue() == value))) {
2035            numberField.setText("");
2036            return false;
2037        }
2038        else {
2039            try {
2040                numberField.setValue( value );
2041            } catch (Exception JavaDoc ex){
2042                ex.printStackTrace();
2043            }
2044        }
2045        return true;
2046    }
2047    
2048    protected boolean setElementNumber( boolean firstTime, int defaultValue, Object JavaDoc value, NumberComboBoxSheetProperty sp) {
2049        if ( ( ! firstTime ) && (!((sp.getValue()+"").equals(""+value))) ) {
2050            
2051            boolean setting = sp.isSetting();
2052            sp.setSetting(true);
2053            sp.setValue(null);
2054            sp.setSetting(setting);
2055            System.out.println("Setting value of editor to blank ");
2056            sp.setEditorValue( sp.getEditor(), "");
2057            return false;
2058        }
2059        else {
2060            try {
2061                 boolean setting = sp.isSetting();
2062                 sp.setSetting(true);
2063                 sp.setValue(value);
2064                 if (value == null)
2065                 {
2066                     if (!firstTime && !(((JNumberComboBox)sp.getEditor()).getSelectedItem()+"").equals(""+defaultValue))
2067                     {
2068                         sp.setEditorValue( sp.getEditor(), "");
2069                     }
2070                     else
2071                     {
2072                        sp.setEditorValue( sp.getEditor(), new Integer JavaDoc( defaultValue));
2073                    }
2074                 }
2075                 sp.setSetting(setting);
2076            } catch (Exception JavaDoc ex){
2077                ex.printStackTrace();
2078            }
2079        }
2080        return true;
2081    }
2082    
2083    protected boolean setGenericSheetProperty( boolean firstTime, Object JavaDoc value, SheetProperty sp) {
2084        if (firstTime )
2085        {
2086            try {
2087                sp.setValue( value );
2088            } catch (Exception JavaDoc ex){
2089                ex.printStackTrace();
2090            }
2091            return true;
2092        } else
2093        {
2094            Object JavaDoc value2 = sp.getValue();
2095            if (value2 == value)
2096            {
2097                return true;
2098            }
2099            if (value2 != null && (""+value2).equals( value +""))
2100            {
2101                return true;
2102            }
2103            
2104            sp.setValue(null);
2105        }
2106       
2107        return false;
2108    }
2109    
2110    
2111    protected boolean setColorProperty( boolean firstTime, java.awt.Color JavaDoc color, SheetProperty sp) {
2112        
2113        
2114        if (firstTime )
2115        {
2116            try {
2117                sp.setValue( color );
2118            } catch (Exception JavaDoc ex){
2119                ex.printStackTrace();
2120            }
2121            return true;
2122        } else
2123        {
2124            java.awt.Color JavaDoc c1 = (java.awt.Color JavaDoc)sp.getValue();
2125            if (c1 == color)
2126            {
2127                return true;
2128            }
2129            if (c1 != null && color != null && c1.getRGB() == color.getRGB())
2130            {
2131                return true;
2132            }
2133            
2134            sp.setValue(null);
2135        }
2136       
2137        return false;
2138    }
2139            
2140    protected boolean setCheckBox( boolean firstTime, boolean value, boolean isNull, SheetProperty sp ) {
2141        if (firstTime )
2142        {
2143            try {
2144                if (isNull)
2145                {
2146                    sp.setValue( null );
2147                    sp.setSetting(true);
2148                    ((JCheckBox JavaDoc)sp.getEditor()).setSelected(value);
2149                    sp.setSetting(false);
2150                }
2151                else
2152                {
2153                    sp.setValue(""+value);
2154                }
2155                
2156            } catch (Exception JavaDoc ex){
2157                ex.printStackTrace();
2158            }
2159            return true;
2160        }
2161        else
2162        {
2163             if (sp.getValue() == null && isNull) return true;
2164             if (sp.getValue() != null && sp.getValue().equals("" + value) ) return true;
2165            
2166             sp.setValue( null );
2167             return false;
2168        }
2169        
2170    }
2171
2172    public ComboBoxSheetProperty getSpBands() {
2173        return spBands;
2174    }
2175
2176    public void setSpBands(ComboBoxSheetProperty spBands) {
2177        this.spBands = spBands;
2178    }
2179
2180    public SheetProperty getSpTop() {
2181        return spTop;
2182    }
2183
2184    public void setSpTop(SheetProperty spTop) {
2185        this.spTop = spTop;
2186    }
2187
2188    public SheetProperty getSpLeft() {
2189        return spLeft;
2190    }
2191
2192    public void setSpLeft(SheetProperty spLeft) {
2193        this.spLeft = spLeft;
2194    }
2195
2196    public SheetProperty getSpHeight() {
2197        return spHeight;
2198    }
2199
2200    public void setSpHeight(SheetProperty spHeight) {
2201        this.spHeight = spHeight;
2202    }
2203
2204    public SheetProperty getSpWidth() {
2205        return spWidth;
2206    }
2207
2208    public void setSpWidth(SheetProperty spWidth) {
2209        this.spWidth = spWidth;
2210    }
2211
2212    public ComboBoxSheetProperty getSpGroups() {
2213        return spGroups;
2214    }
2215
2216    public void setSpGroups(ComboBoxSheetProperty spGroups) {
2217        this.spGroups = spGroups;
2218    }
2219
2220
2221    public JReportFrame getJrf() {
2222        return jrf;
2223    }
2224
2225    public void setJrf(JReportFrame jrf) {
2226        this.jrf = jrf;
2227    }
2228    
2229    
2230    /**
2231     * Redraw the correct editor panel (JReportPanel or the active CrosstabPanel)
2232     *
2233     */

2234    public void repaintEditor()
2235    {
2236        if (jrf == null) return;
2237        if (jrf.getSelectedCrosstabEditorPanel() == null)
2238        {
2239            jrf.getJPanelReport().repaint( );
2240        }
2241        else
2242        {
2243            jrf.getSelectedCrosstabEditorPanel().repaint();
2244        }
2245    }
2246    
2247    public Vector getElementSelection()
2248    {
2249        return elementSelection;
2250
2251    }
2252
2253    public void setElementSelection(Vector newElementSelection) {
2254        
2255        this.elementSelection.removeAllElements();
2256        if (newElementSelection == null) return;
2257        this.elementSelection.addAll(newElementSelection);
2258    }
2259    
2260    protected void updateReportFonts()
2261    {
2262        Object JavaDoc value = spPdfFontName.getValue();
2263        
2264        Vector fontsVec = new Vector();
2265        fontsVec.addElement(new Tag("Helvetica"));
2266        fontsVec.addElement(new Tag("Helvetica-Bold"));
2267        fontsVec.addElement(new Tag("Helvetica-BoldOblique"));
2268        fontsVec.addElement(new Tag("Helvetica-Oblique"));
2269        fontsVec.addElement(new Tag("Courier"));
2270        fontsVec.addElement(new Tag("Courier-Bold"));
2271        fontsVec.addElement(new Tag("Courier-BoldOblique"));
2272        fontsVec.addElement(new Tag("Courier-Oblique"));
2273        fontsVec.addElement(new Tag("Symbol"));
2274        fontsVec.addElement(new Tag("Times-Roman"));
2275        fontsVec.addElement(new Tag("Times-Bold"));
2276        fontsVec.addElement(new Tag("Times-BoldItalic"));
2277        fontsVec.addElement(new Tag("Times-Italic"));
2278        fontsVec.addElement(new Tag("ZapfDingbats"));
2279        fontsVec.addElement(new Tag("STSong-Light"));
2280        fontsVec.addElement(new Tag("MHei-Medium"));
2281        fontsVec.addElement(new Tag("MSung-Light"));
2282        fontsVec.addElement(new Tag("HeiseiKakuGo-W5"));
2283        fontsVec.addElement(new Tag("HeiseiMin-W3"));
2284        fontsVec.addElement(new Tag("HYGoThic-Medium"));
2285        fontsVec.addElement(new Tag("HYSMyeongJo-Medium"));
2286        Vector iRfonts = MainFrame.getMainInstance().getTtfFonts();
2287        for (int i_f=0; i_f<iRfonts.size(); ++i_f)
2288        {
2289            fontsVec.addElement(new Tag( ((IRFont)iRfonts.elementAt(i_f)).getFile(),
2290                                   iRfonts.elementAt(i_f)+""));
2291        }
2292        
2293        Misc.updateComboBox( (JComboBox JavaDoc)spPdfFontName.getEditor(), fontsVec );
2294        spPdfFontName.setEditorValue( spPdfFontName.getEditor(), value );
2295    }
2296}
2297
Popular Tags