Revision 13370
branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayers.java | ||
---|---|---|
94 | 94 |
* a collection of layers, implementing, as well, specific methods for this kind of object, defined in the |
95 | 95 |
* interfaces <code>VectorialData</code>, <code>LayerCollection</code>, and <code>InfoByPoint</code>.</p> |
96 | 96 |
* |
97 |
* @see FLayer
|
|
97 |
* @see FLyrDefault
|
|
98 | 98 |
*/ |
99 | 99 |
public class FLayers extends FLyrDefault implements VectorialData, LayerCollection, InfoByPoint |
100 | 100 |
{ |
101 | 101 |
/** |
102 | 102 |
* List with all listeners registered for this kind of node. |
103 |
* |
|
104 |
* @see #addLayerCollectionListener(LayerCollectionListener) |
|
105 |
* @see #removeLayerCollectionListener(LayerCollectionListener) |
|
106 |
* @see #callLayerAdded(LayerCollectionEvent) |
|
107 |
* @see #callLayerAdding(LayerCollectionEvent) |
|
108 |
* @see #callLayerMoved(LayerPositionEvent) |
|
109 |
* @see #callLayerMoving(LayerPositionEvent) |
|
110 |
* @see #callLayerRemoved(LayerCollectionEvent) |
|
111 |
* @see #callLayerRemoving(LayerCollectionEvent) |
|
103 | 112 |
*/ |
104 | 113 |
protected ArrayList layerCollectionListeners = new ArrayList(); |
105 | 114 |
|
106 | 115 |
/** |
107 | 116 |
* A synchronized list with the layers. |
117 |
* |
|
118 |
* @see #setAllVisibles(boolean) |
|
119 |
* @see #addLayer(FLayer) |
|
120 |
* @see #addLayer(int, FLayer) |
|
121 |
* @see #moveTo(int, int) |
|
122 |
* @see #removeLayer(FLayer) |
|
123 |
* @see #removeLayer(int) |
|
124 |
* @see #removeLayer(String) |
|
125 |
* @see #replaceLayer(String, FLayer) |
|
126 |
* @see #getVisibles() |
|
127 |
* @see #getLayer(int) |
|
128 |
* @see #getLayer(String) |
|
129 |
* @see #getLayersCount() |
|
130 |
* @see #getFullExtent() |
|
108 | 131 |
*/ |
109 | 132 |
protected List layers = Collections.synchronizedList(new ArrayList()); |
110 | 133 |
|
111 | 134 |
/** |
112 | 135 |
* The model of the layer. |
136 |
* |
|
137 |
* @see #getMapContext() |
|
113 | 138 |
*/ |
114 | 139 |
protected MapContext fmap; |
115 | 140 |
|
... | ... | |
926 | 951 |
* </ul> |
927 | 952 |
* </p> |
928 | 953 |
* |
929 |
* <p>This xml entity has elements that represent and store information about this layer.</p>
|
|
954 |
* <p>This XML entity has elements that represent and store information about this layer.</p>
|
|
930 | 955 |
* |
931 |
* @return an xml entity with information to this collection of layers
|
|
956 |
* @return an XML entity with information to this collection of layers
|
|
932 | 957 |
* @throws com.iver.cit.gvsig.fmap.layers.XMLException if there is an error obtaining the object. |
933 | 958 |
*/ |
934 | 959 |
public XMLEntity getXMLEntity() throws XMLException { |
... | ... | |
966 | 991 |
} |
967 | 992 |
|
968 | 993 |
/** |
969 |
* <p>Inserts layers and their properties to this collection, from an xml entity. Also adds properties to the collection of layers (root node).
|
|
994 |
* <p>Inserts layers and their properties to this collection, from an XML entity. Also adds properties to the collection of layers (root node).
|
|
970 | 995 |
* |
971 |
* <p>The xml entity as parameter must have a tree-node structure, the root must have at least two properties, and each (first-level)
|
|
996 |
* <p>The XML entity as parameter must have a tree-node structure, the root must have at least two properties, and each (first-level)
|
|
972 | 997 |
* child can be a raster layer <i>(<code>FLyrRaster</code>)</i>, a vectorial layer <i>(<code>FLyrVect</code>)</i>, |
973 | 998 |
* another collection of layers <i>(<code>FLayers</code>)</i>, or another kind of layer <i>(<code>FLayer</code>)</i> .</p> |
974 | 999 |
* |
... | ... | |
1418 | 1443 |
} |
1419 | 1444 |
|
1420 | 1445 |
/** |
1421 |
* <p>Adds the layer with the information in an xml entity and the specified name, to this collection of layers. And
|
|
1446 |
* <p>Adds the layer with the information in an XML entity and the specified name, to this collection of layers. And
|
|
1422 | 1447 |
* returns <code>true</code> if there hasn't been errors.</p> |
1423 | 1448 |
* |
1424 | 1449 |
* @see FLayers#addLayerFromXML(XMLEntity, String) |
... | ... | |
1436 | 1461 |
} |
1437 | 1462 |
|
1438 | 1463 |
/** |
1439 |
* <p>Adds the layer with the information in an xml entity and the specified name, to this collection of layers.</p>
|
|
1464 |
* <p>Adds the layer with the information in an XML entity and the specified name, to this collection of layers.</p>
|
|
1440 | 1465 |
* |
1441 | 1466 |
* <p>This method really executes the addition, considering the kind of layer (<code>FLyrVect</code>, |
1442 | 1467 |
* <code>FLyrAnnotation</code>, <code>FLyrRaster</code>, a collection of layers (<code>FLayers</code>), |
... | ... | |
1673 | 1698 |
} |
1674 | 1699 |
|
1675 | 1700 |
/** |
1676 |
* <p>Creates a new layer of the same class as the property <i>className</i> of the xml, after, adds the xml entity to that layer
|
|
1701 |
* <p>Creates a new layer of the same class as the property <i>className</i> of the XML, after, adds the XML entity to that layer
|
|
1677 | 1702 |
* and loads the layer. Then, adds the layer to this collection of layers, and if there is a projection defined, |
1678 | 1703 |
* inserts the transformation coordinates to the layer.</p> |
1679 | 1704 |
* |
branches/v10/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrDefault.java | ||
---|---|---|
70 | 70 |
/** |
71 | 71 |
* <p>Implementation of the high level characteristics of the layers: visibility, activation, name, ...</p> |
72 | 72 |
* |
73 |
* <p>Represents a definition of a basic <a href="http://www.gvsig.gva.es/">gvSIG</a> 's layer, with the implementation of
|
|
73 |
* <p>Represents a definition of a basic <a href="http://www.gvsig.gva.es/">gvSIG</a>'s FMap layer, with the implementation of
|
|
74 | 74 |
* the <code>FLayer</code> methods, and new functionality: |
75 | 75 |
* <ul> |
76 | 76 |
* <li>Supports transparency. |
... | ... | |
95 | 95 |
|
96 | 96 |
/** |
97 | 97 |
* Path to the upper layer which this layer belongs. |
98 |
* |
|
99 |
* @see FLayers |
|
100 |
* @see #getParentLayer() |
|
101 |
* @see #setParentLayer(FLayers) |
|
98 | 102 |
*/ |
99 | 103 |
private FLayers parentLayer = null; |
100 | 104 |
|
101 | 105 |
/** |
102 | 106 |
* A node in the tree of layers. Isn't used. |
107 |
* |
|
108 |
* @see FLayers |
|
109 |
* @see #getVirtualLayers() |
|
110 |
* @see #setVirtualLayers(FLayers) |
|
103 | 111 |
*/ |
104 | 112 |
private FLayers virtualLayers = null; |
105 | 113 |
|
106 | 114 |
/** |
107 | 115 |
* Text layer associated to this layer. |
116 |
* |
|
117 |
* @see FLyrText |
|
118 |
* @see #getLayerText() |
|
119 |
* @see #setLayerText(FLyrText) |
|
108 | 120 |
*/ |
109 | 121 |
private FLyrText layerText = null; |
110 | 122 |
|
111 | 123 |
/** |
112 |
* Name for this layer, this also will be a property in the xml entity that represents this layer. |
|
124 |
* Name for this layer, this also will be a property in the XML entity that represents this layer. |
|
125 |
* |
|
126 |
* @see #getName() |
|
127 |
* @see #setName(String) |
|
113 | 128 |
*/ |
114 | 129 |
private String name; |
115 | 130 |
|
116 | 131 |
/** |
117 | 132 |
* Projection for this layer. |
133 |
* |
|
134 |
* @see IProjection |
|
135 |
* @see #getProjection() |
|
136 |
* @see #setProjection(IProjection) |
|
118 | 137 |
*/ |
119 | 138 |
private IProjection projection; |
120 | 139 |
|
... | ... | |
124 | 143 |
|
125 | 144 |
/** |
126 | 145 |
* Transparency level of this layer in the range 0-255. By default 0. |
146 |
* |
|
147 |
* @see #getTransparency() |
|
148 |
* @see #setTransparency(int) |
|
127 | 149 |
*/ |
128 | 150 |
private int transparency = 0; |
129 | 151 |
|
130 | 152 |
/** |
131 | 153 |
* Coordinate transformation. |
154 |
* |
|
155 |
* @see ICoordTrans |
|
156 |
* @see #getCoordTrans() |
|
157 |
* @see #setCoordTrans(ICoordTrans) |
|
132 | 158 |
*/ |
133 | 159 |
private ICoordTrans ct; |
134 | 160 |
|
135 | 161 |
/** |
136 | 162 |
* Minimum scale, >= 0 or -1 if not used. By default -1. |
163 |
* |
|
164 |
* @see #getMinScale() |
|
165 |
* @see #setMinScale(double) |
|
137 | 166 |
*/ |
138 | 167 |
private double minScale = -1; |
139 | 168 |
|
140 | 169 |
/** |
141 | 170 |
* Maximum scale, >= 0 or -1 if not used. By default -1. |
171 |
* |
|
172 |
* @see #getMaxScale() |
|
173 |
* @see #setMaxScale(double) |
|
142 | 174 |
*/ |
143 | 175 |
private double maxScale = -1; |
144 | 176 |
|
... | ... | |
146 | 178 |
|
147 | 179 |
/** |
148 | 180 |
* Array list with all listeners associated to this layer. |
181 |
* |
|
182 |
* @see #getLayerListeners() |
|
183 |
* @see #setLayerText(FLyrText) |
|
184 |
* @see #removeLayerListener(LayerListener) |
|
185 |
* @see #callEditionChanged(LayerEvent) |
|
149 | 186 |
*/ |
150 | 187 |
protected ArrayList layerListeners = new ArrayList(); |
151 | 188 |
|
152 | 189 |
/** |
153 | 190 |
* Strategy of drawing and processing for this layer. |
191 |
* |
|
192 |
* @see Strategy |
|
193 |
* @see #getStrategy() |
|
194 |
* @see #setStrategy(Strategy) |
|
154 | 195 |
*/ |
155 | 196 |
private Strategy privateStrategy = null; |
156 | 197 |
|
... | ... | |
158 | 199 |
|
159 | 200 |
/** |
160 | 201 |
* Hash table with the extended properties of this layer. |
202 |
* |
|
203 |
* @see #getProperty(Object) |
|
204 |
* @see #setProperty(Object, Object) |
|
205 |
* @see #getExtendedProperties() |
|
161 | 206 |
*/ |
162 | 207 |
private Hashtable properties = new Hashtable(); |
163 | 208 |
|
... | ... | |
165 | 210 |
|
166 | 211 |
/** |
167 | 212 |
* Image with bands that stores the information of the drawn layers. |
213 |
* |
|
214 |
* @see BufferedImage |
|
215 |
* @see #getCacheImageDrawnLayers() |
|
216 |
* @see #setCacheImageDrawnLayers(BufferedImage) |
|
168 | 217 |
*/ |
169 | 218 |
private BufferedImage cacheImageDrawnLayers = null; |
170 | 219 |
|
... | ... | |
173 | 222 |
// private boolean available = true; |
174 | 223 |
|
175 | 224 |
//by default, all is active, visible and avalaible |
176 |
|
|
225 |
|
|
177 | 226 |
/** |
178 | 227 |
* Status of this layer. |
228 |
* |
|
229 |
* @see FLayerStatus |
|
230 |
* @see #getFLayerStatus() |
|
231 |
* @see #setFLayerStatus(FLayerStatus) |
|
232 |
* @see #isActive() |
|
233 |
* @see #setActive(boolean) |
|
234 |
* @see #isVisible() |
|
235 |
* @see #setVisible(boolean) |
|
236 |
* @see #visibleRequired() |
|
237 |
* @see #isEditing() |
|
238 |
* @see #setEditing(boolean) |
|
239 |
* @see #isInTOC() |
|
240 |
* @see #isCachingDrawnLayers() |
|
241 |
* @see #setCachingDrawnLayers(boolean) |
|
242 |
* @see #isDirty() |
|
243 |
* @see #setDirty(boolean) |
|
244 |
* @see #isAvailable() |
|
245 |
* @see #setAvailable(boolean) |
|
246 |
* @see #isOk() |
|
247 |
* @see #isWritable() |
|
248 |
* @see #getNumErrors() |
|
249 |
* @see #getError(int) |
|
250 |
* @see #getErrors() |
|
251 |
* @see #addError(DriverException) |
|
179 | 252 |
*/ |
180 | 253 |
private FLayerStatus status = new FLayerStatus(); |
181 | 254 |
|
182 | 255 |
/** |
183 | 256 |
* Image drawn shown in the <i>TOC</i> according the status of this layer. |
257 |
* |
|
258 |
* @see #getTocStatusImage() |
|
259 |
* @see #setTocStatusImage(Image) |
|
184 | 260 |
*/ |
185 | 261 |
private Image tocStatusImage; |
186 | 262 |
|
... | ... | |
350 | 426 |
/** |
351 | 427 |
* <p>Returns an entity that represents this layer.</p> |
352 | 428 |
* |
353 |
* <p>This xml entity has elements (properties) that represent and store information about this layer.</p>
|
|
429 |
* <p>This XML entity has elements (properties) that represent and store information about this layer.</p>
|
|
354 | 430 |
* |
355 | 431 |
* <p>There are two kinds of information: default properties of this layer, and extended properties (they added that weren't by default)</p> |
356 | 432 |
* |
... | ... | |
389 | 465 |
* <ul> |
390 | 466 |
* </p> |
391 | 467 |
* |
392 |
* @return an xml entity with information to the current layer
|
|
468 |
* @return an XML entity with information to the current layer
|
|
393 | 469 |
* @throws com.iver.cit.gvsig.fmap.layers.XMLException if there is an error obtaining the object. |
394 | 470 |
*/ |
395 | 471 |
public XMLEntity getXMLEntity() throws XMLException { |
... | ... | |
459 | 535 |
/** |
460 | 536 |
* <p>Inserts information to this layer.</p> |
461 | 537 |
* |
462 |
* <p>This xml entity has elements that represent and store information about this layer.</p>
|
|
538 |
* <p>This XML entity has elements that represent and store information about this layer.</p>
|
|
463 | 539 |
* |
464 | 540 |
* <p>The properties are the same as the described in <code>getXMLEntity()</code>. And the properties |
465 | 541 |
* <i>proj</i>, <i>transparency</i>, <i>isInTOC</i>, <i>numProperties</i> are optional.</p> |
Also available in: Unified diff