Source Code Cross Referenced for Fill.java in  » GIS » GeoTools-2.4.1 » org » geotools » styling » 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.styling 
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:         *    (C) 2002, Center for Computational Geography
006:         *
007:         *    This library is free software; you can redistribute it and/or
008:         *    modify it under the terms of the GNU Lesser General Public
009:         *    License as published by the Free Software Foundation;
010:         *    version 2.1 of the License.
011:         *
012:         *    This library is distributed in the hope that it will be useful,
013:         *    but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         *    Lesser General Public License for more details.
016:         *
017:         * Contacts:
018:         *     UNITED KINGDOM: James Macgill.  j.macgill@geog.leeds.ac.uk
019:         */
020:        package org.geotools.styling;
021:
022:        import java.awt.Color;
023:        import org.opengis.filter.expression.Expression;
024:        import org.geotools.event.GTComponent;
025:        import org.geotools.event.GTConstant;
026:        import org.geotools.filter.ConstantExpression;
027:
028:        /**
029:         * The Fill object encapsulates the graphical-symbolization parameters for
030:         * areas of geometries.
031:         *
032:         * <p>
033:         * There are two types of fill: solid-color and repeated graphic fill.
034:         * </p>
035:         *
036:         * <p>
037:         * The details of this object are taken from the <a
038:         * href="https://portal.opengeospatial.org/files/?artifact_id=1188"> OGC
039:         * Styled-Layer Descriptor Report (OGC 02-070) version 1.0.0.</a>:
040:         * <pre><code>
041:         * &lt;xsd:element name="Fill"&gt;
042:         *   &lt;xsd:annotation&gt;
043:         *     &lt;xsd:documentation&gt;
044:         *       A "Fill" specifies the pattern for filling an area geometry.
045:         *       The allowed CssParameters are: "fill" (color) and "fill-opacity".
046:         *     &lt;/xsd:documentation&gt;
047:         *   &lt;/xsd:annotation&gt;
048:         *   &lt;xsd:complexType&gt;
049:         *     &lt;xsd:sequence&gt;
050:         *       &lt;xsd:element ref="sld:GraphicFill" minOccurs="0"/&gt;
051:         *       &lt;xsd:element ref="sld:CssParameter" minOccurs="0"
052:         *                    maxOccurs="unbounded"/&gt;
053:         *     &lt;/xsd:sequence&gt;
054:         *   &lt;/xsd:complexType&gt;
055:         * &lt;/xsd:element&gt;
056:         * </code></pre>
057:         * </p>
058:         *
059:         * <p>
060:         * Renderers can use this information when displaying styled features, though
061:         * it must be remembered that not all renderers will be able to fully
062:         * represent strokes as set out by this interface.  For example, opacity may
063:         * not be supported.
064:         * </p>
065:         *
066:         * <p>
067:         * Notes:
068:         *
069:         * <ul>
070:         * <li>
071:         * The graphical parameters and their values are derived from SVG/CSS2
072:         * standards with names and semantics which are as close as possible.
073:         * </li>
074:         * </ul>
075:         * </p>
076:         *
077:         * @author James Macgill, CCG
078:         * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/styling/Fill.java $
079:         * @version $Id: Fill.java 25459 2007-05-08 05:19:25Z jgarnett $
080:         */
081:        public interface Fill extends GTComponent {
082:            static final Fill DEFAULT = new ConstantFill() {
083:                final Expression COLOR = ConstantExpression.constant(new Color(
084:                        128, 128, 128));
085:                final Expression BGCOLOR = ConstantExpression
086:                        .constant(new Color(255, 255, 255, 0));
087:                final Expression OPACITY = ConstantExpression.ONE;
088:
089:                public Expression getColor() {
090:                    return COLOR;
091:                }
092:
093:                public Expression getBackgroundColor() {
094:                    return BGCOLOR;
095:                }
096:
097:                public Expression getOpacity() {
098:                    return OPACITY;
099:                }
100:
101:                public Graphic getGraphicFill() {
102:                    return Graphic.NULL;
103:                }
104:            };
105:
106:            static final Fill NULL = new ConstantFill() {
107:                public Expression getColor() {
108:                    return ConstantExpression.NULL;
109:                }
110:
111:                public Expression getBackgroundColor() {
112:                    return ConstantExpression.NULL;
113:                }
114:
115:                public Expression getOpacity() {
116:                    return ConstantExpression.NULL;
117:                }
118:
119:                public Graphic getGraphicFill() {
120:                    return Graphic.NULL;
121:                }
122:            };
123:
124:            /**
125:             * This parameter gives the solid color that will be used for a Fill.<br>
126:             * The color value is RGB-encoded using two hexidecimal digits per
127:             * primary-color component, in the order Red, Green, Blue, prefixed with
128:             * the hash (#) sign.  The hexidecimal digits beetween A and F may be in
129:             * either upper or lower case.  For example, full red is encoded as
130:             * "#ff0000" (with no quotation marks).  The default color is defined to
131:             * be 50% gray ("#808080"). Note: in CSS this parameter is just called
132:             * Fill and not Color.
133:             *
134:             * @return The color of the Fill encoded as a hexidecimal RGB value.
135:             */
136:            Expression getColor();
137:
138:            /**
139:             * This parameter gives the solid color that will be used for a Fill.<br>
140:             * The color value is RGB-encoded using two hexidecimal digits per
141:             * primary-color component, in the order Red, Green, Blue, prefixed with
142:             * the hash (#) sign.  The hexidecimal digits beetween A and F may be in
143:             * either upper or lower case.  For example, full red is encoded as
144:             * "#ff0000" (with no quotation marks).
145:             *
146:             * @param color solid color that will be used for a Fill
147:             */
148:            void setColor(Expression color);
149:
150:            /**
151:             * This parameter gives the solid color that will be used as a background
152:             * for a Fill.<br>
153:             * The color value is RGB-encoded using two hexidecimal digits per
154:             * primary-color component, in the order Red, Green, Blue, prefixed with
155:             * the hash (#) sign.  The hexidecimal digits beetween A and F may be in
156:             * either upper or lower case.  For example, full red is encoded as
157:             * "#ff0000" (with no quotation marks).  The default color is defined to
158:             * be transparent.
159:             *
160:             * @return The background color of the Fill encoded as a hexidecimal RGB
161:             *         value.
162:             */
163:            Expression getBackgroundColor();
164:
165:            /**
166:             * This parameter gives the solid color that will be used as a background
167:             * for a Fill.<br>
168:             * The color value is RGB-encoded using two hexidecimal digits per
169:             * primary-color component, in the order Red, Green, Blue, prefixed with
170:             * the hash (#) sign.  The hexidecimal digits beetween A and F may be in
171:             * either upper or lower case.  For example, full red is encoded as
172:             * "#ff0000" (with no quotation marks).
173:             *
174:             * @param backgroundColor solid color that will be used as a background
175:             */
176:            void setBackgroundColor(Expression backgroundColor);
177:
178:            /**
179:             * This specifies the level of translucency to use when rendering the fill. <br>
180:             * The value is encoded as a floating-point value between 0.0 and 1.0 with
181:             * 0.0 representing totally transparent and 1.0 representing totally
182:             * opaque, with a linear scale of translucency for intermediate values.<br>
183:             * For example, "0.65" would represent 65% opacity.  The default value is
184:             * 1.0 (opaque).
185:             *
186:             * @return The opacity of the fill, where 0.0 is completely transparent and
187:             *         1.0 is completely opaque.
188:             */
189:            Expression getOpacity();
190:
191:            /**
192:             * This specifies the level of translucency to use when rendering the fill. <br>
193:             * The value is encoded as a floating-point value between 0.0 and 1.0 with
194:             * 0.0 representing totally transparent and 1.0 representing totally
195:             * opaque, with a linear scale of translucency for intermediate values.<br>
196:             * For example, "0.65" would represent 65% opacity.
197:             *
198:             * @param opacity DOCUMENT ME!
199:             */
200:            void setOpacity(Expression opacity);
201:
202:            /**
203:             * This parameter indicates that a stipple-fill repeated graphic will be
204:             * used and specifies the fill graphic to use.
205:             *
206:             * @return The graphic to use as a stipple fill.  If null then no stipple
207:             *         fill should be used.
208:             */
209:            Graphic getGraphicFill();
210:
211:            /**
212:             * This parameter indicates that a stipple-fill repeated graphic will be
213:             * used and specifies the fill graphic to use.
214:             *
215:             * @param graphicFill DOCUMENT ME!
216:             */
217:            void setGraphicFill(Graphic graphicFill);
218:
219:            void accept(StyleVisitor visitor);
220:        }
221:
222:        abstract class ConstantFill extends GTConstant implements  Fill {
223:            private void cannotModifyConstant() {
224:                throw new UnsupportedOperationException(
225:                        "Constant Fill may not be modified");
226:            }
227:
228:            public void setColor(Expression color) {
229:                cannotModifyConstant();
230:            }
231:
232:            public void setBackgroundColor(Expression backgroundColor) {
233:                cannotModifyConstant();
234:            }
235:
236:            public void setOpacity(Expression opacity) {
237:                cannotModifyConstant();
238:            }
239:
240:            public void setGraphicFill(Graphic graphicFill) {
241:                cannotModifyConstant();
242:            }
243:
244:            public void accept(StyleVisitor visitor) {
245:                cannotModifyConstant();
246:            }
247:        };
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.