Source Code Cross Referenced for UserParametersCollection.java in  » Report » jmagallanes-1.0 » com » calipso » reportgenerator » userinterface » 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 » jmagallanes 1.0 » com.calipso.reportgenerator.userinterface 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.calipso.reportgenerator.userinterface;
002:
003:        import com.calipso.reportgenerator.reportdefinitions.types.FilterDefinitionFilterTypeType;
004:        import com.calipso.reportgenerator.common.LanguageTraslator;
005:        import com.calipso.reportgenerator.common.ReportSpec;
006:        import com.calipso.reportgenerator.common.ReportFilterSpec;
007:
008:        import java.util.*;
009:
010:        /**
011:         * Representa la coleccion de elementos editables
012:         */
013:
014:        public class UserParametersCollection {
015:
016:            private static final int FROM_TO = 0;
017:            private static final int FROM_QUANTITY = 1;
018:            private static final int VALUE = 2;
019:
020:            private ReportSpec reportSpec;
021:            private Vector userParametersCollection;
022:
023:            /**
024:             * Inicializa una instancia de UserParametersCollection
025:             * @param reportSpec Es necesario para la creacion de la coleccion
026:             */
027:            public UserParametersCollection(ReportSpec reportSpec) {
028:                this .reportSpec = reportSpec;
029:            }
030:
031:            /**
032:             * Llena un vector segun los parametros editables, que contiene objetos de tipo
033:             * UserPameterElement
034:             */
035:            private void fillVisibleFilterDefinitionsVector() {
036:                Collection filterCol = reportSpec.getEditFilterSpecs();
037:                for (Iterator filterColIterator = filterCol.iterator(); filterColIterator
038:                        .hasNext();) {
039:                    ReportFilterSpec filterDefinition = (ReportFilterSpec) filterColIterator
040:                            .next();
041:                    if (filterDefinition.getVisual()) {
042:                        switch (filterDefinition.getFilterType().getType()) {
043:                        case FilterDefinitionFilterTypeType.RANGE_TYPE:
044:                            userParametersCollection.add(initializeElement(
045:                                    FROM_TO, filterDefinition));
046:                            break;
047:                        case FilterDefinitionFilterTypeType.EQUALTO_TYPE:
048:                            userParametersCollection.add(initializeElement(
049:                                    VALUE, filterDefinition));
050:                            break;
051:                        case FilterDefinitionFilterTypeType.GREATERTHAN_TYPE:
052:                            userParametersCollection.add(initializeElement(
053:                                    VALUE, filterDefinition));
054:                            break;
055:                        case FilterDefinitionFilterTypeType.LESSTHAN_TYPE:
056:                            userParametersCollection.add(initializeElement(
057:                                    VALUE, filterDefinition));
058:                            break;
059:                        case FilterDefinitionFilterTypeType.BEGINWITH_TYPE:
060:                            userParametersCollection.add(initializeElement(
061:                                    VALUE, filterDefinition));
062:                            break;
063:                        case FilterDefinitionFilterTypeType.ENDWITH_TYPE:
064:                            userParametersCollection.add(initializeElement(
065:                                    VALUE, filterDefinition));
066:                            break;
067:                        case FilterDefinitionFilterTypeType.RANKING_TYPE:
068:                            userParametersCollection.add(initializeElement(
069:                                    VALUE, filterDefinition));
070:                            break; //TODO este sector nunca es utilizado
071:                        }
072:                    }
073:                }
074:            }
075:
076:            /**
077:             * Genera y devuelve un UserParameterElement dependiendo del tipo
078:             * @param type indica si es Range, Top, o value
079:             * @param filterDefinition FilterDefinition necesario para generar el UserParameterElement
080:             * @return UserParameterElement recientemente creado
081:             */
082:            private UserParameterElement initializeElement(int type,
083:                    ReportFilterSpec filterDefinition) {
084:                Hashtable values = new Hashtable();
085:                Vector keysOrder = new Vector();
086:                UserParameterElement userParameterElement = null;
087:                String description = reportSpec.getDimensionFromName(
088:                        filterDefinition.getDimensionName()).getCaption();
089:                String filterDefinitionName = filterDefinition.getName();
090:                switch (type) {
091:                case FROM_TO:
092:                    keysOrder.add(LanguageTraslator.traslate("146"));
093:                    keysOrder.add(LanguageTraslator.traslate("147"));
094:                    values.put(LanguageTraslator.traslate("146"), reportSpec
095:                            .getParamValues(false).get(
096:                                    filterDefinition.getName() + "FROM")
097:                            .toString());
098:                    values.put(LanguageTraslator.traslate("147"), reportSpec
099:                            .getParamValues(false).get(
100:                                    filterDefinition.getName() + "TO")
101:                            .toString());
102:                    userParameterElement = new UserParameterElement(
103:                            description, values, keysOrder,
104:                            filterDefinitionName, filterDefinition
105:                                    .getDimensionName(), reportSpec);
106:                    break;
107:                case FROM_QUANTITY:
108:                    keysOrder.add(LanguageTraslator.traslate("146"));
109:                    keysOrder.add(LanguageTraslator.traslate("149"));
110:                    values.put(LanguageTraslator.traslate("146"), reportSpec
111:                            .getParamValues(false).get(
112:                                    filterDefinition.getName() + "FROM")
113:                            .toString());
114:                    values.put(LanguageTraslator.traslate("149"), reportSpec
115:                            .getParamValues(false).get(
116:                                    filterDefinition.getName() + "QUANTITY")
117:                            .toString());
118:                    userParameterElement = new UserParameterElement(
119:                            description, values, keysOrder,
120:                            filterDefinitionName, filterDefinition
121:                                    .getDimensionName(), reportSpec);
122:                    break;
123:                case VALUE:
124:                    keysOrder.add(LanguageTraslator.traslate("150"));
125:                    values.put(LanguageTraslator.traslate("150"), reportSpec
126:                            .getParamValues(false).get(
127:                                    filterDefinition.getName() + "VALUE")
128:                            .toString());
129:                    userParameterElement = new UserParameterElement(
130:                            description, values, keysOrder,
131:                            filterDefinitionName, filterDefinition
132:                                    .getDimensionName(), reportSpec);
133:                    break;
134:                }
135:                return userParameterElement;
136:            }
137:
138:            /**
139:             * Crea un Vector y lo inicializa con los UserParameterElement determinados
140:             * @return
141:             */
142:            public Vector getUserParametersCollection() {
143:                if (userParametersCollection == null) {
144:                    userParametersCollection = new Vector();
145:                    fillVisibleFilterDefinitionsVector();
146:                }
147:                return userParametersCollection;
148:            }
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.