Revision 33659 branches/v2_0_0_prep/applications/appgvSIG/src/org/gvsig/app/project/documents/view/BaseViewDocument.java

View differences:

BaseViewDocument.java
56 56
import org.gvsig.fmap.mapcontext.layers.FLayer;
57 57
import org.gvsig.fmap.mapcontext.layers.FLayers;
58 58
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
59
import org.gvsig.tools.ToolsLocator;
60
import org.gvsig.tools.dynobject.DynStruct;
61 59
import org.gvsig.tools.exception.BaseException;
62
import org.gvsig.tools.persistence.PersistenceManager;
63 60
import org.gvsig.tools.persistence.PersistentState;
64 61
import org.gvsig.tools.persistence.exception.PersistenceException;
65 62

  
......
83 80
	protected MapContext mapOverViewContext;
84 81
	protected MapContext mapContext;
85 82
	
86
//	protected int m_typeLink = LinkListener.TYPELINKIMAGE;
87
//	protected String m_extLink;
88
//	protected String m_selectedField = null;
89

  
90 83
	public BaseViewDocument() {
91 84
		super();
92 85
	}
......
216 209
		return mapOverViewContext.getProjection();
217 210
	}
218 211

  
219
//	public String getExtLink() {
220
//		return m_extLink;
221
//	}
222
//
223
//	public int getTypeLink() {
224
//		return m_typeLink;
225
//	}
226
//
227
//	/**
228
//     * Se selecciona la extensi?n para realizar cuando se quiera el link.
229
//     *
230
//     * @param s nombre del campo.
231
//     */
232
//	public void setExtLink(String s) {
233
//		m_extLink = s;
234
//	}
235
//
236
//	/**
237
//     * Se selecciona el tipo de fichero para realizar cuando se quiera el link.
238
//     *
239
//     * @param i tipo de fichero.
240
//     */
241
//	public void setTypeLink(int i) {
242
//		m_typeLink = i;
243
//	}
244

  
245 212
	public void afterRemove() {
246 213
		// FIXME: Parece que no recorre correctamente el arbol de capas
247 214
		
......
281 248
		getMapContext().getViewPort().setBackColor(c);
282 249
	}
283 250

  
284
//	/**
285
//	 * Se selecciona el nombre del campo para realizar cuando se quiera el
286
//	 * link.
287
//	 *
288
//	 * @param s nombre del campo.
289
//	 */
290
//	public void setSelectedField(String s) {
291
//		m_selectedField = s;
292
//	}
293
//
294
//	public String getSelectedField() {
295
//		return m_selectedField;
296
//	}
297

  
298 251
	public void errorThrown(ErrorEvent e) {
299 252
			JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),
300 253
					PluginServices.getText(this,"fallo_capas")+" : \n"+
......
316 269
	
317 270
	public void saveToState(PersistentState state) throws PersistenceException {
318 271
		super.saveToState(state);
319
//		state.set("linkType", this.getTypeLink());
320
//		state.set("linkExtension",this.getExtLink());
321
//		state.set("selectedField", this.getSelectedField());
322 272
		state.set("mainMapContext", this.getMapContext());
323 273
		if( this.getMapOverViewContext() != null ) {
324 274
			state.set("useMapOverview", true);
......
330 280
	
331 281
	public void loadFromState(PersistentState state) throws PersistenceException {
332 282
		super.loadFromState(state);
333
//		this.setTypeLink( state.getInt("linkType"));
334
//		this.setExtLink(state.getString("linkExtension"));
335
//		this.setSelectedField(state.getString("selectedField"));
336
		
337 283
		this.mapContext = (MapContext) state.get("mainMapContext");
338 284
		if( state.getBoolean("useMapOverview") ) {
339 285
			this.mapOverViewContext = (MapContext) state.get("overviewMapContext");
......
342 288
		}
343 289
	}
344 290
	
345
	public static void registerPersistent() {
346
		PersistenceManager manager = ToolsLocator.getPersistenceManager();
347
		DynStruct definition = manager.addDefinition(
348
				BaseViewDocument.class,
349
				PERSISTENCE_DEFINITION_NAME,
350
				"Base view document persistence definition",
351
				null, 
352
				null
353
		);  
354
		definition.extend(manager.getDefinition(AbstractDocument.PERSISTENCE_DEFINITION_NAME));
355

  
356
		definition.addDynFieldBoolean("useMapOverview").setMandatory(true);
357
		definition.addDynFieldObject("mainMapContext").setClassOfValue(MapContext.class).setMandatory(true);
358
		definition.addDynFieldObject("overviewMapContext").setClassOfValue(MapContext.class).setMandatory(false);
359
	}
360
	
361 291
}

Also available in: Unified diff