Statistics
| Revision:

gvsig-sldtools / org.gvsig.sld / org.gvsig.sldsupport / org.gvsig.sldsupport.lib / org.gvsig.sldsupport.lib.api / src / main / java / org / gvsig / sldsupport / sld / graphic / SLDGraphic.java @ 46

History | View | Annotate | Download (3.52 KB)

1
/*******************************************************************************
2
 *
3
 *   gvSIG. Desktop Geographic Information System.
4
 *  
5
 *   Copyright (C) 2007-2013 gvSIG Association.
6
 *  
7
 *   This program is free software; you can redistribute it and/or
8
 *   modify it under the terms of the GNU General Public License
9
 *   as published by the Free Software Foundation; either version 3
10
 *   of the License, or (at your option) any later version.
11
 *  
12
 *   This program is distributed in the hope that it will be useful,
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 *   GNU General Public License for more details.
16
 *  
17
 *   You should have received a copy of the GNU General Public License
18
 *   along with this program; if not, write to the Free Software
19
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
 *   MA  02110-1301, USA.
21
 *  
22
 *   For any additional information, do not hesitate to contact us
23
 *   at info AT gvsig.com, or visit our website www.gvsig.com.
24
 *   
25
 *******************************************************************************/
26
package org.gvsig.sldsupport.sld.graphic;
27

    
28
import java.util.ArrayList;
29
import java.util.List;
30

    
31
import org.gvsig.sldsupport.sld.filter.expression.operator.SLDLiteral;
32
import org.gvsig.sldsupport.sld.symbol.misc.SLDParameterValue;
33

    
34
public class SLDGraphic {
35
        
36
        protected List<SLDGraphicStackElement> graphicStack =
37
                        new ArrayList<SLDGraphicStackElement>();
38
        
39
        protected SLDParameterValue opacity = null;
40
        protected SLDParameterValue size = null;
41

    
42
        /**
43
         * In decimal degrees, clockwise
44
         */
45
        protected SLDParameterValue rotation = null;
46
        
47
        protected SLDAnchorPoint anchor = null;
48
        protected SLDDisplacement displacement = null;
49
        
50
        public SLDGraphic() {
51
                /*
52
                 * Defaults
53
                 */
54
                opacity = new SLDParameterValue();
55
                opacity.getExpressionList().add(new SLDLiteral("1.0"));
56
                size = new SLDParameterValue();
57
                size.getExpressionList().add(new SLDLiteral("6.0"));
58
                rotation = new SLDParameterValue();
59
                rotation.getExpressionList().add(new SLDLiteral("0.0"));
60
        }
61
        
62
        public void setDefaultMark() {
63
                graphicStack.clear();
64
                /*
65
                 * Get default marker with well known name
66
                 */
67
                SLDMark mk = new SLDMark(SLDMark.MARK_TYPE_WELL_KNOWN_NAME);
68
                graphicStack.add(mk);
69
        }
70
        
71
        
72
        /**
73
         * Order matters, we use utility interface SLDGraphicStackElement 
74
         * This list is made of SLDMark and SLDExternalGraphic
75
         * 
76
         * @return
77
         */
78
        public List<SLDGraphicStackElement> getElementStack() {
79
                return graphicStack;
80
        }
81
        
82
        
83
        public SLDParameterValue getOpacity() {
84
                return this.opacity;
85
        }
86
        
87
        public SLDParameterValue getSize() {
88
                return this.size;
89
        }
90
        
91
        /**
92
         * In decimal degrees, clockwise
93
         * @return
94
         */
95
        public SLDParameterValue getRotation() {
96
                return this.rotation;
97
        }
98
        
99
        // ====================================
100
        
101
        public void setOpacity(SLDParameterValue opa) {
102
                this.opacity = opa;
103
        }
104
        
105
        public void setSize(SLDParameterValue sz) {
106
                this.size = sz;
107
        }
108
        
109
        /**
110
         * In decimal degrees, clockwise
111
         * @param rot
112
         */
113
        public void setRotation(SLDParameterValue rot) {
114
                this.rotation = rot;
115
        }
116

    
117

    
118
        public SLDAnchorPoint getAnchor() {
119
                return anchor;
120
        }
121

    
122

    
123
        public void setAnchor(SLDAnchorPoint anchor) {
124
                this.anchor = anchor;
125
        }
126

    
127

    
128
        public SLDDisplacement getDisplacement() {
129
                return displacement;
130
        }
131

    
132

    
133
        public void setDisplacement(SLDDisplacement displacement) {
134
                this.displacement = displacement;
135
        }
136

    
137

    
138
}