Source Code Cross Referenced for DocumentSheetPanel.java in  » Report » iReport-2.0.5 » it » businesslogic » ireport » gui » sheet » 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.gui.sheet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DocumentSheetPanel.java
003:         *
004:         * Created on March 6, 2007, 12:08 PM
005:         */
006:
007:        package it.businesslogic.ireport.gui.sheet;
008:
009:        import it.businesslogic.ireport.gui.JReportFrame;
010:        import it.businesslogic.ireport.gui.MainFrame;
011:        import it.businesslogic.ireport.gui.event.ReportBandChangedEvent;
012:        import it.businesslogic.ireport.gui.event.ReportBandsSelectionEvent;
013:        import it.businesslogic.ireport.gui.event.ReportElementChangedEvent;
014:        import it.businesslogic.ireport.gui.event.ReportElementsSelectionEvent;
015:        import it.businesslogic.ireport.gui.event.ReportFrameActivatedEvent;
016:        import it.businesslogic.ireport.gui.event.ReportFrameActivatedListener;
017:        import it.businesslogic.ireport.gui.event.ReportListener;
018:        import it.businesslogic.ireport.gui.event.ReportObjectsSelectionEvent;
019:        import it.businesslogic.ireport.gui.event.ReportSubDatasetChangedEvent;
020:        import it.businesslogic.ireport.gui.event.ReportSubDatasetChangedListener;
021:        import it.businesslogic.ireport.gui.event.SubDatasetObjectChangedEvent;
022:        import it.businesslogic.ireport.gui.event.SubDatasetObjectChangedListener;
023:        import it.businesslogic.ireport.util.LanguageChangedEvent;
024:        import it.businesslogic.ireport.util.LanguageChangedListener;
025:        import java.awt.BorderLayout;
026:        import javax.swing.JLabel;
027:
028:        /**
029:         *
030:         * @author  gtoffoli
031:         */
032:        public class DocumentSheetPanel extends javax.swing.JPanel implements 
033:                ReportListener, LanguageChangedListener,
034:                ReportFrameActivatedListener, SubDatasetObjectChangedListener,
035:                ReportSubDatasetChangedListener {
036:
037:            private ReportElementSheetPanel reportElementSheetPanel = null;
038:            private ReportBandSheetPanel reportBandSheetPanel = null;
039:            private ReportSheetPanel reportSheetPanel = null;
040:            private ReportObjectSheetPanel reportObjectSheetPanel = null;
041:
042:            public static final int SHOW_NOTHING = -1;
043:            public static final int SHOW_DOCUMENT_SHEET = 0;
044:            public static final int SHOW_BAND_SHEET = 1;
045:            public static final int SHOW_REPORTELEMENT_SHEET = 2;
046:            public static final int SHOW_REPORTOBJECT_SHEET = 3;
047:
048:            int currentMode = -2;
049:
050:            private JReportFrame jReportFrame = null;
051:
052:            /**
053:             * Creates new form DocumentSheetPanel
054:             */
055:            public DocumentSheetPanel() {
056:                initComponents();
057:
058:                setReportElementSheetPanel(new ReportElementSheetPanel());
059:                setReportBandSheetPanel(new ReportBandSheetPanel());
060:                setReportSheetPanel(new ReportSheetPanel());
061:                setReportObjectSheetPanel(new ReportObjectSheetPanel());
062:
063:                getReportBandSheetPanel().setResizeWeight(0.4);
064:                getReportElementSheetPanel().setResizeWeight(0.4);
065:                getReportSheetPanel().setResizeWeight(0.4);
066:                getReportObjectSheetPanel().setResizeWeight(0.4);
067:
068:                MainFrame mf = MainFrame.getMainInstance();
069:                mf.addReportListener(this );
070:                mf.addReportFrameActivatedListener(this );
071:
072:                this .setCurrentMode(SHOW_NOTHING);
073:
074:            }
075:
076:            public JReportFrame getJReportFrame() {
077:                return jReportFrame;
078:            }
079:
080:            public void setJReportFrame(JReportFrame jReportFrame) {
081:
082:                if (this .jReportFrame != jReportFrame) {
083:                    this .jReportFrame = jReportFrame;
084:                    updateView();
085:                }
086:            }
087:
088:            public void updateView() {
089:                if (jReportFrame == null) {
090:                    setCurrentMode(SHOW_NOTHING);
091:                    return;
092:                }
093:
094:                if ((jReportFrame.getSelectedCrosstabEditorPanel() != null && jReportFrame
095:                        .getSelectedCrosstabEditorPanel().getSelectedElements()
096:                        .size() > 0)
097:                        || jReportFrame.getSelectedCrosstabEditorPanel() == null
098:                        && jReportFrame.getSelectedElements().size() > 0) {
099:                    setCurrentMode(SHOW_REPORTELEMENT_SHEET);
100:                } else if (jReportFrame.getSelectedObjects().size() > 0) {
101:                    setCurrentMode(SHOW_REPORTOBJECT_SHEET);
102:                } else if (jReportFrame.getSelectedBands().size() > 0) {
103:                    setCurrentMode(SHOW_BAND_SHEET);
104:                } else {
105:                    setCurrentMode(SHOW_DOCUMENT_SHEET);
106:                }
107:            }
108:
109:            /** This method is called from within the constructor to
110:             * initialize the form.
111:             * WARNING: Do NOT modify this code. The content of this method is
112:             * always regenerated by the Form Editor.
113:             */
114:            // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
115:            private void initComponents() {
116:
117:                setLayout(new java.awt.BorderLayout());
118:
119:            }// </editor-fold>//GEN-END:initComponents
120:
121:            // Variables declaration - do not modify//GEN-BEGIN:variables
122:            // End of variables declaration//GEN-END:variables
123:
124:            public void reportElementsSelectionChanged(
125:                    ReportElementsSelectionEvent evt) {
126:                updateView();
127:            }
128:
129:            public void reportBandsSelectionChanged(
130:                    ReportElementsSelectionEvent evt) {
131:                updateView();
132:            }
133:
134:            public void reportObjectsSelectionChanged(
135:                    ReportObjectsSelectionEvent evt) {
136:                updateView();
137:            }
138:
139:            public void reportElementsChanged(ReportElementChangedEvent evt) {
140:            }
141:
142:            public void reportBandChanged(ReportBandChangedEvent evt) {
143:            }
144:
145:            public void languageChanged(LanguageChangedEvent evt) {
146:            }
147:
148:            public void reportFrameActivated(ReportFrameActivatedEvent evt) {
149:
150:                this .setJReportFrame(evt.getReportFrame());
151:            }
152:
153:            public void reportBandsSelectionChanged(
154:                    ReportBandsSelectionEvent evt) {
155:                updateView();
156:            }
157:
158:            public int getCurrentMode() {
159:                return currentMode;
160:            }
161:
162:            public void setCurrentMode(int newMode) {
163:                if (newMode == currentMode)
164:                    return;
165:                else {
166:                    this .removeAll();
167:                    this .currentMode = newMode;
168:
169:                    switch (currentMode) {
170:                    case SHOW_NOTHING:
171:                        JLabel label = new JLabel(
172:                                it.businesslogic.ireport.util.I18n.getString(
173:                                        "properties", "Properties"));
174:                        label.setHorizontalAlignment(JLabel.CENTER);
175:                        this .add(label, BorderLayout.CENTER);
176:                        break;
177:                    case SHOW_DOCUMENT_SHEET:
178:                        this .add(getReportSheetPanel(), BorderLayout.CENTER);
179:                        break;
180:                    case SHOW_BAND_SHEET:
181:                        this 
182:                                .add(getReportBandSheetPanel(),
183:                                        BorderLayout.CENTER);
184:                        break;
185:                    case SHOW_REPORTELEMENT_SHEET:
186:                        this .add(getReportElementSheetPanel(),
187:                                BorderLayout.CENTER);
188:                        break;
189:                    case SHOW_REPORTOBJECT_SHEET:
190:                        this .add(getReportObjectSheetPanel(),
191:                                BorderLayout.CENTER);
192:                        break;
193:                    }
194:
195:                    this .updateUI();
196:                }
197:
198:            }
199:
200:            public ReportElementSheetPanel getReportElementSheetPanel() {
201:                return reportElementSheetPanel;
202:            }
203:
204:            public void setReportElementSheetPanel(
205:                    ReportElementSheetPanel reportElementSheetPanel) {
206:                this .reportElementSheetPanel = reportElementSheetPanel;
207:            }
208:
209:            public ReportBandSheetPanel getReportBandSheetPanel() {
210:                return reportBandSheetPanel;
211:            }
212:
213:            public void setReportBandSheetPanel(
214:                    ReportBandSheetPanel reportBandSheetPanel) {
215:                this .reportBandSheetPanel = reportBandSheetPanel;
216:            }
217:
218:            public ReportSheetPanel getReportSheetPanel() {
219:                return reportSheetPanel;
220:            }
221:
222:            public void setReportSheetPanel(ReportSheetPanel reportSheetPanel) {
223:                this .reportSheetPanel = reportSheetPanel;
224:            }
225:
226:            public ReportObjectSheetPanel getReportObjectSheetPanel() {
227:                return reportObjectSheetPanel;
228:            }
229:
230:            public void setReportObjectSheetPanel(
231:                    ReportObjectSheetPanel reportObjectSheetPanel) {
232:                this .reportObjectSheetPanel = reportObjectSheetPanel;
233:            }
234:
235:            public void setPropertyLabelError(String propertyName, String error) {
236:                switch (getCurrentMode()) {
237:                case SHOW_DOCUMENT_SHEET:
238:                    getReportSheetPanel().setPropertyLabelError(propertyName,
239:                            error);
240:                    break;
241:                case SHOW_BAND_SHEET:
242:                    getReportBandSheetPanel().setPropertyLabelError(
243:                            propertyName, error);
244:                    break;
245:                case SHOW_REPORTELEMENT_SHEET:
246:                    getReportElementSheetPanel().setPropertyLabelError(
247:                            propertyName, error);
248:                    break;
249:                case SHOW_REPORTOBJECT_SHEET:
250:                    getReportObjectSheetPanel().setPropertyLabelError(
251:                            propertyName, error);
252:                    break;
253:                }
254:            }
255:
256:            public void subDatasetObjectChanged(SubDatasetObjectChangedEvent evt) {
257:                if (getCurrentMode() == SHOW_REPORTOBJECT_SHEET
258:                        && getReportObjectSheetPanel().getSelection().contains(
259:                                evt.getNewValue())) {
260:                    // this prevent to update for an event generate by the
261:                    // ReportObjectSheetPanel itself
262:                    if (!getReportObjectSheetPanel().isInit()) {
263:                        getReportObjectSheetPanel().updateSelection();
264:                    }
265:                }
266:            }
267:
268:            public void reportSubDatasetChanged(ReportSubDatasetChangedEvent evt) {
269:                if (getCurrentMode() == SHOW_REPORTOBJECT_SHEET
270:                        && evt.getAction() == evt.CHANGED) {
271:                    boolean needUpdate = false;
272:                    if (getReportObjectSheetPanel().getSelection().contains(
273:                            evt.getSubDataset())) {
274:                        needUpdate = true;
275:                    }
276:
277:                    for (int i = 0; needUpdate == false
278:                            && i < evt.getElements().size(); ++i) {
279:                        if (getReportObjectSheetPanel().getSelection()
280:                                .contains(evt.getElements().get(i))) {
281:                            needUpdate = true;
282:                        }
283:                    }
284:
285:                    if (needUpdate) {
286:                        // this prevent to update for an event generate by the
287:                        // ReportObjectSheetPanel itself
288:                        if (!getReportObjectSheetPanel().isInit()) {
289:                            getReportObjectSheetPanel().updateSelection();
290:                        }
291:                    }
292:                }
293:            }
294:
295:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.