svn-gvsig-desktop / branches / v2_0_0_prep / libraries / org.gvsig.arcims / src / org / gvsig / remoteclient / arcims / styling / renderers / SimpleLabelRenderer.java @ 32668
History | View | Annotate | Download (3.1 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2010 Prodevelop S.L. main development
|
26 |
* http://www.prodevelop.es
|
27 |
*/
|
28 |
|
29 |
package org.gvsig.remoteclient.arcims.styling.renderers; |
30 |
|
31 |
import org.gvsig.remoteclient.arcims.styling.symbols.IArcIMSSymbol; |
32 |
import org.gvsig.remoteclient.arcims.styling.symbols.ArcImsSymbolUtils; |
33 |
import org.gvsig.remoteclient.arcims.utils.ServiceInfoTags; |
34 |
|
35 |
|
36 |
/**
|
37 |
* @author jsanz
|
38 |
*
|
39 |
*/
|
40 |
public class SimpleLabelRenderer extends SimpleRenderer |
41 |
implements ILabelRenderer {
|
42 |
public static final String TAG = ServiceInfoTags.tSIMPLELABELRENDERER; |
43 |
private String rotationalangles; |
44 |
private String field; |
45 |
|
46 |
public SimpleLabelRenderer(String mfield, IArcIMSSymbol symbol) { |
47 |
super(symbol);
|
48 |
this.field = mfield;
|
49 |
rotationalangles = "";
|
50 |
} |
51 |
|
52 |
/**
|
53 |
* Generates an XML representation of the Renderer
|
54 |
*/
|
55 |
public String toString() { |
56 |
return "<" + SimpleLabelRenderer.TAG + getParam() + ">\r\n" + |
57 |
symbol.toString() + "</" + SimpleLabelRenderer.TAG + ">\r\n"; |
58 |
} |
59 |
|
60 |
private String getParam() { |
61 |
String param = ""; |
62 |
|
63 |
if (ArcImsSymbolUtils.isVoid(rotationalangles)) {
|
64 |
param += (" rotationalangles=\"" + rotationalangles + "\""); |
65 |
} |
66 |
|
67 |
if (ArcImsSymbolUtils.isVoid(field)) {
|
68 |
param += (" field=\"" + field + "\""); |
69 |
} |
70 |
|
71 |
return param;
|
72 |
} |
73 |
|
74 |
/**
|
75 |
* @return Returns the textSymbol.
|
76 |
*/
|
77 |
public IArcIMSSymbol getTextSymbol() {
|
78 |
return symbol;
|
79 |
} |
80 |
|
81 |
/**
|
82 |
* @param textSymbol The textSymbol to set.
|
83 |
*/
|
84 |
public void setTextSymbol(IArcIMSSymbol textSymbol) { |
85 |
this.symbol = textSymbol;
|
86 |
} |
87 |
|
88 |
/**
|
89 |
* @return Returns the labelField.
|
90 |
*/
|
91 |
public String getField() { |
92 |
return field;
|
93 |
} |
94 |
|
95 |
/**
|
96 |
* @param labelField The labelField to set.
|
97 |
*/
|
98 |
public void setField(String field) { |
99 |
this.field = field;
|
100 |
} |
101 |
|
102 |
/**
|
103 |
* @return Returns the rotationalAngles.
|
104 |
*/
|
105 |
public String getRotationalangles() { |
106 |
return rotationalangles;
|
107 |
} |
108 |
|
109 |
/**
|
110 |
* @param rotationalAngles The rotationalAngles to set.
|
111 |
*/
|
112 |
public void setRotationalangles(String rotationalAngles) { |
113 |
this.rotationalangles = rotationalAngles;
|
114 |
} |
115 |
} |