Source Code Cross Referenced for ParameterField.java in  » Report » datavision-1.1.0 » jimm » datavision » field » 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 » datavision 1.1.0 » jimm.datavision.field 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package jimm.datavision.field;
002:
003:        import jimm.datavision.Report;
004:        import jimm.datavision.Section;
005:        import jimm.datavision.Parameter;
006:        import jimm.datavision.gui.FieldWidget;
007:        import jimm.datavision.gui.ParameterWidget;
008:        import jimm.datavision.gui.SectionWidget;
009:        import java.util.Observer;
010:        import java.util.Observable;
011:
012:        /**
013:         * A parameter field represents a parameter. The value of a parameter field
014:         * holds a {@link Parameter} object. In the XML, the parameter field's value
015:         * is the id of the parameter.
016:         *
017:         * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
018:         */
019:        public class ParameterField extends Field implements  Observer {
020:
021:            protected Parameter parameter;
022:
023:            /**
024:             * Constructs a parameter field with the specified id in the specified report
025:             * section whose {@link Parameter}'s id is <i>value</i>.
026:             *
027:             * @param id the new field's id
028:             * @param report the report containing this element
029:             * @param section the report section in which the field resides
030:             * @param value the id of a parameter
031:             * @param visible show/hide flag
032:             */
033:            public ParameterField(Long id, Report report, Section section,
034:                    Object value, boolean visible) {
035:                super (id, report, section, value, visible);
036:                parameter = report.findParameter(value);
037:                parameter.addObserver(this );
038:            }
039:
040:            protected void finalize() throws Throwable {
041:                parameter.deleteObserver(this );
042:                super .finalize();
043:            }
044:
045:            public void update(Observable o, Object arg) {
046:                setChanged();
047:                notifyObservers(arg);
048:            }
049:
050:            public FieldWidget makeWidget(SectionWidget sw) {
051:                return new ParameterWidget(sw, this );
052:            }
053:
054:            /**
055:             * Not really used; we drag parameters, not parameter fields.
056:             */
057:            public String dragString() {
058:                return typeString() + ":" + parameter.getId();
059:            }
060:
061:            /**
062:             * Returns the parameter.
063:             *
064:             * @return the parameter
065:             */
066:            public Parameter getParameter() {
067:                return parameter;
068:            }
069:
070:            /**
071:             * Sets the parameter.
072:             *
073:             * @param newParameter the new parameter
074:             */
075:            public void setParameter(Parameter newParameter) {
076:                if (parameter != newParameter) {
077:                    parameter.deleteObserver(this );
078:                    parameter = newParameter;
079:                    parameter.addObserver(this );
080:                    setChanged();
081:                    notifyObservers();
082:                }
083:            }
084:
085:            public String typeString() {
086:                return "parameter";
087:            }
088:
089:            public String designLabel() {
090:                return parameter.designLabel();
091:            }
092:
093:            public String formulaString() {
094:                return parameter.formulaString();
095:            }
096:
097:            public boolean refersTo(Parameter p) {
098:                return parameter == p;
099:            }
100:
101:            /**
102:             * This override returns <code>true</code> if this parameter is in a detail
103:             * section and returns a number.
104:             *
105:             * @return <code>true</code> if this field can be aggregated
106:             */
107:            public boolean canBeAggregated() {
108:                // Section can be null during dragging.
109:                return section != null && section.isDetail()
110:                        && getParameter().getType() == Parameter.TYPE_NUMERIC;
111:            }
112:
113:            /**
114:             * Returns the value of this field. For parameter fields, this is the
115:             * value generated by evaluating the {@link Parameter}.
116:             *
117:             * @return the result of evaluating the parameter
118:             */
119:            public Object getValue() {
120:                return parameter.getValue();
121:            }
122:
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.