Revision 10436 branches/simbologia/libraries/libFMap/src/com/iver/cit/gvsig/fmap/core/symbols/MultiLayerLineSymbol.java
MultiLayerLineSymbol.java | ||
---|---|---|
43 | 43 |
* |
44 | 44 |
* $Id$ |
45 | 45 |
* $Log$ |
46 |
* Revision 1.1.2.1 2007-02-16 10:54:12 jaume |
|
46 |
* Revision 1.1.2.2 2007-02-21 07:34:09 jaume |
|
47 |
* labeling starts working |
|
48 |
* |
|
49 |
* Revision 1.1.2.1 2007/02/16 10:54:12 jaume |
|
47 | 50 |
* multilayer splitted to multilayerline, multilayermarker,and multilayerfill |
48 | 51 |
* |
49 | 52 |
* |
... | ... | |
63 | 66 |
import com.iver.cit.gvsig.fmap.core.SymbologyFactory; |
64 | 67 |
import com.iver.cit.gvsig.fmap.core.styles.ILabelStyle; |
65 | 68 |
import com.iver.cit.gvsig.fmap.core.styles.ILineStyle; |
69 |
import com.iver.cit.gvsig.fmap.core.v02.FSymbol; |
|
66 | 70 |
import com.iver.utiles.XMLEntity; |
67 | 71 |
|
68 | 72 |
public class MultiLayerLineSymbol extends AbstractSymbol implements |
69 | 73 |
ILineSymbol, IMultiLayerSymbol { |
70 | 74 |
private ILineSymbol[] layers = new ILineSymbol[0]; |
71 |
private MultiLayerLineSymbol selectionSymbol; |
|
72 |
private int symbolType; |
|
73 |
|
|
75 |
private ILineSymbol selectionSymbol; |
|
74 | 76 |
|
75 | 77 |
public Color getColor() { |
76 | 78 |
/* |
77 | 79 |
* a multilayer symbol does not define any color, the color |
78 |
* of each layer is defined by the self layer
|
|
80 |
* of each layer is defined by the layer itself
|
|
79 | 81 |
*/ |
80 | 82 |
return null; |
81 | 83 |
} |
... | ... | |
83 | 85 |
public ILineStyle getLineStyle() { |
84 | 86 |
/* |
85 | 87 |
* a multilayer symbol does not define any style, the style |
86 |
* of each layer is defined by the self layer
|
|
88 |
* of each layer is defined by the layer itself
|
|
87 | 89 |
*/ |
88 | 90 |
return null; |
89 | 91 |
} |
... | ... | |
155 | 157 |
|
156 | 158 |
public ISymbol getSymbolForSelection() { |
157 | 159 |
if (selectionSymbol == null) { |
158 |
selectionSymbol = new MultiLayerLineSymbol();
|
|
160 |
selectionSymbol = new SimpleLineSymbol();
|
|
159 | 161 |
selectionSymbol.setDescription(getDescription()); |
160 |
selectionSymbol.symbolType = symbolType; |
|
161 |
for (int i = 0; i < layers.length; i++) { |
|
162 |
selectionSymbol.addLayer(layers[i].getSymbolForSelection()); |
|
163 |
} |
|
162 |
selectionSymbol.setWidth(getWidth()); |
|
163 |
selectionSymbol.setColor(FSymbol.getSelectionColor()); |
|
164 | 164 |
} |
165 | 165 |
return selectionSymbol; |
166 | 166 |
} |
167 | 167 |
|
168 | 168 |
public int getSymbolType() { |
169 |
return symbolType;
|
|
169 |
return FShape.LINE;
|
|
170 | 170 |
} |
171 | 171 |
|
172 | 172 |
public XMLEntity getXMLEntity() { |
173 | 173 |
XMLEntity xml = new XMLEntity(); |
174 | 174 |
xml.putProperty("className", getClass().getName()); |
175 | 175 |
xml.putProperty("isShapeVisible", isShapeVisible()); |
176 |
xml.putProperty("symbolType", symbolType); |
|
177 | 176 |
xml.putProperty("desc", getDescription()); |
178 | 177 |
for (int i = 0; i < layers.length; i++) { |
179 | 178 |
xml.addChild(layers[i].getXMLEntity()); |
... | ... | |
192 | 191 |
public void setXMLEntity(XMLEntity xml) { |
193 | 192 |
setIsShapeVisible(xml.getBooleanProperty("isShapeVisible")); |
194 | 193 |
setDescription(xml.getStringProperty("desc")); |
195 |
symbolType = xml.getIntProperty("symbolType"); |
|
196 | 194 |
layers = new ILineSymbol[xml.getChildrenCount()]; |
197 | 195 |
for (int i = 0; i < layers.length; i++) { |
198 | 196 |
layers[i] = (ILineSymbol) SymbologyFactory.createSymbolFromXML(xml.getChild(i), "layer" + i); |
Also available in: Unified diff