Source Code Cross Referenced for VAIBuilderModel.java in  » Installer » VAInstall » com » memoire » vainstall » builder » 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 » Installer » VAInstall » com.memoire.vainstall.builder 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $RCSfile: VAIBuilderModel.java,v $
003:         * @modification $Date: 2001/09/28 19:27:49 $
004:         * @version      $Id: VAIBuilderModel.java,v 1.1 2001/09/28 19:27:49 hfalk Exp $
005:         *
006:         */
007:
008:        package com.memoire.vainstall.builder;
009:
010:        import com.memoire.vainstall.builder.event.*;
011:        import com.memoire.vainstall.builder.util.*;
012:
013:        import java.util.Hashtable;
014:        import java.util.LinkedList;
015:
016:        import javax.swing.event.EventListenerList;
017:
018:        /**
019:         * This is the VAIBuilder data model
020:         *
021:         * @see javax.swing.event.EventListenerList
022:         *
023:         * @author Henrik Falk
024:         * @version $Id: VAIBuilderModel.java,v 1.1 2001/09/28 19:27:49 hfalk Exp $
025:         */
026:        public class VAIBuilderModel {
027:
028:            /**
029:             *  The list of listenere that are interested in changes in
030:             *  the data model
031:             */
032:            EventListenerList listenerList = new EventListenerList();
033:
034:            /**
035:             * The persistance class for this model
036:             */
037:            BuilderPersisterInterface builderPersister;
038:
039:            /**
040:             * list of windows and bounds in the format <name, Rectangle>
041:             */
042:            Hashtable windowList = new Hashtable();
043:
044:            /**
045:             * list of previous opened projects
046:             */
047:            LinkedList lastOpenedProjectList = new LinkedList();
048:
049:            /**
050:             * list of properties in the format <name,String value>
051:             */
052:            Hashtable propertyList = new Hashtable();
053:
054:            /**
055:             * Default constructor
056:             */
057:            public VAIBuilderModel() {
058:                super ();
059:
060:                try {
061:                    if (System.getProperty("java.version").indexOf("1.4.") != -1) {
062:                        builderPersister = (BuilderPersisterInterface) Class
063:                                .forName(
064:                                        "com.memoire.vainstall.builder.util.JavaBuilderPersister")
065:                                .newInstance();
066:                    } else {
067:                        builderPersister = (BuilderPersisterInterface) Class
068:                                .forName(
069:                                        "com.memoire.vainstall.builder.util.NanoBuilderPersister")
070:                                .newInstance();
071:                    }
072:
073:                    builderPersister.initialize(this );
074:
075:                    // add proper exception handling
076:                } catch (InstantiationException exc) {
077:                } catch (ClassNotFoundException exc) {
078:                } catch (IllegalAccessException exc) {
079:                }
080:
081:            }
082:
083:            /**
084:             * @param e VAIBuilderEvent
085:             */
086:            public void fireVAIBuilderEvent(VAIBuilderEvent e) {
087:
088:                // guaranteed to return a non-null array
089:                Object[] listeners = listenerList.getListenerList();
090:
091:                // process the listeners last to first, notifying
092:                // those that are interested in this event
093:                for (int i = listeners.length - 2; i >= 0; i -= 2) {
094:                    if (listeners[i] == com.memoire.vainstall.builder.event.VAIBuilderListener.class) {
095:                        ((com.memoire.vainstall.builder.event.VAIBuilderListener) listeners[i + 1])
096:                                .builderChanged(e);
097:                    }
098:                }
099:            }
100:
101:            /**
102:             * @param l com.memoire.vainstall.builder.event.VAIBuilderListener
103:             */
104:            public void addVAIBuilderListener(
105:                    com.memoire.vainstall.builder.event.VAIBuilderListener l) {
106:                listenerList
107:                        .add(
108:                                com.memoire.vainstall.builder.event.VAIBuilderListener.class,
109:                                l);
110:            }
111:
112:            /**
113:             * @param l com.memoire.vainstall.builder.event.VAIBuilderListener
114:             */
115:            public void removeVAIBuilderListener(
116:                    com.memoire.vainstall.builder.event.VAIBuilderListener l) {
117:                listenerList
118:                        .remove(
119:                                com.memoire.vainstall.builder.event.VAIBuilderListener.class,
120:                                l);
121:            }
122:
123:            /**
124:             * load data from datastore
125:             */
126:            public void load() {
127:
128:                builderPersister.load(); // add exception handling
129:
130:                fireVAIBuilderEvent(new VAIBuilderEvent(this ,
131:                        VAIBuilderEvent.PREFERENCES_LOADED));
132:            }
133:
134:            /**
135:             * save data to datastore
136:             */
137:            public void save() {
138:
139:                builderPersister.save(); // add exception handling
140:
141:                fireVAIBuilderEvent(new VAIBuilderEvent(this ,
142:                        VAIBuilderEvent.PREFERENCES_SAVED));
143:            }
144:
145:            /**
146:             * Returns the list of windows who has registrered bounds
147:             * @return The list of window bounds
148:             */
149:            public Hashtable getWindowList() {
150:                return windowList;
151:            }
152:
153:            /**
154:             * Returns the list of last opened projects
155:             * @return a linked list of strings
156:             */
157:            public LinkedList getLastOpenedProjectList() {
158:                return lastOpenedProjectList;
159:            }
160:
161:            /**
162:             * Add a filename to the list of last opened projects
163:             * @param filename the fully qualified name of the project file
164:             */
165:            public void addLastOpenedProject(String filename) {
166:
167:                // if found in list
168:                int pos = lastOpenedProjectList.indexOf(filename);
169:                if (pos != -1) {
170:                    lastOpenedProjectList.remove(pos);
171:                    lastOpenedProjectList.addFirst(filename);
172:                } else {
173:
174:                    if (lastOpenedProjectList.size() < 5) {
175:                        lastOpenedProjectList.addFirst(filename);
176:                    } else {
177:                        lastOpenedProjectList.removeLast();
178:                        lastOpenedProjectList.addFirst(filename);
179:                    }
180:                }
181:                fireVAIBuilderEvent(new VAIBuilderEvent(this ,
182:                        VAIBuilderEvent.LASTFILELIST_CHANGED));
183:            }
184:
185:            /**
186:             * Convenience method to access properties directly
187:             * @return a list of builder properties
188:             */
189:            public Hashtable getPropertyList() {
190:                return propertyList;
191:            }
192:
193:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.