svn-gvsig-desktop / branches / v02_desarrollo / libraries / sld / org.gvsig.sldsupport / org.gvsig.sldsupport.lib / org.gvsig.sldsupport.lib.api / src / main / java / org / gvsig / sldsupport / graphic / SLDGraphic.java @ 40754
History | View | Annotate | Download (4.66 KB)
1 |
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib��ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package org.gvsig.sldsupport.graphic; |
42 |
|
43 |
import java.util.ArrayList; |
44 |
|
45 |
import org.gvsig.sldsupport.feature.ISLDFeatures; |
46 |
import org.gvsig.sldsupport.filterencoding.FExpression; |
47 |
|
48 |
/**
|
49 |
* Implements the Graphic element of an SLD implementation specification.<p>
|
50 |
* A Graphic is a �graphic symbol� with an inherent shape, color(s), and possibly size. A
|
51 |
* �graphic� can be very informally defined as �a little picture� and can be of either a raster
|
52 |
* or vector-graphic source type. The term �graphic� is used since the term �symbol� is
|
53 |
* similar to �symbolizer� which is used in a different context in SLD.<p>
|
54 |
* If the Graphic element is omitted from the parent element, then nothing will be plotted.<p>
|
55 |
* Graphics can either be referenced from an external URL in a common format (such as
|
56 |
* GIF or SVG) or may be derived from a Mark. Multiple external URLs and marks may be
|
57 |
* referenced with the semantic that they all provide the equivalent graphic in different
|
58 |
* formats. The �hot spot� to use for positioning the rendering at a point must either be
|
59 |
* inherent in the external format or is defined to be the �central point� of the graphic,
|
60 |
* where the exact definition �central point� is system-dependent.<p>
|
61 |
* The default if neither an ExternalGraphic nor a Mark is specified is to use the default
|
62 |
* mark of a �square� with a 50%-gray fill and a black outline, with a size of 6 pixels,
|
63 |
*
|
64 |
* @see SLDExternalGraphic
|
65 |
* @see SLDMark
|
66 |
*
|
67 |
* @see http://portal.opengeospatial.org/files/?artifact_id=1188
|
68 |
*
|
69 |
* @author pepe vidal salvador - jose.vidal.salvador@iver.es
|
70 |
*/
|
71 |
public abstract class SLDGraphic implements ISLDFeatures { |
72 |
|
73 |
protected ArrayList<SLDExternalGraphic> externalGraphics = new ArrayList<SLDExternalGraphic>(); |
74 |
protected ArrayList<SLDMark> marks = new ArrayList<SLDMark>(); |
75 |
protected FExpression expressionOpacity = new FExpression(); |
76 |
protected FExpression expressionSize = new FExpression(); |
77 |
protected FExpression expressionRotation = new FExpression(); |
78 |
|
79 |
|
80 |
public ArrayList<SLDExternalGraphic> getExternalGraphics() { |
81 |
return externalGraphics;
|
82 |
} |
83 |
public void setExternalGraphics(ArrayList<SLDExternalGraphic> externalGraphics) { |
84 |
this.externalGraphics = externalGraphics;
|
85 |
} |
86 |
public void addExternalGraphic(SLDExternalGraphic external) { |
87 |
this.externalGraphics.add(external);
|
88 |
} |
89 |
|
90 |
public ArrayList<SLDMark> getMarks() { |
91 |
return marks;
|
92 |
} |
93 |
public void setMarks(ArrayList<SLDMark> marks) { |
94 |
this.marks = marks;
|
95 |
} |
96 |
|
97 |
public void addMark(SLDMark mark) { |
98 |
this.marks.add(mark);
|
99 |
} |
100 |
public FExpression getExpressionOpacity() {
|
101 |
return expressionOpacity;
|
102 |
} |
103 |
public void setExpressionOpacity(FExpression expressionOpacity) { |
104 |
this.expressionOpacity = expressionOpacity;
|
105 |
} |
106 |
public FExpression getExpressionSize() {
|
107 |
return expressionSize;
|
108 |
} |
109 |
public void setExpressionSize(FExpression expressionSize) { |
110 |
this.expressionSize = expressionSize;
|
111 |
} |
112 |
public FExpression getExpressionRotation() {
|
113 |
return expressionRotation;
|
114 |
} |
115 |
public void setExpressionRotation(FExpression expressionRotation) { |
116 |
this.expressionRotation = expressionRotation;
|
117 |
} |
118 |
|
119 |
|
120 |
public float getGraphicSize(){ |
121 |
return Float.valueOf(this.expressionSize.getLiteral()); |
122 |
} |
123 |
public float getGraphicOpacity(){ |
124 |
return Float.valueOf(expressionOpacity.getLiteral()); |
125 |
} |
126 |
public float getGraphicRotation(){ |
127 |
return Float.valueOf(expressionRotation.getLiteral()); |
128 |
} |
129 |
|
130 |
} |