Source Code Cross Referenced for StyleTransaction.java in  » GIS » udig-1.1 » net » refractions » udig » style » internal » 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 » udig 1.1 » net.refractions.udig.style.internal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.refractions.udig.style.internal;
002:
003:        import java.util.Set;
004:
005:        import net.refractions.udig.project.internal.Layer;
006:        import net.refractions.udig.project.internal.StyleBlackboard;
007:        import net.refractions.udig.style.IStyleConfigurator;
008:
009:        public class StyleTransaction {
010:
011:            /** master of styles **/
012:            private StyleManager styleManager;
013:
014:            /** The layer being styled **/
015:            private Layer layer;
016:
017:            /** The style blackboard being populated with style information **/
018:            private StyleBlackboard styleBlackboard;
019:
020:            public StyleTransaction(StyleManager styleManager, Layer layer,
021:                    Set<IStyleConfigurator> configurators) {
022:                this .styleManager = styleManager;
023:                this .layer = layer;
024:            }
025:
026:            /**
027:             * Returns the layer being worked on by the transaction.
028:             * 
029:             * @return Returns the layer.
030:             *
031:            public Layer getLayer() {
032:                return layer;
033:            }
034:            
035:            /**
036:             * Sets the layer being worked on by the transaction.
037:             * @param layer The layer to set.
038:             *
039:            public void setLayer( Layer layer ) {
040:                this.layer = layer;
041:            }
042:             */
043:            /**
044:             * Sets the style blackboard used in the transaction.
045:             * 
046:             * @param styleBlackboard The new style blackboard.
047:             */
048:            public void setStyleBlackboard(StyleBlackboard styleBlackboard) {
049:                this .styleBlackboard = styleBlackboard;
050:            }
051:
052:            /**
053:             * Returns the style blackboard being used by the transaction.
054:             * 
055:             * @return The current style blackboard.
056:             */
057:            public StyleBlackboard getStyleBlackboard() {
058:                return styleBlackboard;
059:            }
060:
061:            /**
062:             * 
063:             * @return Returns the configurators.
064:             *
065:            public Set<IStyleConfigurator> getConfigurators() {
066:                return styleManager.getCurrentConfigurators();
067:            }*/
068:
069:            /**
070:             * @param configurators The configurators to set.
071:             *
072:            public void setConfigurators( Set<IStyleConfigurator> configurators ) {
073:                this.configurators = configurators;
074:            }*/
075:
076:            /**
077:             * Starts the styling transaction.
078:             */
079:            public void begin() {
080:                // create a clone of the blackboard
081:                styleBlackboard = (StyleBlackboard) styleManager
082:                        .getCurrentLayer().getStyleBlackboard().clone();
083:
084:                //       for (IStyleConfigurator config : styleManager.getStyleConfigurators()) {
085:                //           config.focus(styleManager.getCurrentLayer(),styleBlackboard);           
086:                //       }
087:            }
088:
089:            /*
090:            public void suspend() {
091:                //tell all the configurators to save state to the blackboard
092:                for (IStyleConfigurator config : configurators) {
093:                    //only apply if ui has been created
094:                    if (config.getControl() != null && !config.getControl().isDisposed()) {
095:                        config.apply();
096:                    }
097:                }
098:            }*/
099:            /*
100:            public void resume() {
101:                //reset the blackboard for the configurators
102:                for (IStyleConfigurator config : configurators) {
103:                    config.setLayer(styleManager.getCurrentLayer());
104:                    config.setStyleBlackboard(styleBlackboard);
105:
106:                    //only init if ui has been created
107:                    if (config.getControl() != null && !config.getControl().isDisposed()) {
108:                        config.refresh();
109:                    }
110:                }
111:            }
112:             */
113:            public void rollback() {
114:                begin();
115:            }
116:
117:            public void commit() {
118:                //tell all the configurators to save state to the blackboard
119:                //for (IStyleConfigurator config : styleManager.getStyleConfigurators()) {
120:                //only apply if ui has been created
121:                //if (config.getControl() != null) { config.apply();}
122:                //}        
123:                ApplyStyleCommand applyCommand = new ApplyStyleCommand(layer,
124:                        layer.getStyleBlackboard(), styleBlackboard);
125:                layer.getContextModel().getMap().sendCommandASync(applyCommand);
126:            }
127:        }
128:
129:        //class ApplyStyleCommand implements UndoableCommand {
130:        //
131:        //    StyleBlackboard oldStyleBlackboard;
132:        //    StyleBlackboard newStyleBlackboard;
133:        //    Layer layer;
134:        //    
135:        //    public ApplyStyleCommand(
136:        //        Layer layer, StyleBlackboard oldStyleBlackboard, StyleBlackboard newStyleBlackboard
137:        //    ) {
138:        //        this.oldStyleBlackboard = oldStyleBlackboard;
139:        //        this.newStyleBlackboard = newStyleBlackboard;
140:        //        this.layer = layer;
141:        //    }
142:        //
143:        //    /*
144:        //     * @see net.refractions.udig.project.command.UndoableCommand#rollback()
145:        //     */
146:        //    public void rollback() throws Exception {
147:        //        //overwrite with the orignal blackboard
148:        //        layer.setStyleBlackboard(oldStyleBlackboard);
149:        //    }
150:        //
151:        //    public void run() throws Exception {
152:        //        //overwrite with new blackboard
153:        //        layer.setStyleBlackboard(newStyleBlackboard);
154:        //    }
155:        //
156:        //    /*
157:        //     * @see net.refractions.udig.project.command.MapCommand#copy()
158:        //     */
159:        //    public MapCommand copy() {
160:        //        return new ApplyStyleCommand(layer,oldStyleBlackboard,newStyleBlackboard);
161:        //    }
162:        //
163:        //    /**
164:        //     * @see net.refractions.udig.project.command.MapCommand#getName()
165:        //     */
166:        //    public String getName() {
167:        //       return Messages.StyleTransaction_apply_style; 
168:        //    }
169:        //    
170:        //}
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.