Source Code Cross Referenced for WMSRenderingForm.java in  » GIS » GeoServer » org » vfny » geoserver » form » wms » 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 » GeoServer » org.vfny.geoserver.form.wms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.vfny.geoserver.form.wms;
006:
007:        import org.apache.struts.action.ActionErrors;
008:        import org.apache.struts.action.ActionForm;
009:        import org.apache.struts.action.ActionMapping;
010:        import org.vfny.geoserver.config.WMSConfig;
011:        import java.util.ArrayList;
012:        import java.util.List;
013:        import javax.servlet.ServletContext;
014:        import javax.servlet.http.HttpServletRequest;
015:
016:        public class WMSRenderingForm extends ActionForm {
017:            List svgRenderers;
018:            String svgRenderer;
019:            boolean svgAntiAlias;
020:            List intTypes;
021:            String allowInterpolation;
022:
023:            /*
024:             * Because of the way that STRUTS works, if the user does not check the enabled box,
025:             * or unchecks it, setEnabled() is never called, thus we must monitor setEnabled()
026:             * to see if it doesn't get called. This must be accessible, as ActionForms need to
027:             * know about it -- there is no way we can tell whether we are about to be passed to
028:             * an ActionForm or not.
029:             *
030:             * Probably a better way to do this, but I can't think of one.
031:             * -rgould
032:             *
033:             * TODO: Hey richard Jody here - Struts knows that boolean properties are
034:             * not set if the user does nothing. Apparently that is why the reset
035:             * method exists.
036:             * Reset is called *every* time on ActionForm. Before the populate
037:             * process has a go at things.
038:             *
039:             * The problem is that reset() retrieves the WFS's config enabled value
040:             * and uses that to pre-populate the form. Thus, if they deselect it, setEnabled is
041:             * never called, and enabled still remains true. The way I have done it isn't simple,
042:             * but it works just fine.
043:             */
044:            private boolean svgAntiAliasChecked = false;
045:
046:            public WMSRenderingForm() {
047:                svgRenderers = new ArrayList();
048:                svgRenderers.add(WMSConfig.SVG_SIMPLE);
049:                svgRenderers.add(WMSConfig.SVG_BATIK);
050:                svgAntiAlias = true;
051:                intTypes = new ArrayList();
052:                intTypes.add(WMSConfig.INT_NEAREST);
053:                intTypes.add(WMSConfig.INT_BIlINEAR);
054:                intTypes.add(WMSConfig.INT_BICUBIC);
055:            }
056:
057:            public void reset(ActionMapping mapping, HttpServletRequest request) {
058:                super .reset(mapping, request);
059:
060:                ServletContext context = getServlet().getServletContext();
061:                WMSConfig config = (WMSConfig) context
062:                        .getAttribute(WMSConfig.CONFIG_KEY);
063:
064:                svgRenderer = config.getSvgRenderer();
065:
066:                if (svgRenderer == null) {
067:                    svgRenderer = WMSConfig.SVG_SIMPLE;
068:                }
069:
070:                svgAntiAlias = config.getSvgAntiAlias();
071:
072:                allowInterpolation = config.getAllowInterpolation();
073:
074:                if (allowInterpolation == null) {
075:                    allowInterpolation = WMSConfig.INT_BIlINEAR;
076:                }
077:            }
078:
079:            public ActionErrors validate(ActionMapping mapping,
080:                    HttpServletRequest request) {
081:                ActionErrors errors = new ActionErrors();
082:
083:                return errors;
084:            }
085:
086:            public void setSvgRenderer(String svgRenderer) {
087:                this .svgRenderer = svgRenderer;
088:            }
089:
090:            public String getSvgRenderer() {
091:                return svgRenderer;
092:            }
093:
094:            public List getSvgRenderers() {
095:                return svgRenderers;
096:            }
097:
098:            /**
099:             * @param svgAntiAlias anti alias hint.
100:             */
101:            public void setSvgAntiAlias(boolean svgAntiAlias) {
102:                svgAntiAliasChecked = true;
103:                this .svgAntiAlias = svgAntiAlias;
104:            }
105:
106:            /**
107:             * @return The value of the anti aliasing rendering hint.
108:             */
109:            public boolean getSvgAntiAlias() {
110:                return svgAntiAlias;
111:            }
112:
113:            /**
114:             * DOCUMENT ME!
115:             *
116:             * @return
117:             */
118:            public boolean isSvgAntiAliasChecked() {
119:                return svgAntiAliasChecked;
120:            }
121:
122:            /**
123:             * @param allowInterpolation interpolation rendering hint.
124:             */
125:            public void setAllowInterpolation(String allowInterpolation) {
126:                this .allowInterpolation = allowInterpolation;
127:            }
128:
129:            /**
130:             * @return The value of the interpolation rendering hint.
131:             */
132:            public String getAllowInterpolation() {
133:                return allowInterpolation;
134:            }
135:
136:            public List getIntTypes() {
137:                return intTypes;
138:            }
139:
140:            /**
141:             * DOCUMENT ME!
142:             *
143:             * @param b
144:             */
145:            public void setEnabledChecked(boolean svgAntiAliasChecked) {
146:                this.svgAntiAliasChecked = svgAntiAliasChecked;
147:            }
148:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.