Source Code Cross Referenced for WindowActivationChange.java in  » Testing » jacareto » jacareto » struct » 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 » Testing » jacareto » jacareto.struct 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Jacareto Copyright (c) 2002-2005
003:         * Applied Computer Science Research Group, Darmstadt University of
004:         * Technology, Institute of Mathematics & Computer Science,
005:         * Ludwigsburg University of Education, and Computer Based
006:         * Learning Research Group, Aachen University. All rights reserved.
007:         *
008:         * Jacareto is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public
010:         * License as published by the Free Software Foundation; either
011:         * version 2 of the License, or (at your option) any later version.
012:         *
013:         * Jacareto is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
016:         * General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU General Public
019:         * License along with Jacareto; if not, write to the Free
020:         * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021:         *
022:         */
023:
024:        package jacareto.struct;
025:
026:        import jacareto.parse.RecordTokenizer;
027:        import jacareto.parse.RecordTokenizerState;
028:        import jacareto.system.Environment;
029:
030:        /**
031:         * One window has been deactivated, and another has been activated .
032:         *
033:         * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
034:         * @version 1.01
035:         */
036:        public class WindowActivationChange extends StructureElement {
037:            /** The name of the old window. */
038:            private String oldWindowName;
039:
040:            /** The name of the new window. */
041:            private String newWindowName;
042:
043:            /** The title of the old window. */
044:            private String oldWindowTitle;
045:
046:            /** The title of the new window. */
047:            private String newWindowTitle;
048:
049:            /**
050:             * Creates a new "window activation change" structure element. The first child must be a
051:             * WindowDeactivation, the second a WindowActivation structure element.
052:             *
053:             * @param env the environment
054:             * @param children the child structure elements
055:             */
056:            public WindowActivationChange(Environment env,
057:                    StructureElement[] children) {
058:                super (env, children);
059:                this .oldWindowName = ((WindowDeactivation) children[0])
060:                        .getWindowName();
061:                this .newWindowName = ((WindowActivation) children[1])
062:                        .getWindowName();
063:                this .oldWindowTitle = ((WindowDeactivation) children[0])
064:                        .getWindowTitle();
065:                this .newWindowTitle = ((WindowActivation) children[1])
066:                        .getWindowTitle();
067:            }
068:
069:            /**
070:             * Creates a new "window activation change" structure element.
071:             *
072:             * @param env the environment
073:             * @param children the child structure elements
074:             * @param oldWindowName the name of the deactivated window
075:             * @param newWindowName the name of the activated window
076:             * @param oldWindowTitle the title of the deactivated window
077:             * @param newWindowTitle the title of the activated window
078:             */
079:            public WindowActivationChange(Environment env,
080:                    StructureElement[] children, String oldWindowName,
081:                    String newWindowName, String oldWindowTitle,
082:                    String newWindowTitle) {
083:                super (env, children);
084:                this .oldWindowName = oldWindowName;
085:                this .newWindowName = newWindowName;
086:                this .oldWindowTitle = oldWindowTitle;
087:                this .newWindowTitle = newWindowTitle;
088:            }
089:
090:            /**
091:             * Parses a record which is tokenized by the given record tokenizer.
092:             *
093:             * @param env DOCUMENT ME!
094:             * @param recordTokenizer the record tokenizer
095:             *
096:             * @return a structure element, or <code>null</code> if this class cannot parse the record at
097:             *         the current position
098:             */
099:            public static StructureElement parse(Environment env,
100:                    RecordTokenizer recordTokenizer) {
101:                StructureElement result = null;
102:                StructureElement[] children = null;
103:
104:                RecordTokenizerState rtState = recordTokenizer.saveState();
105:
106:                try {
107:                    WindowDeactivation deactivation = (WindowDeactivation) WindowDeactivation
108:                            .parse(env, recordTokenizer);
109:                    WindowActivation activation = (WindowActivation) WindowActivation
110:                            .parse(env, recordTokenizer);
111:
112:                    if ((deactivation != null) && (activation != null)) {
113:                        children = new StructureElement[2];
114:                        children[0] = deactivation;
115:                        children[1] = activation;
116:
117:                        //result = new WindowActivationChange (env, children);
118:                        result = new WindowActivationChange(env, children,
119:                                deactivation.getWindowName(), activation
120:                                        .getWindowName(), deactivation
121:                                        .getWindowTitle(), activation
122:                                        .getWindowTitle());
123:                    } else {
124:                        throw new Exception();
125:                    }
126:                } catch (Throwable t) {
127:                    recordTokenizer.restoreState(rtState);
128:                }
129:
130:                return result;
131:            }
132:
133:            /**
134:             * Returns the name of the element.
135:             *
136:             * @return the name
137:             */
138:            public String getElementName() {
139:                return language
140:                        .getString("Structures.WindowActivationChange.Name");
141:            }
142:
143:            /**
144:             * Returns a description of the element.
145:             *
146:             * @return the description
147:             */
148:            public String getElementDescription() {
149:                return language
150:                        .getString("Structures.WindowActivationChange.Description");
151:            }
152:
153:            /**
154:             * Returns a String which describes the content of the element shortly.
155:             *
156:             * @return a string with a short description of the element
157:             */
158:            public String toShortString() {
159:                String result = getElementName();
160:
161:                if (newWindowName != null) {
162:                    String windowIdentifier = (((newWindowTitle == null) || newWindowTitle
163:                            .equals("")) ? newWindowName : newWindowTitle);
164:                    String insertedText = ((windowIdentifier.length() < 40) ? windowIdentifier
165:                            : (windowIdentifier.substring(0, 37) + "..."));
166:                    result += (" (->" + insertedText + ")");
167:                }
168:
169:                return result;
170:            }
171:
172:            /**
173:             * Returns the name of the deactivated window.
174:             *
175:             * @return DOCUMENT ME!
176:             */
177:            public String getOldWindowName() {
178:                return oldWindowName;
179:            }
180:
181:            /**
182:             * Returns the name of the activated window.
183:             *
184:             * @return DOCUMENT ME!
185:             */
186:            public String getNewWindowName() {
187:                return newWindowName;
188:            }
189:
190:            /**
191:             * Returns the title of the deactivated window.
192:             *
193:             * @return DOCUMENT ME!
194:             */
195:            public String getOldWindowTitle() {
196:                return oldWindowTitle;
197:            }
198:
199:            /**
200:             * Returns the title of the activated window.
201:             *
202:             * @return DOCUMENT ME!
203:             */
204:            public String getNewWindowTitle() {
205:                return newWindowTitle;
206:            }
207:
208:            /**
209:             * Clones the element.
210:             *
211:             * @return DOCUMENT ME!
212:             */
213:            public Object clone() {
214:                StructureElement[] clonedChildren = getClonedChildren();
215:
216:                return new WindowActivationChange(env, clonedChildren,
217:                        oldWindowName, newWindowName, oldWindowTitle,
218:                        newWindowTitle);
219:            }
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.