root / branches / v10 / extensions / extPublish / src / com / iver / cit / gvsig / publish / infoProject / LayerInfo.java @ 13570
History | View | Annotate | Download (3.54 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004-2006 IVER T.I. 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 Iba?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 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package com.iver.cit.gvsig.publish.infoProject; |
42 |
|
43 |
import java.util.ArrayList; |
44 |
|
45 |
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver; |
46 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
47 |
import com.iver.cit.gvsig.fmap.layers.FLayerFileVectorial; |
48 |
import com.iver.cit.gvsig.fmap.layers.FLayerGenericVectorial; |
49 |
import com.iver.cit.gvsig.fmap.layers.FLayerVectorialDB; |
50 |
import com.iver.cit.gvsig.fmap.layers.FLayers; |
51 |
import com.iver.cit.gvsig.fmap.layers.FLyrDefault; |
52 |
import com.iver.cit.gvsig.fmap.layers.FLyrRaster; |
53 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
54 |
import com.iver.cit.gvsig.fmap.layers.LayersIterator; |
55 |
import com.iver.cit.gvsig.fmap.layers.ReadableVectorial; |
56 |
import com.iver.cit.gvsig.publish.infoProject.datasources.DataSourceInfoFactory; |
57 |
|
58 |
public class LayerInfo implements ILayerInfo { |
59 |
private FLayer layer = null; |
60 |
private LayerInfo[] layers = null; |
61 |
/**
|
62 |
* Constructor
|
63 |
*
|
64 |
* @param lyrs These are the layers from a view in gvSIG
|
65 |
*
|
66 |
* TODO: I must do an exception if the layer is not a FLyrVect or FLyrRaster
|
67 |
*/
|
68 |
public LayerInfo(FLayer lyr){
|
69 |
this.layer = lyr;
|
70 |
|
71 |
LayersIterator it = new LayersIterator(lyr);
|
72 |
//move iterator one layer (the layer itself)
|
73 |
it.nextLayer(); |
74 |
//for nested layers
|
75 |
ArrayList list = new ArrayList(); |
76 |
while (it.hasNext()){
|
77 |
list.add(it.nextLayer()); |
78 |
} |
79 |
if ( list.size()> 0){ |
80 |
this.layers = new LayerInfo[list.size()]; |
81 |
for ( int i = 0; i < list.size(); i++){ |
82 |
this.layers[i] = new LayerInfo((FLayer)list.get(i)); |
83 |
} |
84 |
} |
85 |
|
86 |
} |
87 |
|
88 |
public DataSourceInfo getDataSource() {
|
89 |
return DataSourceInfoFactory.getInstance(this.layer); |
90 |
} |
91 |
|
92 |
public Object getLegend() { |
93 |
// TODO Auto-generated method stub
|
94 |
return null; |
95 |
} |
96 |
|
97 |
public double getMaxX() { |
98 |
// TODO Auto-generated method stub
|
99 |
return 0; |
100 |
} |
101 |
|
102 |
public double getMaxY() { |
103 |
// TODO Auto-generated method stub
|
104 |
return 0; |
105 |
} |
106 |
|
107 |
public double getMaxscale() { |
108 |
// TODO Auto-generated method stub
|
109 |
return 0; |
110 |
} |
111 |
|
112 |
public double getMinX() { |
113 |
// TODO Auto-generated method stub
|
114 |
return 0; |
115 |
} |
116 |
|
117 |
public double getMinY() { |
118 |
// TODO Auto-generated method stub
|
119 |
return 0; |
120 |
} |
121 |
|
122 |
public double getMinscale() { |
123 |
// TODO Auto-generated method stub
|
124 |
return 0; |
125 |
} |
126 |
|
127 |
public String getName() { |
128 |
return this.layer.getName(); |
129 |
} |
130 |
|
131 |
public String getTitle() { |
132 |
return this.layer.getName(); |
133 |
} |
134 |
|
135 |
public ILayerInfo[] getLayers() { |
136 |
// TODO Auto-generated method stub
|
137 |
return layers;
|
138 |
} |
139 |
|
140 |
} |