Revision 30290 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/ProjectView.java
ProjectView.java | ||
---|---|---|
89 | 89 |
public XMLEntity getXMLEntity() throws SaveException { |
90 | 90 |
XMLEntity xml = super.getXMLEntity(); |
91 | 91 |
//xml.putProperty("nameClass", this.getClass().getName()); |
92 |
try{ |
|
93 |
int numViews=(ProjectDocument.NUMS.get(ProjectViewFactory.registerName)).intValue(); |
|
94 |
|
|
95 |
xml.putProperty("numViews", numViews); |
|
96 |
xml.putProperty("m_selectedField", m_selectedField); |
|
97 |
xml.putProperty("m_typeLink", m_typeLink); |
|
98 |
xml.putProperty("m_extLink", m_extLink); |
|
99 |
xml.addChild(mapContext.getXMLEntity()); |
|
100 |
|
|
101 |
if (mapOverViewContext != null) { |
|
102 |
if (mapOverViewContext.getViewPort() != null) { |
|
103 |
xml.putProperty("mapOverView", true); |
|
104 |
xml.addChild(mapOverViewContext.getXMLEntity()); |
|
105 |
} else { |
|
106 |
xml.putProperty("mapOverView", false); |
|
107 |
} |
|
108 |
} else { |
|
109 |
xml.putProperty("mapOverView", false); |
|
110 |
} |
|
111 |
}catch (Exception e) { |
|
112 |
throw new SaveException(e,this.getClass().getName()); |
|
113 |
} |
|
92 |
// try{
|
|
93 |
// int numViews=(ProjectDocument.NUMS.get(ProjectViewFactory.registerName)).intValue();
|
|
94 |
// |
|
95 |
// xml.putProperty("numViews", numViews);
|
|
96 |
// xml.putProperty("m_selectedField", m_selectedField);
|
|
97 |
// xml.putProperty("m_typeLink", m_typeLink);
|
|
98 |
// xml.putProperty("m_extLink", m_extLink);
|
|
99 |
// xml.addChild(mapContext.getXMLEntity());
|
|
100 |
// |
|
101 |
// if (mapOverViewContext != null) {
|
|
102 |
// if (mapOverViewContext.getViewPort() != null) {
|
|
103 |
// xml.putProperty("mapOverView", true);
|
|
104 |
// xml.addChild(mapOverViewContext.getXMLEntity());
|
|
105 |
// } else {
|
|
106 |
// xml.putProperty("mapOverView", false);
|
|
107 |
// }
|
|
108 |
// } else {
|
|
109 |
// xml.putProperty("mapOverView", false);
|
|
110 |
// }
|
|
111 |
// }catch (Exception e) {
|
|
112 |
// throw new SaveException(e,this.getClass().getName());
|
|
113 |
// }
|
|
114 | 114 |
return xml; |
115 | 115 |
} |
116 | 116 |
|
... | ... | |
127 | 127 |
*/ |
128 | 128 |
public void setXMLEntity(XMLEntity xml) |
129 | 129 |
throws XMLException { |
130 |
try{ |
|
131 |
super.setXMLEntity(xml); |
|
132 |
int currentChild=0; |
|
133 |
int numViews = xml.getIntProperty("numViews"); |
|
134 |
ProjectDocument.NUMS.put(ProjectViewFactory.registerName,new Integer(numViews)); |
|
135 |
|
|
136 |
if (xml.contains("m_selectedField")) { |
|
137 |
m_selectedField = xml.getStringProperty("m_selectedField"); |
|
138 |
} |
|
139 |
m_typeLink = xml.getIntProperty("m_typeLink"); |
|
140 |
if (xml.contains("m_extLink")) { |
|
141 |
m_extLink = xml.getStringProperty("m_extLink"); |
|
142 |
} |
|
143 |
|
|
144 |
setMapContext(MapContext.createFromXML(xml.getChild(currentChild))); |
|
145 |
currentChild++; |
|
146 |
if (xml.getBooleanProperty("mapOverView")) { |
|
147 |
setMapOverViewContext(MapContext.createFromXML(xml.getChild(currentChild))); |
|
148 |
currentChild++; |
|
149 |
} |
|
150 |
showErrors(); |
|
151 |
}catch (Exception e) { |
|
152 |
throw new OpenException(e,this.getClass().getName()); |
|
153 |
} |
|
130 |
// try{
|
|
131 |
// super.setXMLEntity(xml);
|
|
132 |
// int currentChild=0;
|
|
133 |
// int numViews = xml.getIntProperty("numViews");
|
|
134 |
// ProjectDocument.NUMS.put(ProjectViewFactory.registerName,new Integer(numViews));
|
|
135 |
// |
|
136 |
// if (xml.contains("m_selectedField")) {
|
|
137 |
// m_selectedField = xml.getStringProperty("m_selectedField");
|
|
138 |
// }
|
|
139 |
// m_typeLink = xml.getIntProperty("m_typeLink");
|
|
140 |
// if (xml.contains("m_extLink")) {
|
|
141 |
// m_extLink = xml.getStringProperty("m_extLink");
|
|
142 |
// }
|
|
143 |
// |
|
144 |
// setMapContext(MapContext.createFromXML(xml.getChild(currentChild)));
|
|
145 |
// currentChild++;
|
|
146 |
// if (xml.getBooleanProperty("mapOverView")) {
|
|
147 |
// setMapOverViewContext(MapContext.createFromXML(xml.getChild(currentChild)));
|
|
148 |
// currentChild++;
|
|
149 |
// }
|
|
150 |
// showErrors();
|
|
151 |
// }catch (Exception e) {
|
|
152 |
// throw new OpenException(e,this.getClass().getName());
|
|
153 |
// }
|
|
154 | 154 |
} |
155 | 155 |
|
156 | 156 |
/** |
Also available in: Unified diff