Java Doc for GTDelta.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 Reference  Class Diagram Java Document (Java Doc) 


org.geotools.event.GTDelta

All known Subclasses:   org.geotools.event.GTDeltaImpl,
GTDelta
public interface GTDelta (Code)
Indicates which style constructs have been changed.

Acts as a series of breadcrumbs stored up by a StyleEvent to communicate changes.

This delta is constructed a fashion following the outline of the style document, allowing you to skip over entire branches of changes if you are not interested.

Example Use

The following examples will make use of the following allegorical data structure


 Root
 +--Parent
 +-- Child
 +-- List
 [0]--Element
 
These roles are allegorical in nature any may be played in real life by arrays, beans, collections, etc.. (as example StyleLayerDescriptor is a "Root").

Example 0: An Child is changed.


 Event.POST_CHANGE
 +---Delta1 "" -1 NO_CHANGE(Root,null,)
 +---Delta2 "Parent" -1 NO_CHANGE (Parent, null )
 +---Delta3 "Child" -1 CHANGED (Child, oldChild )
 
Location of change is indicated by delta, including name of "Child". The oldChild is provided incase you need to un-listen or something. Parent is not considered to have changed itself (it is still has the same structure).

Example 1: An Element is changed:


 Event.POST_CHANGE
 +---Delta1 "" -1 NO_CHANGE(Root,null,)
 +---Delta2 "Parent" -1 NO_CHANGE (Parent, null )
 +---Delta3 "List" 0 CHANGED (Element, null )
 
Location of change is indicated by delta, including position in list. Children in lists are children too, delta intentionally similar to the last.

Example 2: A new Element2 is added:


 Event.POST_CHANGE
 +---Delta1 "" -1 NO_CHANGE(Root,null,)
 +---Delta2 "Parent" -1 CHANGED (Parent, null )
 +---Delta3 "List" 1 ADDED (Element2, null )
 

Adding Element2 results in a change to Parent (it is structured diffrently). Position of the change in the "List" is indicated.

Example 3: Swap Element and Element2


 Event.POST_CHANGE
 +---Delta1 "" -1 NO_CHANGE(Root,null,)
 +---Delta2 "Parent" -1 CHANGED (Parent, null )
 +---Delta3 "List" 1 NO_CHANGE (Element, null )
 +---Delta4 "List" 0 NO_CHANGE (Element2, null )
 
Moving things around does not change them, but it is a change to the Parent.

Example 5: Remove Element2


 Event.POST_CHANGE
 +---Delta1 "" -1 NO_CHANGE(Root,null,)
 +---Delta2 "Parent" -1 CHANGED (Parent, null )
 +---Delta3 "List" -1 REMOVED ( null, Element2 )
 +---Delta4 "List" 0 NO_CHANGE (Element, null )
 
Removing also is a considered a change to Parent, note this is a POST_CHANGE event so Element2 is an oldValue. The NO_CHANGE for Element is similar to Example4, it still indicates a change of position.

Example 6: Go Fish


 Event.POST_CHANGE
 +---Delta1 "" -1 CHANGED(Root,null,)
 
Something changed somewhere, similar to "touch".

Example 7: Shutting Down


 Event.PRE_CLOSE
 +---Delta1 "" -1 NO_CHANGE(Root,null,)
 
That was easy then...

You should be aware that the event system may "collapse" events that duplicate information, especially when considering batch changes resulting from the application of a visitor or transformation.


author:
   Jody Garnett, Refractions Research

Inner Class :public class Kind

Field Summary
final public static  ListNO_CHILDREN
    
final public static  intNO_INDEX
    


Method Summary
public  voidaccept(GTDeltaVisitor visitor)
     Accepts the given visitor.
public  ListgetChildren()
     Finds and returns deltas for specificly changed constructs.
public  KindgetKind()
     Returns the kind of this delta.
public  StringgetName()
     Name of property being affected.
public  ObjectgetOldValue()
     Construct being replaced with a changed, getValue is the replacing value.
public  intgetPosition()
     Position in a "list" where the change occured, or NO_INDEX.
public  ObjectgetValue()
     Affected construct, getKind & getChildern indicate specific details of the change.

Field Detail
NO_CHILDREN
final public static List NO_CHILDREN(Code)
List indicating no children are present



NO_INDEX
final public static int NO_INDEX(Code)
Index position is not to be considered relevent





Method Detail
accept
public void accept(GTDeltaVisitor visitor)(Code)
Accepts the given visitor.
Parameters:
  visitor -



getChildren
public List getChildren()(Code)
Finds and returns deltas for specificly changed constructs.

This code may be considered more accessable then the use of GTDeltaVisitor.

List of StyleDelta



getKind
public Kind getKind()(Code)
Returns the kind of this delta.

Normally, one of ADDED, REMOVED or CHANGED.

the kind of this resource delta
See Also:   Kind.ADDED
See Also:   Kind.REMOVED
See Also:   Kind.CHANGED



getName
public String getName()(Code)
Name of property being affected.

  • propertyName: "bean" property name when intergrating third party Java Beans into a more complex tree structure.
  • List and Arrays: the name of the list, and may be combined with getPosition to indicate location, NO_INDEX would indicate the entire "list" has been modified.

name of affected Child, or null for root



getOldValue
public Object getOldValue()(Code)
Construct being replaced with a changed, getValue is the replacing value. Affected construct



getPosition
public int getPosition()(Code)
Position in a "list" where the change occured, or NO_INDEX. Position in "list" or NO_INDEX.



getValue
public Object getValue()(Code)
Affected construct, getKind & getChildern indicate specific details of the change. Affected construct



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.