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


001:        package jimm.datavision.gui.parameter;
002:
003:        import jimm.datavision.Parameter;
004:        import jimm.util.I18N;
005:        import javax.swing.*;
006:
007:        /**
008:         * An inquisitor knows how to display and control the widgets needed
009:         * to ask a user for parameter values. Inquisitors are used in
010:         * {@link ParamAskWin}s.
011:         *
012:         * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
013:         */
014:        abstract class Inquisitor {
015:
016:            protected static final int TEXT_FIELD_COLS = 24;
017:
018:            protected static int instanceCount;
019:            protected Parameter parameter;
020:            protected JPanel panel;
021:            protected String panelName;
022:
023:            /**
024:             * This factory method returns the proper inquisitor for the specified
025:             * parameter.
026:             *
027:             * @param param a parameter
028:             */
029:            public static Inquisitor create(Parameter param) {
030:                if (!param.isLegal(param.getType(), param.getArity())) {
031:                    // Should not happen
032:                    String str = I18N.get("Inquisitor.param_cap") + ' '
033:                            + param.getName() + ' '
034:                            + I18N.get("Inquisitor.illegal");
035:                    throw new IllegalArgumentException(str);
036:                }
037:
038:                switch (param.getType()) {
039:                case Parameter.TYPE_BOOLEAN:
040:                    return new BoolInq(param);
041:                case Parameter.TYPE_STRING:
042:                    switch (param.getArity()) {
043:                    case Parameter.ARITY_ONE:
044:                        return new SingleStringInq(param);
045:                    case Parameter.ARITY_RANGE:
046:                        return new RangeStringInq(param);
047:                    case Parameter.ARITY_LIST_SINGLE:
048:                        return new ListStringInq(param, false);
049:                    case Parameter.ARITY_LIST_MULTIPLE:
050:                        return new ListStringInq(param, true);
051:                    }
052:                    break;
053:                case Parameter.TYPE_NUMERIC:
054:                    switch (param.getArity()) {
055:                    case Parameter.ARITY_ONE:
056:                        return new SingleNumericInq(param);
057:                    case Parameter.ARITY_RANGE:
058:                        return new RangeNumericInq(param);
059:                    case Parameter.ARITY_LIST_SINGLE:
060:                        return new ListNumericInq(param, false);
061:                    case Parameter.ARITY_LIST_MULTIPLE:
062:                        return new ListNumericInq(param, true);
063:                    }
064:                    break;
065:                case Parameter.TYPE_DATE:
066:                    switch (param.getArity()) {
067:                    case Parameter.ARITY_ONE:
068:                        return new SingleDateInq(param);
069:                    case Parameter.ARITY_RANGE:
070:                        return new RangeDateInq(param);
071:                    }
072:                    break;
073:                }
074:                return null; // Not reached
075:            }
076:
077:            /**
078:             * Constructor.
079:             *
080:             * @param param the parameter we're going to edit
081:             */
082:            Inquisitor(Parameter param) {
083:                parameter = param;
084:                panel = new JPanel();
085:                panel
086:                        .setBorder(BorderFactory.createEmptyBorder(20, 20, 20,
087:                                20));
088:                panelName = "" + instanceCount++;
089:            }
090:
091:            JPanel getPanel() {
092:                return panel;
093:            }
094:
095:            String getPanelName() {
096:                return panelName;
097:            }
098:
099:            /**
100:             * Copy all values from our GUI widgets into the parameter's value(s).
101:             */
102:            abstract void copyGUIIntoParam();
103:
104:            /**
105:             * Copy all values from parameter's value(s) into our GUI widgets.
106:             */
107:            abstract void copyParamIntoGUI();
108:
109:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.