Source Code Cross Referenced for AbstractGTComponent.java in  » GIS » GeoTools-2.4.1 » org » geotools » event » 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 » GIS » GeoTools 2.4.1 » org.geotools.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
005:         *    
006:         *    This library is free software; you can redistribute it and/or
007:         *    modify it under the terms of the GNU Lesser General Public
008:         *    License as published by the Free Software Foundation;
009:         *    version 2.1 of the License.
010:         *
011:         *    This library is distributed in the hope that it will be useful,
012:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *    Lesser General Public License for more details.
015:         */
016:        package org.geotools.event;
017:
018:        import org.geotools.event.GTComponent;
019:        import org.geotools.event.GTDelta;
020:
021:        /**
022:         * Provides basic StyleEvent notification, may be used in conjuction with
023:         * StyleList during event handling.
024:         * 
025:         * <p>
026:         * This class has package scope to prevent user code mistaking it for something
027:         * important. It is only used to assist in the construction of this one
028:         * implementation of StyleEvents. Basically this is NOT API :-)
029:         * </p>
030:         *
031:         * @since 2.2.M3
032:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/event/AbstractGTComponent.java $
033:         */
034:        public abstract class AbstractGTComponent implements  GTComponent {
035:            //    GTComponent notificationParent = GTRoot.NO_PARENT;
036:            //    protected String notificationName = "";
037:            //    protected int notificationPosition = GTDelta.NO_INDEX;
038:            protected GTNote notification = new GTNoteImpl(GTRoot.NO_PARENT,
039:                    "", GTDelta.NO_INDEX);
040:
041:            protected Object clone() throws CloneNotSupportedException {
042:                AbstractGTComponent copy = (AbstractGTComponent) super .clone();
043:
044:                //    	copy.notificationParent = GTRoot.NO_PARENT;
045:                //    	copy.notificationName = "";
046:                //    	copy.notificationPosition = GTDelta.NO_INDEX;
047:                copy.notification = new GTNoteImpl(GTRoot.NO_PARENT, "",
048:                        GTDelta.NO_INDEX);
049:
050:                return copy;
051:            }
052:
053:            /**
054:             * Provide notification based on the provided delta.
055:             * 
056:             * <p>
057:             * Delta must come from this StyleComponent.
058:             * </p>
059:             *
060:             * @param childDelta object containing change information protected void
061:             *        fire(GTDelta delta){ parent.changed(delta); }
062:             */
063:            /**
064:             * Used to pass on "something is about to change" notification from
065:             * children.
066:             *
067:             * @param childDelta object containing change information
068:             */
069:            public void removed(GTDelta childDelta) {
070:                GTDelta delta = new GTDeltaImpl(notification,
071:                        GTDelta.Kind.NO_CHANGE, this , null, childDelta);
072:                notification.getParent().removed(delta);
073:            }
074:
075:            /**
076:             * Used to pass on "We changed" notification from children.
077:             *
078:             * @param childDelta object containing change information
079:             */
080:            public void changed(GTDelta childDelta) {
081:                GTDelta delta = new GTDeltaImpl(notification,
082:                        GTDelta.Kind.NO_CHANGE, this , null, childDelta);
083:                notification.getParent().changed(delta);
084:            }
085:
086:            /**
087:             * Simple notification that we changed.
088:             * 
089:             * <p>
090:             * Change will be passed on to parent.changed( delta ).
091:             * </p>
092:             */
093:            protected void fireChanged() {
094:                GTDelta delta = new GTDeltaImpl(notification,
095:                        GTDelta.Kind.CHANGED, this , null);
096:                notification.getParent().changed(delta);
097:            }
098:
099:            /**
100:             * Create a child delta and send it off.
101:             * 
102:             * <p>
103:             * Use this for changes to simple types like int and Color.
104:             * </p>
105:             *
106:             * @param name     the String used to name the child (often bean propertyName or map key)
107:             * @param child
108:             * @param oldValue 
109:             */
110:            protected synchronized void fireChildChanged(String name,
111:                    Object child, Object oldValue) {
112:                GTNote here = new GTNoteImpl(this , name, GTDelta.NO_INDEX);
113:
114:                if (oldValue instanceof  GTComponent) {
115:                    GTNote note = new GTNoteImpl(GTRoot.NO_PARENT, "",
116:                            GTDelta.NO_INDEX);
117:
118:                    GTComponent myDeath = (GTComponent) oldValue;
119:                    myDeath.setNote(note);
120:                }
121:
122:                if (child instanceof  GTComponent) {
123:                    GTComponent myChild = (GTComponent) child;
124:                    myChild.setNote(here);
125:                }
126:
127:                if (child == null) {
128:                    fireChanged(); // well something changed			
129:                } else {
130:                    GTDelta delta;
131:                    delta = new GTDeltaImpl(here, GTDelta.Kind.CHANGED, child,
132:                            oldValue); // <-- child delta
133:                    changed(delta);
134:                }
135:            }
136:
137:            public GTComponent getParent() {
138:                return notification.getParent();
139:            }
140:
141:            //	public void setParent(GTComponent newParent) {
142:            //		if( newParent == null ) {
143:            //			newParent = GTRoot.NO_PARENT;
144:            //		}		
145:            //		if( notificationParent != GTRoot.NO_PARENT ){
146:            //			// TODO: Freek out if Construct is adopted by a new parent
147:            //			//       Previous parents need to disown children beforehand
148:            //			throw new IllegalStateException("Please remove from existing parent first");
149:            //		}
150:            //		notificationParent = newParent;
151:            //	}
152:            //
153:            //	public void setNotificationName(String name) {
154:            //		if( name == null ) name = "";
155:            //		notificationName = name;
156:            //	}
157:            //
158:            //	public String getNotificationName() {
159:            //		return notificationName;
160:            //	}
161:            //
162:            //	public void setNotificationPosition(int index) {
163:            //		notificationPosition = index;
164:            //	}
165:            //
166:            //	public int getNotificationPosition() {
167:            //		return notificationPosition;
168:            //	}
169:            public GTNote getNote() {
170:                return notification;
171:            }
172:
173:            public void setNote(GTNote container) {
174:                notification = container;
175:            }
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.