Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libArcIMS_old / src / org / gvsig / remoteClient / arcims / styling / symbols / GradientFillSymbol.java @ 11865

History | View | Annotate | Download (4.06 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2006 Prodevelop 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
 *   Prodevelop Integraci?n de Tecnolog?as SL
34
 *   Conde Salvatierra de ?lava , 34-10
35
 *   46004 Valencia
36
 *   Spain
37
 *
38
 *   +34 963 510 612
39
 *   +34 963 510 968
40
 *   gis@prodevelop.es
41
 *   http://www.prodevelop.es
42
 */
43

    
44
/**
45
 *
46
 */
47
package org.gvsig.remoteClient.arcims.styling.symbols;
48

    
49
import com.iver.cit.gvsig.fmap.core.v02.FSymbol;
50

    
51
import org.gvsig.remoteClient.arcims.utils.ServiceInfoTags;
52

    
53

    
54
/**
55
 * @author jsanz
56
 *
57
 */
58
public class GradientFillSymbol extends AbstractSymbol implements IArcIMSSymbol {
59
    public static final String TAG = ServiceInfoTags.tSIMPLEPOLYGONSYMBOL;
60
    private String finishcolor;
61
    private String startcolor;
62
    private String transparency;
63
    private String type;
64

    
65
    /**
66
     *
67
     */
68
    public GradientFillSymbol() {
69
        finishcolor = "0,0,0";
70
        startcolor = "255,255,255";
71
        transparency = "1.0";
72
        type = "bdiagonal";
73
    }
74

    
75
    /**
76
     * Generates an XML representation of the Symbol
77
     */
78
    public String toString() {
79
        String start = "<" + GradientFillSymbol.TAG;
80
        String end = "/>\r\n";
81

    
82
        return start + getParam() + end;
83
    }
84

    
85
    protected String getParam() {
86
        String param = new String();
87

    
88
        //Checks for every parameter
89
        if (SymbolUtils.isVoid(finishcolor)) {
90
            param += (" finishcolor=\"" + finishcolor + "\"");
91
        }
92

    
93
        if (SymbolUtils.isVoid(startcolor)) {
94
            param += (" startcolor=\"" + startcolor + "\"");
95
        }
96

    
97
        if (SymbolUtils.isVoid(transparency)) {
98
            param += (" transparency=\"" + transparency + "\"");
99
        }
100

    
101
        if (SymbolUtils.isVoid(type)) {
102
            param += (" type=\"" + type + "\"");
103
        }
104

    
105
        return param;
106
    }
107

    
108
    /**
109
     * @return Returns the finishcolor.
110
     */
111
    public String getFinishcolor() {
112
        return finishcolor;
113
    }
114

    
115
    /**
116
     * @param finishcolor The finishcolor to set.
117
     */
118
    public void setFinishcolor(String finishcolor) {
119
        this.finishcolor = finishcolor;
120
    }
121

    
122
    /**
123
     * @return Returns the startcolor.
124
     */
125
    public String getStartcolor() {
126
        return startcolor;
127
    }
128

    
129
    /**
130
     * @param startcolor The startcolor to set.
131
     */
132
    public void setStartcolor(String startcolor) {
133
        this.startcolor = startcolor;
134
    }
135

    
136
    /**
137
     * @return Returns the transparency.
138
     */
139
    public String getTransparency() {
140
        return transparency;
141
    }
142

    
143
    /**
144
     * @param transparency The transparency to set.
145
     */
146
    public void setTransparency(String transparency) {
147
        this.transparency = transparency;
148
    }
149

    
150
    /**
151
     * @return Returns the type.
152
     */
153
    public String getType() {
154
        return type;
155
    }
156

    
157
    /**
158
     * @param type The type to set.
159
     */
160
    public void setType(String type) {
161
        this.type = type;
162
    }
163

    
164
    /* (non-Javadoc)
165
     * @see org.gvsig.remoteClient.arcims.styling.symbols.IArcIMSSymbol#getFSymbol()
166
     */
167
    public FSymbol getFSymbol() {
168
        return ArcImsFSymbolFactory.getFSymbol(this);
169
    }
170
}