Source Code Cross Referenced for ReportHeader.java in  » Content-Management-System » harmonise » org » openharmonise » him » editors » report » 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 » Content Management System » harmonise » org.openharmonise.him.editors.report 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the 
003:         * Mozilla Public License Version 1.1 (the "License"); 
004:         * you may not use this file except in compliance with the License. 
005:         * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
009:         * See the License for the specific language governing rights and 
010:         * limitations under the License.
011:         *
012:         * The Initial Developer of the Original Code is Simulacra Media Ltd.
013:         * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014:         *
015:         * All Rights Reserved.
016:         *
017:         * Contributor(s):
018:         */
019:        package org.openharmonise.him.editors.report;
020:
021:        import java.awt.*;
022:        import java.awt.event.*;
023:
024:        import javax.swing.*;
025:
026:        import org.openharmonise.him.*;
027:        import org.openharmonise.him.editors.report.rqom.*;
028:        import org.openharmonise.him.editors.report.swing.*;
029:        import org.openharmonise.him.harmonise.*;
030:        import org.openharmonise.swing.datefield.*;
031:        import org.openharmonise.vfs.*;
032:        import org.openharmonise.vfs.servers.ServerList;
033:
034:        /**
035:         * Panel for the header of the report editor. This covers the scope of the
036:         * report defined by a collection.
037:         * 
038:         * @author Matthew Large
039:         * @version $Revision: 1.1 $
040:         *
041:         */
042:        public class ReportHeader extends JPanel implements  LayoutManager,
043:                DateFieldListener,/*ChangeListener,*/ActionListener {
044:
045:            /**
046:             * Report query.
047:             */
048:            private ReportQuery m_reportQuery = null;
049:
050:            /**
051:             * Label for path field.
052:             */
053:            private JLabel m_pathLabel = null;
054:
055:            /**
056:             * Path selector.
057:             */
058:            private JComboTree m_pathCombo = null;
059:
060:            /**
061:             * Label for period.
062:             */
063:            private JLabel m_periodLabel = null;
064:
065:            /**
066:             * Label for from field.
067:             */
068:            private JLabel m_fromLabel = null;
069:
070:            /**
071:             * From field.
072:             */
073:            private JDateField m_fromDateField = null;
074:
075:            /**
076:             * Label for to field.
077:             */
078:            private JLabel m_toLabel = null;
079:
080:            /**
081:             * To field.
082:             */
083:            private JDateField m_toDateField = null;
084:
085:            /**
086:             * Panel for border.
087:             */
088:            private JPanel m_borderPanel = null;
089:
090:            /**
091:             * Height of panel.
092:             */
093:            private int m_nHeight = 30;
094:
095:            /**
096:             * Constructs a new report header.
097:             * 
098:             * @param query Report query
099:             */
100:            public ReportHeader(ReportQuery query) {
101:                super ();
102:                this .m_reportQuery = query;
103:                this .setup();
104:            }
105:
106:            /**
107:             * Configures this component.
108:             *
109:             */
110:            private void setup() {
111:                this .setLayout(this );
112:
113:                AbstractVirtualFileSystem vfs = ServerList.getInstance()
114:                        .getHarmoniseServer().getVFS();
115:
116:                String fontName = "Dialog";
117:                int fontSize = 11;
118:                Font font = new Font(fontName, Font.PLAIN, fontSize);
119:
120:                this .m_pathLabel = new JLabel("Resources from");
121:                this .m_pathLabel.setFont(font);
122:                this .add(m_pathLabel);
123:
124:                this .m_pathCombo = new JComboTree();
125:                this .m_pathCombo.setShowLeafNodes(false);
126:                this .m_pathCombo.setAllowClear(false);
127:                this .m_pathCombo
128:                        .addCollectionPath(HarmonisePaths.PATH_DOCUMENTS);
129:                this .m_pathCombo.addCollectionPath(HarmonisePaths.PATH_ASSETS);
130:                this .m_pathCombo.addCollectionPath(HarmonisePaths.PATH_USERS);
131:                this .m_pathCombo
132:                        .addCollectionPath(HarmonisePaths.PATH_PROPERTIES);
133:                this .m_pathCombo.addCollectionPath(HarmonisePaths.PATH_VALUES);
134:                this .m_pathCombo
135:                        .addCollectionPath(HarmonisePaths.PATH_COMPOSITION);
136:                this .m_pathCombo.addCollectionPath(HarmonisePaths.PATH_XSLT);
137:                this .m_pathCombo
138:                        .addCollectionPath(HarmonisePaths.PATH_SITE_ASSETS);
139:                this .m_pathCombo
140:                        .addCollectionPath(HarmonisePaths.PATH_PAGE_DEFINITION);
141:                this .m_pathCombo.setPath(vfs, this .m_reportQuery.getPath());
142:                this .m_pathCombo.addActionListener(this );
143:                this .m_pathCombo.setActionCommand("PATHCOMBO");
144:                this .add(this .m_pathCombo);
145:
146:                this .m_pathCombo.setScopeEnabled(m_reportQuery
147:                        .isReportPanelEditable());
148:            }
149:
150:            /* (non-Javadoc)
151:             * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
152:             */
153:            public void actionPerformed(ActionEvent ae) {
154:                if (ae.getActionCommand().equals("PATHCOMBO")) {
155:                    this .m_reportQuery.setPath(this .m_pathCombo.getPath());
156:                }
157:            }
158:
159:            /* (non-Javadoc)
160:             * @see java.awt.LayoutManager#layoutContainer(java.awt.Container)
161:             */
162:            public void layoutContainer(Container arg0) {
163:                int nHeight = 10;
164:
165:                this .m_pathLabel.setSize(this .m_pathLabel.getPreferredSize());
166:                this .m_pathLabel.setLocation(10, nHeight);
167:
168:                this .m_pathCombo.setSize(this .m_pathCombo.getPreferredSize());
169:                this .m_pathCombo.setLocation(100, nHeight - 3);
170:
171:                nHeight = nHeight + this .m_pathLabel.getSize().height + 5;
172:            }
173:
174:            /* (non-Javadoc)
175:             * @see java.awt.Component#getPreferredSize()
176:             */
177:            public Dimension getPreferredSize() {
178:                return new Dimension(700, m_nHeight);
179:            }
180:
181:            /**
182:             * 
183:             */
184:            private ReportHeader() {
185:                super ();
186:            }
187:
188:            /**
189:             * @param arg0
190:             */
191:            private ReportHeader(boolean arg0) {
192:                super (arg0);
193:            }
194:
195:            /**
196:             * @param arg0
197:             */
198:            private ReportHeader(LayoutManager arg0) {
199:                super (arg0);
200:            }
201:
202:            /**
203:             * @param arg0
204:             * @param arg1
205:             */
206:            private ReportHeader(LayoutManager arg0, boolean arg1) {
207:                super (arg0, arg1);
208:            }
209:
210:            /* (non-Javadoc)
211:             * @see java.awt.LayoutManager#removeLayoutComponent(java.awt.Component)
212:             */
213:            public void removeLayoutComponent(Component arg0) {
214:            }
215:
216:            /* (non-Javadoc)
217:             * @see java.awt.LayoutManager#addLayoutComponent(java.lang.String, java.awt.Component)
218:             */
219:            public void addLayoutComponent(String arg0, Component arg1) {
220:            }
221:
222:            /* (non-Javadoc)
223:             * @see java.awt.LayoutManager#minimumLayoutSize(java.awt.Container)
224:             */
225:            public Dimension minimumLayoutSize(Container arg0) {
226:                return this .getPreferredSize();
227:            }
228:
229:            /* (non-Javadoc)
230:             * @see java.awt.LayoutManager#preferredLayoutSize(java.awt.Container)
231:             */
232:            public Dimension preferredLayoutSize(Container arg0) {
233:                return this .getPreferredSize();
234:            }
235:
236:            /* (non-Javadoc)
237:             * @see com.simulacramedia.swing.datefield.DateFieldListener#validationFailed(com.simulacramedia.swing.datefield.JDateField, int)
238:             */
239:            public void validationFailed(JDateField source, int nReason) {
240:            }
241:
242:            /* (non-Javadoc)
243:             * @see com.simulacramedia.swing.datefield.DateFieldListener#valueChanged(com.simulacramedia.swing.datefield.JDateField)
244:             */
245:            public void valueChanged(JDateField source) {
246:                if (source == this .m_fromDateField) {
247:                    this .m_reportQuery.setPeriodFrom(this .m_fromDateField
248:                            .getDate());
249:                } else if (source == this .m_toDateField) {
250:                    this .m_reportQuery
251:                            .setPeriodTo(this .m_toDateField.getDate());
252:                }
253:            }
254:
255:            public void setScopeEnabled(boolean isEnabled) {
256:                this.m_pathCombo.setScopeEnabled(isEnabled);
257:            }
258:
259:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.