Source Code Cross Referenced for ConfigProperty.java in  » Development » jgap » org » jgap » data » config » 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 » Development » jgap » org.jgap.data.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of JGAP.
003:         *
004:         * JGAP offers a dual license model containing the LGPL as well as the MPL.
005:         *
006:         * For licensing information please see the file license.txt included with JGAP
007:         * or have a look at the top of class org.jgap.Chromosome which representatively
008:         * includes the JGAP license policy applicable for any file delivered with JGAP.
009:         */
010:        package org.jgap.data.config;
011:
012:        import java.util.*;
013:
014:        /**
015:         * Represents a property to be shown on the configuration screen.
016:         *
017:         * @author Siddhartha Azad
018:         * @since 2.3
019:         */
020:        public class ConfigProperty {
021:            /** String containing the CVS revision. Read out via reflection!*/
022:            private final static String CVS_REVISION = "$Revision: 1.5 $";
023:
024:            // name of the property
025:            private String m_name;
026:
027:            // widget to use to get the value of this property
028:            private String m_widget;
029:
030:            // label with which to display this property
031:            private String m_label;
032:
033:            // allowed values for this property (if applicable)
034:            private List m_values;
035:
036:            /**
037:             * Default Constructor for a ConfigProperty.
038:             *
039:             * @author Siddhartha Azad
040:             * @since 2.3
041:             */
042:            public ConfigProperty() {
043:                // defaults
044:                m_name = "";
045:                m_label = "";
046:                m_widget = "JTextField";
047:                m_values = Collections.synchronizedList(new ArrayList());
048:            }
049:
050:            /**
051:             * @return name associated with this property
052:             *
053:             * @author Siddhartha Azad
054:             * @since 2.3
055:             */
056:            public String getName() {
057:                return m_name;
058:            }
059:
060:            /**
061:             * Setter for the name of this property.
062:             * @param a_name the name associated with this property. This name will be
063:             * used as the key in the properties file for persisting
064:             * configuration information
065:             *
066:             * @author Siddhartha Azad
067:             * @since 2.3
068:             */
069:            public void setName(final String a_name) {
070:                m_name = a_name;
071:                // by default display label is same as the name
072:                if (m_label.equals("")) {
073:                    m_label = a_name;
074:                }
075:            }
076:
077:            /**
078:             * @return name of the widget associated with this property
079:             *
080:             * @author Siddhartha Azad
081:             * @since 2.3
082:             */
083:            public String getWidget() {
084:                return m_widget;
085:            }
086:
087:            /**
088:             * Sets the widget.
089:             * @param a_widget either "JList" or "JTextField" for now
090:             *
091:             * @author Siddhartha Azad
092:             * @since 2.3
093:             */
094:            public void setWidget(final String a_widget) {
095:                m_widget = a_widget;
096:            }
097:
098:            /**
099:             * @return label of the property
100:             *
101:             * @author Siddhartha Azad
102:             * @since 2.4
103:             */
104:            public String getLabel() {
105:                return m_label;
106:            }
107:
108:            /**
109:             * Sets the label.
110:             * @param a_label the label of this property, by default the same as the
111:             * name of the property
112:             *
113:             * @author Siddhartha Azad
114:             * @since 2.4
115:             */
116:            public void setLabel(final String a_label) {
117:                m_label = a_label;
118:            }
119:
120:            /**
121:             * Add a value into the values ArrayList. These values are added in case the
122:             * display component is a ListBox or ComboBox or something that can have
123:             * multiple values.
124:             * @param a_value the value to add
125:             *
126:             * @author Siddhartha Azad
127:             * @since 2.3
128:             */
129:            public void addValue(final String a_value) {
130:                m_values.add(a_value);
131:            }
132:
133:            /**
134:             * @return iterator on the values ArrayList for this property
135:             *
136:             * @author Siddhartha Azad
137:             * @since 2.3
138:             */
139:            public Iterator getValuesIter() {
140:                return m_values.iterator();
141:            }
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.