Revision 21359 branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectView.java
ProjectView.java | ||
---|---|---|
46 | 46 |
import java.util.TreeMap; |
47 | 47 |
import java.util.Map.Entry; |
48 | 48 |
|
49 |
import org.gvsig.fmap.drivers.reading.DriverIOException;
|
|
49 |
import org.gvsig.data.ReadException;
|
|
50 | 50 |
import org.gvsig.fmap.mapcontext.MapContext; |
51 | 51 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
52 | 52 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
53 | 53 |
import org.gvsig.fmap.mapcontext.layers.XMLException; |
54 | 54 |
import org.gvsig.fmap.mapcontext.layers.operations.AlphanumericData; |
55 | 55 |
|
56 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
57 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
|
58 | 56 |
import com.iver.andami.PluginServices; |
59 | 57 |
import com.iver.andami.ui.mdiManager.IWindow; |
60 | 58 |
import com.iver.cit.gvsig.project.Project; |
... | ... | |
124 | 122 |
* @throws XMLException |
125 | 123 |
* @throws DriverException |
126 | 124 |
* @throws DriverIOException |
127 |
* |
|
128 |
* @see com.iver.cit.gvsig.project.documents.ProjectDocument#setXMLEntity(com.iver.utiles.XMLEntity) |
|
129 |
*/ |
|
130 |
public void setXMLEntity03(XMLEntity xml) |
|
131 |
throws XMLException, ReadDriverException { |
|
132 |
super.setXMLEntity03(xml); |
|
133 |
int numViews = xml.getIntProperty("numViews"); |
|
134 |
ProjectDocument.NUMS.put(ProjectViewFactory.registerName,new Integer(numViews)); |
|
135 |
|
|
136 |
m_selectedField = xml.getStringProperty("m_selectedField"); |
|
137 |
m_typeLink = xml.getIntProperty("m_typeLink"); |
|
138 |
m_extLink = xml.getStringProperty("m_extLink"); |
|
139 |
setMapContext(MapContext.createFromXML03(xml.getChild(0))); |
|
140 |
|
|
141 |
if (xml.getBooleanProperty("mapOverView")) { |
|
142 |
setMapOverViewContext(MapContext.createFromXML03(xml.getChild(1))); |
|
143 |
} |
|
144 |
|
|
145 |
} |
|
146 |
|
|
147 |
/** |
|
148 |
* DOCUMENT ME! |
|
149 |
* |
|
150 |
* @param xml DOCUMENT ME! |
|
151 |
* @param p DOCUMENT ME! |
|
152 |
* @throws XMLException |
|
153 |
* @throws DriverException |
|
154 |
* @throws DriverIOException |
|
155 | 125 |
* @throws OpenException |
156 | 126 |
* |
157 | 127 |
* @see com.iver.cit.gvsig.project.documents.ProjectDocument#setXMLEntity(com.iver.utiles.XMLEntity) |
158 | 128 |
*/ |
159 | 129 |
public void setXMLEntity(XMLEntity xml) |
160 |
throws XMLException, ReadDriverException, OpenException {
|
|
130 |
throws XMLException, ReadException, OpenException { |
|
161 | 131 |
try{ |
162 | 132 |
super.setXMLEntity(xml); |
163 | 133 |
int currentChild=0; |
... | ... | |
236 | 206 |
} else { |
237 | 207 |
if (layer instanceof AlphanumericData) { |
238 | 208 |
try { |
239 |
project.exportToXMLDataSource(root,((AlphanumericData)layer).getRecordset().getName());
|
|
240 |
} catch (ReadDriverException e) {
|
|
209 |
project.exportToXMLDataSource(root,((AlphanumericData)layer).getFeatureStore().getName());
|
|
210 |
} catch (ReadException e) { |
|
241 | 211 |
throw new SaveException(e,layer.getName()); |
242 | 212 |
} |
243 | 213 |
|
... | ... | |
249 | 219 |
} |
250 | 220 |
} |
251 | 221 |
|
252 |
public void importFromXML(XMLEntity root, XMLEntity typeRoot, int elementIndex, Project project, boolean removeDocumentsFromRoot) throws XMLException, ReadDriverException, OpenException {
|
|
222 |
public void importFromXML(XMLEntity root, XMLEntity typeRoot, int elementIndex, Project project, boolean removeDocumentsFromRoot) throws XMLException, ReadException, OpenException { |
|
253 | 223 |
XMLEntity element = typeRoot.getChild(elementIndex); |
254 | 224 |
this.setXMLEntity(element); |
255 | 225 |
project.addDocument(this); |
Also available in: Unified diff