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


001:        /*
002:         *    GeoTools - OpenSource mapping toolkit
003:         *    http://geotools.org
004:         *    (C) 2002-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.data;
017:
018:        import java.util.EventObject;
019:        import com.vividsolutions.jts.geom.Envelope;
020:
021:        /**
022:         * A simple event object to represent all events triggered by DataStore
023:         * instances (typically change events).
024:         *
025:         * <p>
026:         * The "Source" FeatureEvents is taken to be a <code>FeatureSource</code>,
027:         * rather than <code>DataStore</code>. The is due to FeatureSource having a a
028:         * hold of Transaction information.
029:         * </p>
030:         *
031:         * <p>
032:         * DataStore implementations will actually keep the list listeners by
033:         * DataSource, and can report FeatureWriter modifications as required (by
034:         * filtering the Listener list by typeName and Transaction).
035:         * </p>
036:         *
037:         * <p>
038:         * The commit opperation will also need to provide notification.
039:         * </p>
040:         *
041:         * @since GeoTools 2.0
042:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/data/FeatureEvent.java $
043:         */
044:        public class FeatureEvent extends EventObject {
045:            private static final long serialVersionUID = 3154238322369916485L;
046:
047:            /**
048:             * Event type constant denoting the adding of a feature.
049:             *
050:             * <p>
051:             * This EventType is used when FeatureWriter.write() is called when
052:             * <code>FeatureWriter.hasNext()</code> has previously returned
053:             * <code>false</code>. This action represents a newly create Feature being
054:             * passed to the DataStore.
055:             * </p>
056:             *
057:             * <p>
058:             * The FeatureWriter making the modification will need to check that
059:             * <code>typeName</code> it is modifing matches the
060:             * <code>FeatureSource.getSchema().getTypeName()</code> before sending
061:             * notification to any listeners on the FeatureSource.
062:             * </p>
063:             *
064:             * <p>
065:             * If the FeatureWriter is opperating against a Transaction it will need
066:             * ensure that to check the FeatureSource.getTransaction() for a match
067:             * before sending notification to any listeners on the FeatureSource.
068:             * </p>
069:             *
070:             * <p>
071:             * FeatureEvent.getBounds() should reflect the the Bounding Box of the
072:             * newly created Features.
073:             * </p>
074:             */
075:            public static final int FEATURES_ADDED = 1;
076:
077:            /**
078:             * Event type constant denoting that features in the collection has been
079:             * modified.
080:             *
081:             * <p>
082:             * This EventType is used when a FeatureWriter.write() is called when
083:             * <code>FeatureWriter.hasNext()</code> returns <code>true</code> and the
084:             * current Feature has been changed. This EventType is also used when a
085:             * Transaction <code>commit()</code> or <code>rolledback</code> is called.
086:             * </p>
087:             *
088:             * <p>
089:             * The FeatureWriter making the modification will need to check that
090:             * <code>typeName</code> it is modifing matches the
091:             * <code>FeatureSource.getSchema().getTypeName()</code> before sending
092:             * notification to any listeners on the FeatureSource.
093:             * </p>
094:             *
095:             * <p>
096:             * If the FeatureWriter is opperating against a Transaction it will need
097:             * ensure that to check the FeatureSource.getTransaction() for a match
098:             * before sending notification to any listeners on the FeatureSource. All
099:             * FeatureSources of the same typename will need to be informed of a
100:             * <code>commit</code>, except ones in the same Transaction,  and only
101:             * FeatureSources in the same Transaction will need to be informed of a
102:             * rollback.
103:             * </p>
104:             *
105:             * <p>
106:             * FeatureEvent.getBounds() should reflect the the BoundingBox of the
107:             * FeatureWriter modified Features. This may not be possible during a
108:             * <code>commit()</code> or <code>rollback()</code> opperation.
109:             * </p>
110:             */
111:            public static final int FEATURES_CHANGED = 0;
112:
113:            /**
114:             * Event type constant denoting the removal of a feature.
115:             *
116:             * <p>
117:             * This EventType is used when FeatureWriter.remove() is called. This
118:             * action represents a Feature being removed from the DataStore.
119:             * </p>
120:             *
121:             * <p>
122:             * The FeatureWriter making the modification will need to check that
123:             * <code>typeName</code> it is modifing matches the
124:             * <code>FeatureSource.getSchema().getTypeName()</code> before sending
125:             * notification to any listeners on the FeatureSource.
126:             * </p>
127:             *
128:             * <p>
129:             * If the FeatureWriter is opperating against a Transaction it will need
130:             * ensure that to check the FeatureSource.getTransaction() for a match
131:             * before sending notification to any listeners on the FeatureSource.
132:             * </p>
133:             *
134:             * <p>
135:             * FeatureEvent.getBounds() should reflect the the Bounding Box of the
136:             * removed Features.
137:             * </p>
138:             */
139:            public static final int FEATURES_REMOVED = -1;
140:
141:            /** Indicates one of FEATURES_ADDED, FEATURES_REMOVED, FEATURES_CHANGED */
142:            private int type;
143:
144:            /**
145:             * Indicates the bounds in which the modification occured.
146:             *
147:             * <p>
148:             * This value is allowed to by <code>null</code> if this information is not
149:             * known.
150:             * </p>
151:             */
152:            private Envelope bounds;
153:
154:            /**
155:             * Constructs a new FeatureEvent.
156:             *
157:             * @param featureSource The DataStore that fired the event
158:             * @param eventType One of FEATURE_CHANGED, FEATURE_REMOVED or
159:             *        FEATURE_ADDED
160:             * @param bounds The area modified by this change
161:             */
162:            public FeatureEvent(FeatureSource featureSource, int eventType,
163:                    Envelope bounds) {
164:                super (featureSource);
165:                this .type = eventType;
166:                this .bounds = bounds;
167:            }
168:
169:            /**
170:             * Provides access to the FeatureSource which fired the event.
171:             *
172:             * @return The FeatureSource which was the event's source.
173:             */
174:            public FeatureSource getFeatureSource() {
175:                return (FeatureSource) source;
176:            }
177:
178:            /**
179:             * Provides information on the type of change that has occured. Possible
180:             * types are: add, remove, change
181:             *
182:             * @return an int which must be one of FEATURES_ADDED, FEATURES_REMOVED,
183:             *         FEATURES_CHANGED
184:             */
185:            public int getEventType() {
186:                return type;
187:            }
188:
189:            /**
190:             * Provides access to the area modified (if known).
191:             *
192:             * @return A bounding box of the modifications or <code>null</code> if
193:             *         unknown.
194:             */
195:            public Envelope getBounds() {
196:                return bounds;
197:            }
198:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.