Source Code Cross Referenced for MouseChangedComponent.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:         * The mouse pointer has exited one and entered another component. A structure element can parse a
032:         * part of a record.
033:         *
034:         * @author <a href="mailto:cspannagel@web.de">Christian Spannagel</a>
035:         * @version 1.0
036:         */
037:        public class MouseChangedComponent extends StructureElement {
038:            /** The name of the old component. */
039:            private String oldComponent;
040:
041:            /** The name of the new component. */
042:            private String newComponent;
043:
044:            /**
045:             * Creates a new "mouse changed component" structure element. The first child must be a mouse
046:             * entered, the last a mouse exited event recordable
047:             *
048:             * @param env the environment
049:             * @param children the child structure elements
050:             */
051:            public MouseChangedComponent(Environment env,
052:                    StructureElement[] children) {
053:                super (env, children);
054:                oldComponent = ((MouseExited) children[0]).getComponentName();
055:                newComponent = ((MouseEntered) children[children.length - 1])
056:                        .getComponentName();
057:            }
058:
059:            /**
060:             * Creates a new "mouse changed component" structure element.
061:             *
062:             * @param env the environment
063:             * @param children the child structure elements
064:             * @param oldComponent DOCUMENT ME!
065:             * @param newComponent DOCUMENT ME!
066:             */
067:            public MouseChangedComponent(Environment env,
068:                    StructureElement[] children, String oldComponent,
069:                    String newComponent) {
070:                super (env, children);
071:                this .oldComponent = oldComponent;
072:                this .newComponent = newComponent;
073:            }
074:
075:            /**
076:             * Parses a record which is tokenized by the given record tokenizer.
077:             *
078:             * @param env DOCUMENT ME!
079:             * @param recordTokenizer the record tokenizer
080:             *
081:             * @return a structure element, or <code>null</code> if this class cannot parse the record at
082:             *         the current position
083:             */
084:            public static StructureElement parse(Environment env,
085:                    RecordTokenizer recordTokenizer) {
086:                StructureElement result = null;
087:
088:                RecordTokenizerState rtState = recordTokenizer.saveState();
089:
090:                try {
091:                    StructureElement exited = MouseExited.parse(env,
092:                            recordTokenizer);
093:                    StructureElement motion = MouseMotion.parse(env,
094:                            recordTokenizer);
095:                    StructureElement entered = MouseEntered.parse(env,
096:                            recordTokenizer);
097:
098:                    if ((exited != null) && (entered != null)) {
099:                        StructureElement[] children = null;
100:
101:                        if (motion != null) {
102:                            children = new StructureElement[3];
103:                            children[1] = motion;
104:                        } else {
105:                            children = new StructureElement[2];
106:                        }
107:
108:                        children[0] = exited;
109:                        children[children.length - 1] = entered;
110:
111:                        String oldComponent = ((MouseExited) exited)
112:                                .getComponentName();
113:                        String newComponent = ((MouseEntered) entered)
114:                                .getComponentName();
115:                        result = new MouseChangedComponent(env, children,
116:                                oldComponent, newComponent);
117:                    } else {
118:                        recordTokenizer.restoreState(rtState);
119:                    }
120:                } catch (Throwable t) {
121:                    recordTokenizer.restoreState(rtState);
122:                }
123:
124:                return result;
125:            }
126:
127:            /**
128:             * Returns the name of the element.
129:             *
130:             * @return the name
131:             */
132:            public String getElementName() {
133:                return language
134:                        .getString("Structures.MouseChangedComponent.Name");
135:            }
136:
137:            /**
138:             * Returns a description of the element.
139:             *
140:             * @return the description
141:             */
142:            public String getElementDescription() {
143:                return language
144:                        .getString("Structures.MouseChangedComponent.Description");
145:            }
146:
147:            /**
148:             * Returns the name of the old component.
149:             *
150:             * @return DOCUMENT ME!
151:             */
152:            public String getOldComponent() {
153:                return oldComponent;
154:            }
155:
156:            /**
157:             * Returns the name of the new component.
158:             *
159:             * @return DOCUMENT ME!
160:             */
161:            public String getNewComponent() {
162:                return newComponent;
163:            }
164:
165:            /**
166:             * Returns a String which describes the content of the element shortly.
167:             *
168:             * @return a string with a short description of the element
169:             */
170:            public String toShortString() {
171:                return getElementName();
172:            }
173:
174:            /**
175:             * Clones the element.
176:             *
177:             * @return DOCUMENT ME!
178:             */
179:            public Object clone() {
180:                StructureElement[] clonedChildren = getClonedChildren();
181:
182:                return new MouseChangedComponent(env, clonedChildren,
183:                        oldComponent, newComponent);
184:            }
185:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.