Source Code Cross Referenced for CategorySeriesDialog.java in  » Report » iReport-2.0.5 » it » businesslogic » ireport » chart » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Report » iReport 2.0.5 » it.businesslogic.ireport.chart 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2005 - 2008 JasperSoft Corporation.  All rights reserved. 
003:         * http://www.jaspersoft.com.
004:         *
005:         * Unless you have purchased a commercial license agreement from JasperSoft,
006:         * the following license terms apply:
007:         *
008:         * This program is free software; you can redistribute it and/or modify
009:         * it under the terms of the GNU General Public License version 2 as published by
010:         * the Free Software Foundation.
011:         *
012:         * This program is distributed WITHOUT ANY WARRANTY; and without the
013:         * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014:         * See the GNU General Public License for more details.
015:         *
016:         * You should have received a copy of the GNU General Public License
017:         * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018:         * or write to:
019:         *
020:         * Free Software Foundation, Inc.,
021:         * 59 Temple Place - Suite 330,
022:         * Boston, MA  USA  02111-1307
023:         *
024:         *
025:         *
026:         *
027:         * CategorySeriesDialog.java
028:         * 
029:         * Created on 17 agosto 2005, 11.19
030:         *
031:         */
032:
033:        package it.businesslogic.ireport.chart;
034:
035:        import it.businesslogic.ireport.SubDataset;
036:        import it.businesslogic.ireport.util.I18n;
037:        import it.businesslogic.ireport.util.Misc;
038:
039:        /**
040:         *
041:         * @author  Administrator
042:         */
043:        public class CategorySeriesDialog extends javax.swing.JDialog {
044:
045:            private String seriesExpression = "";
046:            private String categoryExpression = "";
047:            private String valueExpression = "";
048:            private String labelExpression = "";
049:
050:            private int dialogResult = javax.swing.JOptionPane.CANCEL_OPTION;
051:
052:            /** Creates new form CategorySeriesDialog */
053:            public CategorySeriesDialog(java.awt.Frame parent, boolean modal) {
054:                super (parent, modal);
055:                initComponents();
056:                applyI18n();
057:
058:                this .setSize(500, 500);
059:                it.businesslogic.ireport.util.Misc.centerFrame(this );
060:
061:                javax.swing.KeyStroke escape = javax.swing.KeyStroke
062:                        .getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0,
063:                                false);
064:                javax.swing.Action escapeAction = new javax.swing.AbstractAction() {
065:                    public void actionPerformed(java.awt.event.ActionEvent e) {
066:                        jButtonCancelActionPerformed(e);
067:                    }
068:                };
069:
070:                getRootPane().getInputMap(
071:                        javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW).put(
072:                        escape, "ESCAPE");
073:                getRootPane().getActionMap().put("ESCAPE", escapeAction);
074:
075:                //to make the default button ...
076:                this .getRootPane().setDefaultButton(this .jButtonOK);
077:            }
078:
079:            /**
080:             * this method is used to pass the correct subdataset to the expression editor
081:             */
082:            public void setSubDataset(SubDataset sds) {
083:                jRTextExpressionCategory.setSubDataset(sds);
084:                jRTextExpressionLabel.setSubDataset(sds);
085:                jRTextExpressionSeries.setSubDataset(sds);
086:                jRTextExpressionValue.setSubDataset(sds);
087:                sectionItemHyperlinkPanel1.setSubDataset(sds);
088:            }
089:
090:            /** This method is called from within the constructor to
091:             * initialize the form.
092:             * WARNING: Do NOT modify this code. The content of this method is
093:             * always regenerated by the Form Editor.
094:             */
095:            // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
096:            private void initComponents() {
097:                java.awt.GridBagConstraints gridBagConstraints;
098:
099:                jTabbedPane1 = new javax.swing.JTabbedPane();
100:                jPanel1 = new javax.swing.JPanel();
101:                jLabelSeriesExpression = new javax.swing.JLabel();
102:                jLabelCategoryExpression = new javax.swing.JLabel();
103:                jLabelValueExpression = new javax.swing.JLabel();
104:                jLabelLabelExpression = new javax.swing.JLabel();
105:                jRTextExpressionSeries = new it.businesslogic.ireport.gui.JRTextExpressionArea();
106:                jRTextExpressionCategory = new it.businesslogic.ireport.gui.JRTextExpressionArea();
107:                jRTextExpressionValue = new it.businesslogic.ireport.gui.JRTextExpressionArea();
108:                jRTextExpressionLabel = new it.businesslogic.ireport.gui.JRTextExpressionArea();
109:                sectionItemHyperlinkPanel1 = new it.businesslogic.ireport.chart.gui.SectionItemHyperlinkPanel();
110:                jPanel6 = new javax.swing.JPanel();
111:                jPanel7 = new javax.swing.JPanel();
112:                jButtonOK = new javax.swing.JButton();
113:                jButtonCancel = new javax.swing.JButton();
114:
115:                getContentPane().setLayout(new java.awt.GridBagLayout());
116:
117:                setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
118:                addWindowListener(new java.awt.event.WindowAdapter() {
119:                    public void windowOpened(java.awt.event.WindowEvent evt) {
120:                        formWindowOpened(evt);
121:                    }
122:                });
123:
124:                jPanel1.setLayout(new java.awt.GridBagLayout());
125:
126:                jLabelSeriesExpression.setText("Series expression (required)");
127:                gridBagConstraints = new java.awt.GridBagConstraints();
128:                gridBagConstraints.gridx = 0;
129:                gridBagConstraints.gridy = 0;
130:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
131:                gridBagConstraints.weightx = 1.0;
132:                jPanel1.add(jLabelSeriesExpression, gridBagConstraints);
133:
134:                jLabelCategoryExpression
135:                        .setText("Category expression (required)");
136:                gridBagConstraints = new java.awt.GridBagConstraints();
137:                gridBagConstraints.gridx = 0;
138:                gridBagConstraints.gridy = 2;
139:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
140:                gridBagConstraints.weightx = 1.0;
141:                gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
142:                jPanel1.add(jLabelCategoryExpression, gridBagConstraints);
143:
144:                jLabelValueExpression.setText("Value expression (required)");
145:                gridBagConstraints = new java.awt.GridBagConstraints();
146:                gridBagConstraints.gridx = 0;
147:                gridBagConstraints.gridy = 4;
148:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
149:                gridBagConstraints.weightx = 1.0;
150:                gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
151:                jPanel1.add(jLabelValueExpression, gridBagConstraints);
152:
153:                jLabelLabelExpression.setText("Label expression");
154:                gridBagConstraints = new java.awt.GridBagConstraints();
155:                gridBagConstraints.gridx = 0;
156:                gridBagConstraints.gridy = 6;
157:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
158:                gridBagConstraints.weightx = 1.0;
159:                gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
160:                jPanel1.add(jLabelLabelExpression, gridBagConstraints);
161:
162:                jRTextExpressionSeries.setBorder(javax.swing.BorderFactory
163:                        .createEtchedBorder());
164:                jRTextExpressionSeries.setElectricScroll(0);
165:                jRTextExpressionSeries.setMinimumSize(new java.awt.Dimension(
166:                        10, 10));
167:                jRTextExpressionSeries.setPreferredSize(new java.awt.Dimension(
168:                        10, 10));
169:                gridBagConstraints = new java.awt.GridBagConstraints();
170:                gridBagConstraints.gridx = 0;
171:                gridBagConstraints.gridy = 1;
172:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
173:                gridBagConstraints.weightx = 1.0;
174:                gridBagConstraints.weighty = 1.0;
175:                jPanel1.add(jRTextExpressionSeries, gridBagConstraints);
176:
177:                jRTextExpressionCategory.setBorder(javax.swing.BorderFactory
178:                        .createEtchedBorder());
179:                jRTextExpressionCategory.setElectricScroll(0);
180:                jRTextExpressionCategory.setMinimumSize(new java.awt.Dimension(
181:                        10, 10));
182:                jRTextExpressionCategory
183:                        .setPreferredSize(new java.awt.Dimension(10, 10));
184:                gridBagConstraints = new java.awt.GridBagConstraints();
185:                gridBagConstraints.gridx = 0;
186:                gridBagConstraints.gridy = 3;
187:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
188:                gridBagConstraints.weightx = 1.0;
189:                gridBagConstraints.weighty = 1.0;
190:                jPanel1.add(jRTextExpressionCategory, gridBagConstraints);
191:
192:                jRTextExpressionValue.setBorder(javax.swing.BorderFactory
193:                        .createEtchedBorder());
194:                jRTextExpressionValue.setElectricScroll(0);
195:                jRTextExpressionValue.setMinimumSize(new java.awt.Dimension(10,
196:                        10));
197:                jRTextExpressionValue.setPreferredSize(new java.awt.Dimension(
198:                        10, 10));
199:                gridBagConstraints = new java.awt.GridBagConstraints();
200:                gridBagConstraints.gridx = 0;
201:                gridBagConstraints.gridy = 5;
202:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
203:                gridBagConstraints.weightx = 1.0;
204:                gridBagConstraints.weighty = 1.0;
205:                jPanel1.add(jRTextExpressionValue, gridBagConstraints);
206:
207:                jRTextExpressionLabel.setBorder(javax.swing.BorderFactory
208:                        .createEtchedBorder());
209:                jRTextExpressionLabel.setElectricScroll(0);
210:                jRTextExpressionLabel.setMinimumSize(new java.awt.Dimension(10,
211:                        10));
212:                jRTextExpressionLabel.setPreferredSize(new java.awt.Dimension(
213:                        10, 10));
214:                gridBagConstraints = new java.awt.GridBagConstraints();
215:                gridBagConstraints.gridx = 0;
216:                gridBagConstraints.gridy = 7;
217:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
218:                gridBagConstraints.weightx = 1.0;
219:                gridBagConstraints.weighty = 1.0;
220:                jPanel1.add(jRTextExpressionLabel, gridBagConstraints);
221:
222:                jTabbedPane1.addTab("Data", jPanel1);
223:
224:                jTabbedPane1.addTab("Item hyperlink",
225:                        sectionItemHyperlinkPanel1);
226:
227:                gridBagConstraints = new java.awt.GridBagConstraints();
228:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
229:                gridBagConstraints.weightx = 1.0;
230:                gridBagConstraints.weighty = 1.0;
231:                getContentPane().add(jTabbedPane1, gridBagConstraints);
232:
233:                jPanel6.setLayout(new java.awt.GridBagLayout());
234:
235:                gridBagConstraints = new java.awt.GridBagConstraints();
236:                gridBagConstraints.gridheight = 2;
237:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
238:                gridBagConstraints.weightx = 1.0;
239:                gridBagConstraints.weighty = 1.0;
240:                jPanel6.add(jPanel7, gridBagConstraints);
241:
242:                jButtonOK.setMnemonic('o');
243:                jButtonOK.setText("OK");
244:                jButtonOK
245:                        .addActionListener(new java.awt.event.ActionListener() {
246:                            public void actionPerformed(
247:                                    java.awt.event.ActionEvent evt) {
248:                                jButtonOKActionPerformed(evt);
249:                            }
250:                        });
251:
252:                gridBagConstraints = new java.awt.GridBagConstraints();
253:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
254:                gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
255:                jPanel6.add(jButtonOK, gridBagConstraints);
256:
257:                jButtonCancel.setMnemonic('c');
258:                jButtonCancel.setText("Cancel");
259:                jButtonCancel
260:                        .addActionListener(new java.awt.event.ActionListener() {
261:                            public void actionPerformed(
262:                                    java.awt.event.ActionEvent evt) {
263:                                jButtonCancelActionPerformed(evt);
264:                            }
265:                        });
266:
267:                gridBagConstraints = new java.awt.GridBagConstraints();
268:                gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
269:                gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 0);
270:                jPanel6.add(jButtonCancel, gridBagConstraints);
271:
272:                gridBagConstraints = new java.awt.GridBagConstraints();
273:                gridBagConstraints.gridx = 0;
274:                gridBagConstraints.gridy = 12;
275:                gridBagConstraints.gridwidth = 2;
276:                gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
277:                gridBagConstraints.weightx = 1.0;
278:                getContentPane().add(jPanel6, gridBagConstraints);
279:
280:                pack();
281:            }// </editor-fold>//GEN-END:initComponents
282:
283:            private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
284:
285:                sectionItemHyperlinkPanel1.openExtraWindows();
286:            }//GEN-LAST:event_formWindowOpened
287:
288:            private void jButtonCancelActionPerformed(
289:                    java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCancelActionPerformed
290:                this .setVisible(false);
291:                this .dispose();
292:            }//GEN-LAST:event_jButtonCancelActionPerformed
293:
294:            private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonOKActionPerformed
295:
296:                seriesExpression = jRTextExpressionSeries.getText();
297:                categoryExpression = jRTextExpressionCategory.getText();
298:                valueExpression = jRTextExpressionValue.getText();
299:                labelExpression = jRTextExpressionLabel.getText();
300:
301:                java.text.MessageFormat formatter = new java.text.MessageFormat(
302:                        it.businesslogic.ireport.util.I18n.getString(
303:                                "gui.notvalidexp", "{0} cannot be blank!"));
304:
305:                if (seriesExpression.trim().length() == 0) {
306:
307:                    javax.swing.JOptionPane
308:                            .showMessageDialog(
309:                                    this ,
310:                                    formatter
311:                                            .format(new Object[] { it.businesslogic.ireport.util.I18n
312:                                                    .getString(
313:                                                            "charts.seriesExpression",
314:                                                            "Series expression") }),
315:                                    I18n.getString(
316:                                            "message.title.invalidExpression",
317:                                            "Invalid expression"),
318:                                    javax.swing.JOptionPane.ERROR_MESSAGE);
319:                    return;
320:                }
321:
322:                if (categoryExpression.trim().length() == 0) {
323:                    javax.swing.JOptionPane
324:                            .showMessageDialog(
325:                                    this ,
326:                                    formatter
327:                                            .format(new Object[] { it.businesslogic.ireport.util.I18n
328:                                                    .getString(
329:                                                            "charts.categoryExpression",
330:                                                            "Category expression") }),
331:                                    I18n.getString(
332:                                            "message.title.invalidExpression",
333:                                            "Invalid expression"),
334:                                    javax.swing.JOptionPane.ERROR_MESSAGE);
335:                    return;
336:                }
337:
338:                if (valueExpression.trim().length() == 0) {
339:                    javax.swing.JOptionPane
340:                            .showMessageDialog(
341:                                    this ,
342:                                    formatter
343:                                            .format(new Object[] { it.businesslogic.ireport.util.I18n
344:                                                    .getString(
345:                                                            "charts.valueExpression",
346:                                                            "Value expression") }),
347:                                    I18n.getString(
348:                                            "message.title.invalidExpression",
349:                                            "Invalid expression"),
350:                                    javax.swing.JOptionPane.ERROR_MESSAGE);
351:                    return;
352:                }
353:
354:                this .setDialogResult(javax.swing.JOptionPane.OK_OPTION);
355:                this .setVisible(false);
356:                this .dispose();
357:            }//GEN-LAST:event_jButtonOKActionPerformed
358:
359:            /**
360:             * @param args the command line arguments
361:             */
362:            public static void main(String args[]) {
363:                java.awt.EventQueue.invokeLater(new Runnable() {
364:                    public void run() {
365:                        new CategorySeriesDialog(new javax.swing.JFrame(), true)
366:                                .setVisible(true);
367:                    }
368:                });
369:            }
370:
371:            public String getSeriesExpression() {
372:                return seriesExpression;
373:            }
374:
375:            public void setSeriesExpression(String seriesExpression) {
376:                this .seriesExpression = seriesExpression;
377:                jRTextExpressionSeries.setText(seriesExpression);
378:            }
379:
380:            public String getCategoryExpression() {
381:                return categoryExpression;
382:            }
383:
384:            public void setCategoryExpression(String categoryExpression) {
385:                this .categoryExpression = categoryExpression;
386:                jRTextExpressionCategory.setText(categoryExpression);
387:            }
388:
389:            public String getValueExpression() {
390:                return valueExpression;
391:            }
392:
393:            public void setValueExpression(String valueExpression) {
394:                this .valueExpression = valueExpression;
395:                jRTextExpressionValue.setText(valueExpression);
396:            }
397:
398:            public String getLabelExpression() {
399:                return labelExpression;
400:            }
401:
402:            public void setLabelExpression(String labelExpression) {
403:                this .labelExpression = labelExpression;
404:                jRTextExpressionLabel.setText(labelExpression);
405:            }
406:
407:            public void setSectionItemHyperlink(
408:                    SectionItemHyperlink sectionItemHyperlink) {
409:                sectionItemHyperlinkPanel1
410:                        .setSectionItemHyperlink(sectionItemHyperlink.cloneMe());
411:            }
412:
413:            public SectionItemHyperlink getSectionItemHyperlink() {
414:                return sectionItemHyperlinkPanel1.getSectionItemHyperlink();
415:            }
416:
417:            public int getDialogResult() {
418:                return dialogResult;
419:            }
420:
421:            public void setDialogResult(int dialogResult) {
422:                this .dialogResult = dialogResult;
423:            }
424:
425:            // Variables declaration - do not modify//GEN-BEGIN:variables
426:            private javax.swing.JButton jButtonCancel;
427:            private javax.swing.JButton jButtonOK;
428:            private javax.swing.JLabel jLabelCategoryExpression;
429:            private javax.swing.JLabel jLabelLabelExpression;
430:            private javax.swing.JLabel jLabelSeriesExpression;
431:            private javax.swing.JLabel jLabelValueExpression;
432:            private javax.swing.JPanel jPanel1;
433:            private javax.swing.JPanel jPanel6;
434:            private javax.swing.JPanel jPanel7;
435:            private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionCategory;
436:            private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionLabel;
437:            private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionSeries;
438:            private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionValue;
439:            private javax.swing.JTabbedPane jTabbedPane1;
440:            private it.businesslogic.ireport.chart.gui.SectionItemHyperlinkPanel sectionItemHyperlinkPanel1;
441:
442:            // End of variables declaration//GEN-END:variables
443:
444:            public void applyI18n() {
445:                // Start autogenerated code ----------------------
446:                // End autogenerated code ----------------------
447:                jButtonOK.setText(it.businesslogic.ireport.util.I18n.getString(
448:                        "ok", "Ok"));
449:                jButtonCancel.setText(it.businesslogic.ireport.util.I18n
450:                        .getString("cancel", "Cancel"));
451:
452:                jLabelCategoryExpression
453:                        .setText(it.businesslogic.ireport.util.I18n.getString(
454:                                "charts.categoryExpression",
455:                                "Category expression"));
456:                jLabelSeriesExpression
457:                        .setText(it.businesslogic.ireport.util.I18n.getString(
458:                                "charts.seriesExpression", "Series expression"));
459:                jLabelValueExpression
460:                        .setText(it.businesslogic.ireport.util.I18n.getString(
461:                                "charts.valueExpression", "Value expression"));
462:                jLabelLabelExpression
463:                        .setText(it.businesslogic.ireport.util.I18n.getString(
464:                                "charts.labelExpression", "Label expression"));
465:
466:                jTabbedPane1.setTitleAt(0, I18n.getString(
467:                        "chartSeries.tab.Data", "Data"));
468:                jTabbedPane1.setTitleAt(1, I18n.getString(
469:                        "chartSeries.tab.ItemHyperlink", "Item hyperlink"));
470:
471:                this .setTitle(it.businesslogic.ireport.util.I18n.getString(
472:                        "gui.ChartPropertiesDialog.title", "Chart properties"));
473:                this .getRootPane().updateUI();
474:            }
475:
476:            public static final int COMPONENT_NONE = 0;
477:            public static final int COMPONENT_CATEGORY_EXPRESSION = 1;
478:            public static final int COMPONENT_SERIES_EXPRESSION = 2;
479:            public static final int COMPONENT_VALUE_EXPRESSION = 3;
480:            public static final int COMPONENT_LABEL_EXPRESSION = 4;
481:            public static final int COMPONENT_HYPERLINK = 100;
482:
483:            /**
484:             * This method set the focus on a specific component.
485:             * 
486:             * expressionInfo[0] can be something like:
487:             * COMPONENT_CATEGORY_EXPRESSION, COMPONENT_SERIES_EXPRESSION, COMPONENT_VALUE_EXPRESSION...
488:             *
489:             * If it is COMPONENT_HYPERLINK, other parameters are expected...
490:             * otherInfo is used here only for COMPONENT_HYPERLINK
491:             * otherInfo[0] = expression ID
492:             * otherInfo[1] = parameter #
493:             * otherInfo[2] = parameter expression ID
494:             */
495:            public void setFocusedExpression(Object[] expressionInfo) {
496:                if (expressionInfo == null)
497:                    return;
498:                int expID = ((Integer) expressionInfo[0]).intValue();
499:
500:                switch (expID) {
501:                case COMPONENT_CATEGORY_EXPRESSION:
502:                    Misc.selectTextAndFocusArea(jRTextExpressionCategory);
503:                    break;
504:                case COMPONENT_SERIES_EXPRESSION:
505:                    Misc.selectTextAndFocusArea(jRTextExpressionSeries);
506:                    break;
507:                case COMPONENT_VALUE_EXPRESSION:
508:                    Misc.selectTextAndFocusArea(jRTextExpressionValue);
509:                    break;
510:                case COMPONENT_LABEL_EXPRESSION:
511:                    Misc.selectTextAndFocusArea(jRTextExpressionLabel);
512:                    break;
513:                case COMPONENT_HYPERLINK:
514:                    jTabbedPane1
515:                            .setSelectedComponent(sectionItemHyperlinkPanel1);
516:                    Object newInfo[] = new Object[expressionInfo.length - 1];
517:                    for (int i = 1; i < expressionInfo.length; ++i)
518:                        newInfo[i - 1] = expressionInfo[i];
519:                    sectionItemHyperlinkPanel1.setFocusedExpression(newInfo);
520:                    break;
521:                }
522:            }
523:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.