Revision 9532

View differences:

trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutEditVertexExtension.java
76 76
		logger.debug("Comand : " + s);
77 77
		if (s.compareTo("VERTEX") == 0) {
78 78
			layout.getLayoutControl().setTool("layoutedit");
79
			layout.getModel().setModified(true);
79 80
		}
80 81
	}
81 82

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/RemoveTableUnion.java
41 41
			// TODO Auto-generated catch block
42 42
			e.printStackTrace();
43 43
		}
44
        t.getModel().setModified(true);
44 45
	}
45 46

  
46 47
	/**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/RemoveTableLink.java
67 67
		Table t = (Table) PluginServices.getMDIManager().getActiveWindow();
68 68
		ProjectTable pt = t.getModel();
69 69
		pt.removeLinkTable();//restoreDataSource();
70
		t.getModel().setModified(true);
70 71
	}
71 72

  
72 73
	/**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/AddLayer.java
68 68
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
69 69
import com.iver.cit.gvsig.fmap.layers.LayerFactory;
70 70
import com.iver.cit.gvsig.gui.WizardPanel;
71
import com.iver.cit.gvsig.project.documents.ProjectDocument;
71 72
import com.iver.cit.gvsig.project.documents.gui.FOpenDialog;
72 73
import com.iver.cit.gvsig.project.documents.gui.FileOpenDialog;
73 74
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
......
182 183
		MapControl mapControl=theView.getMapControl();
183 184
		this.addLayers(mapControl);
184 185
		mapControl.getMapContext().callLegendChanged();
185
		return;
186

  
186
		((ProjectDocument)theView.getModel()).setModified(true);
187 187
	}
188 188

  
189 189
	/**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ThemeControls.java
69 69
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
70 70
import com.iver.cit.gvsig.fmap.operations.strategies.SelectedShapeVisitor;
71 71
import com.iver.cit.gvsig.fmap.operations.strategies.VisitException;
72
import com.iver.cit.gvsig.project.documents.ProjectDocument;
72 73
import com.iver.cit.gvsig.project.documents.view.IProjectView;
73 74
import com.iver.cit.gvsig.project.documents.view.gui.View;
74 75
import com.iver.utiles.GenericFileFilter;
......
94 95

  
95 96
        if (s.equals("SHAPE_SELECTED")) {
96 97
			createShape(mapa);
98
			 ((ProjectDocument)vista.getModel()).setModified(true);
97 99
		} else if (s.equals("DXF_SELECTED")) {
98 100
			createDxf(mapa);
101
			((ProjectDocument)vista.getModel()).setModified(true);
99 102
		} else if (s.equals("ZOOM_SELECT")) {
100 103
			Rectangle2D selectedExtent = mapa.getSelectionBounds();
101 104

  
102 105
			if (selectedExtent != null) {
103 106
				mapa.getViewPort().setExtent(selectedExtent);
107
				((ProjectDocument)vista.getModel()).setModified(true);
104 108
			}
105 109
		}
106 110
	}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/InfoToolExtension.java
53 53
import com.iver.cit.gvsig.fmap.MapContext;
54 54
import com.iver.cit.gvsig.fmap.MapControl;
55 55
import com.iver.cit.gvsig.fmap.layers.FLayer;
56
import com.iver.cit.gvsig.project.documents.ProjectDocument;
56 57
import com.iver.cit.gvsig.project.documents.view.IProjectView;
57 58
import com.iver.cit.gvsig.project.documents.view.gui.View;
58 59

  
......
68 69
		View vista = (View) PluginServices.getMDIManager().getActiveWindow();
69 70
		MapControl mapCtrl = vista.getMapControl();
70 71
		logger.debug("Comand : " + s);
71
	
72

  
72 73
		if (s.compareTo("INFO") == 0) {
73 74
			mapCtrl.setTool("info");
75
			((ProjectDocument)vista.getModel()).setModified(true);
74 76
		}
75 77
	}
76 78

  
......
114 116
		if (f == null) {
115 117
			return false;
116 118
		}
117
		
119

  
118 120
		if (f instanceof View) {
119 121
			View vista = (View) f;
120 122
			IProjectView model = vista.getModel();
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ShowTable.java
155 155
					projectTable.setModel(ea);
156 156
					Table t = new Table();
157 157
					t.setModel(projectTable);
158
					t.getModel().setModified(true);
158 159
					PluginServices.getMDIManager().addWindow(t);
159 160
				}
160 161
			}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ClearSelectionExtension.java
56 56
import com.iver.cit.gvsig.fmap.layers.FLayers;
57 57
import com.iver.cit.gvsig.fmap.layers.FLyrVect;
58 58
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
59
import com.iver.cit.gvsig.project.documents.ProjectDocument;
59 60
import com.iver.cit.gvsig.project.documents.table.ProjectTable;
60 61
import com.iver.cit.gvsig.project.documents.table.gui.Table;
61 62
import com.iver.cit.gvsig.project.documents.view.IProjectView;
......
87 88
				if (refresh) {
88 89
					mapCtrl.drawMap(false);
89 90
				}
91
				((ProjectDocument)vista.getModel()).setModified(true);
90 92
			}else if (view instanceof Table){
91 93
				Table table = (Table) view;
92 94
				ProjectTable model = table.getModel();
......
99 101
			    if (refresh) {
100 102
			    	table.refresh();
101 103
				}
104
			    table.getModel().setModified(true);
102 105
			}
103 106
		}
104 107
    }
......
106 109

  
107 110
	private boolean clearSelectionOfView(FLayers layers){
108 111
		boolean refresh=false;
109
		
112

  
110 113
		for (int i = 0; i < layers.getLayersCount(); i++) {
111 114
			FLayer lyr =layers.getLayer(i);
112 115
			if (lyr instanceof FLayers){
113 116
				refresh = refresh || clearSelectionOfView((FLayers) lyr);
114 117
			} else if (lyr instanceof FLyrVect) {
115
				FLyrVect lyrVect = (FLyrVect) lyr; 
118
				FLyrVect lyrVect = (FLyrVect) lyr;
116 119
				if (lyrVect.isActive()) {
117 120
					try {
118 121
						SelectableDataSource dataSource;
......
176 179
					return true;
177 180
				}
178 181
			} else if (lyr instanceof FLyrVect) {
179
				FLyrVect lyrVect = (FLyrVect) lyr; 
182
				FLyrVect lyrVect = (FLyrVect) lyr;
180 183
				if (lyrVect.isActive()) {
181 184
					if (lyrVect.isAvailable()){
182 185
						try {
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java
58 58
import com.iver.cit.gvsig.fmap.layers.LayerFactory;
59 59
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource;
60 60
import com.iver.cit.gvsig.gui.filter.ExpressionListener;
61
import com.iver.cit.gvsig.project.Project;
61 62
import com.iver.cit.gvsig.project.documents.table.FieldSelectionModel;
62 63
import com.iver.cit.gvsig.project.documents.table.ObjectSelectionStep;
63 64
import com.iver.cit.gvsig.project.documents.table.ProjectTable;
......
84 85
	 * @see com.iver.mdiApp.plugins.IExtension#updateUI(java.lang.String)
85 86
	 */
86 87
	public void execute(String actionCommand) {
88
		ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
89
		Project project=pe.getProject();
90
		ProjectTable[] pts = (ProjectTable[]) project.getDocumentsByType(ProjectTableFactory.registerName)
91
			.toArray(new ProjectTable[0]);
87 92
		if ("JOIN".equals(actionCommand)) {
88
			ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
89
			ProjectTable[] pts = (ProjectTable[]) pe.getProject().getDocumentsByType(ProjectTableFactory.registerName)
90
													.toArray(new ProjectTable[0]);
91

  
92 93
			try {
93 94
				final ObjectSelectionStep sourceTable = new ObjectSelectionStep();
94 95
				sourceTable.setModel(new TableSelectionModel(pts,
......
225 226
							wiz.enableNext(((ObjectSelectionStep) wiz.getCurrentStep()).getSelectedItem() != null);
226 227
						}
227 228
					});
229
				project.setModified(true);
228 230
				PluginServices.getMDIManager().addWindow(wiz);
229 231
			} catch (SelectionException e) {
230 232
				NotificationManager.addError("Error abriendo el asistente", e);
231 233
			}
232 234
		}else if ("LINK".equals(actionCommand)) {
233
			ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class);
234
			ProjectTable[] pts = (ProjectTable[]) pe.getProject().getDocumentsByType(ProjectTableFactory.registerName)
235
													.toArray(new ProjectTable[0]);
236

  
237 235
			try {
238 236
				final ObjectSelectionStep sourceTable = new ObjectSelectionStep();
239 237
				sourceTable.setModel(new TableSelectionModel(pts,
......
341 339
							wiz.enableNext(((ObjectSelectionStep) wiz.getCurrentStep()).getSelectedItem() != null);
342 340
						}
343 341
					});
342
				project.setModified(true);
344 343
				PluginServices.getMDIManager().addWindow(wiz);
345 344
			} catch (SelectionException e) {
346 345
				NotificationManager.addError("Error abriendo el asistente", e);
......
355 354
		// By Pablo: if no expression -> no element selected
356 355
		if (! this.filterExpressionFromWhereIsEmpty(expression)) {
357 356
			long[] sel = doSet(expression);
358
	
357

  
359 358
			if (sel == null) {
360 359
				throw new RuntimeException("Not a 'where' clause?");
361 360
			}
362
	
361

  
363 362
			FBitSet selection = new FBitSet();
364
	
363

  
365 364
			for (int i = 0; i < sel.length; i++) {
366 365
				selection.set((int) sel[i]);
367 366
			}
368
	
367

  
369 368
			dataSource.clearSelection();
370 369
			dataSource.setSelection(selection);
371 370
		}
......
408 407
		// By Pablo: if no expression -> don't add more elements to set
409 408
		if (! this.filterExpressionFromWhereIsEmpty(expression)) {
410 409
			long[] sel = doSet(expression);
411
	
410

  
412 411
			if (sel == null) {
413 412
				throw new RuntimeException("Not a 'where' clause?");
414 413
			}
415
	
414

  
416 415
			FBitSet selection = new FBitSet();
417
	
416

  
418 417
			for (int i = 0; i < sel.length; i++) {
419 418
				selection.set((int) sel[i]);
420 419
			}
421
	
420

  
422 421
			FBitSet fbs = dataSource.getSelection();
423 422
			fbs.or(selection);
424 423
			dataSource.setSelection(fbs);
......
432 431
		// By Pablo: if no expression -> no element selected
433 432
		if (! this.filterExpressionFromWhereIsEmpty(expression)) {
434 433
			long[] sel = doSet(expression);
435
	
434

  
436 435
			if (sel == null) {
437 436
				throw new RuntimeException("Not a 'where' clause?");
438 437
			}
439
	
438

  
440 439
			FBitSet selection = new FBitSet();
441
	
440

  
442 441
			for (int i = 0; i < sel.length; i++) {
443 442
				selection.set((int) sel[i]);
444 443
			}
445
	
444

  
446 445
			FBitSet fbs = dataSource.getSelection();
447 446
			fbs.and(selection);
448 447
			dataSource.setSelection(fbs);
......
452 451
			dataSource.clearSelection();
453 452
		}
454 453
	}
455
	
454

  
456 455
	/**
457 456
	 * Returns true if the WHERE subconsultation of the filterExpression is empty ("")
458
	 * 
457
	 *
459 458
	 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
460 459
	 * @param expression An string
461
	 * @return A boolean value 
460
	 * @return A boolean value
462 461
	 */
463 462
	private boolean filterExpressionFromWhereIsEmpty(String expression) {
464 463
		String subExpression = expression.trim();
465
		int pos;	
466
		
464
		int pos;
465

  
467 466
		// Remove last ';' if exists
468 467
		if (subExpression.charAt(subExpression.length() -1) == ';')
469 468
			subExpression = subExpression.substring(0, subExpression.length() -1).trim();
470
		
469

  
471 470
		// If there is no 'where' clause
472 471
		if ((pos = subExpression.indexOf("where")) == -1)
473 472
			return false;
474
		
473

  
475 474
		// If there is no subexpression in the WHERE clause -> true
476 475
		subExpression = subExpression.substring(pos + 5, subExpression.length()).trim(); // + 5 is the length of 'where'
477 476
		if ( subExpression.length() == 0 )
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutEditableControls.java
81 81
	public void execute(String s) {
82 82
		Layout layout = (Layout) PluginServices.getMDIManager().getActiveWindow();
83 83
		if (s.equals("PROPERTIES")) {
84
			layout.showFProperties();
84
			if (layout.showFProperties()) {
85
				layout.getModel().setModified(true);
86
			}
85 87
		}
86 88
	}
87 89
	/**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/FiltroExtension.java
64 64
import com.iver.cit.gvsig.gui.filter.DefaultExpressionDataSource;
65 65
import com.iver.cit.gvsig.gui.filter.ExpressionListener;
66 66
import com.iver.cit.gvsig.gui.filter.FilterDialog;
67
import com.iver.cit.gvsig.project.documents.ProjectDocument;
67 68
import com.iver.cit.gvsig.project.documents.table.gui.Table;
68 69
import com.iver.cit.gvsig.project.documents.view.IProjectView;
69 70
import com.iver.utiles.exceptionHandling.ExceptionListener;
......
98 99
				if (v instanceof Table) {
99 100
					vista = (Table) v;
100 101

  
101
					dataSource = (SelectableDataSource)vista.getModel().getModelo().getRecordset();
102
					dataSource = vista.getModel().getModelo().getRecordset();
102 103
					filterTitle = vista.getModel().getName();
103

  
104
					vista.getModel().setModified(true);
104 105
				} else if (v instanceof com.iver.cit.gvsig.project.documents.view.gui.View) {
105 106
					IProjectView pv = ((com.iver.cit.gvsig.project.documents.view.gui.View) v).getModel();
106 107
					filterTitle = ((com.iver.cit.gvsig.project.documents.view.gui.View) v).getModel().getName();
107 108
					FLayer layer = pv.getMapContext()
108 109
					.getLayers().getActives()[0];
109 110
					dataSource = pv.getProject().getDataSourceByLayer(layer);
111
					((ProjectDocument)pv).setModified(true);
110 112
				}
111 113
			}  catch (DriverException e) {
112 114
				NotificationManager.addError("Error filtrando", e);
......
216 218
		if (! this.filterExpressionFromWhereIsEmpty(expression)) {
217 219
			try {
218 220
				long[] sel = doSet(expression);
219
		
221

  
220 222
				if (sel == null) {
221 223
					//throw new RuntimeException("Not a 'where' clause?");
222 224
					return;
223 225
				}
224
		
226

  
225 227
				FBitSet selection = new FBitSet();
226
		
228

  
227 229
				for (int i = 0; i < sel.length; i++) {
228 230
					selection.set((int) sel[i]);
229 231
				}
230
		
232

  
231 233
				dataSource.clearSelection();
232 234
				dataSource.setSelection(selection);
233 235
			}catch(Exception e){
......
237 239
		else {
238 240
			// By Pablo: if no expression -> no element selected
239 241
			dataSource.clearSelection();
240
		}		
242
		}
241 243
	}
242 244

  
243 245
	/**
......
275 277
		// By Pablo: if no filter expression -> don't add more elements to set
276 278
		if (! this.filterExpressionFromWhereIsEmpty(expression)) {
277 279
			long[] sel = doSet(expression);
278
	
280

  
279 281
			if (sel == null) {
280 282
				//throw new RuntimeException("Not a 'where' clause?");
281 283
				return;
282 284
			}
283
	
285

  
284 286
			FBitSet selection = new FBitSet();
285
	
287

  
286 288
			for (int i = 0; i < sel.length; i++) {
287 289
				selection.set((int) sel[i]);
288 290
			}
289
	
291

  
290 292
			FBitSet fbs = dataSource.getSelection();
291 293
			fbs.or(selection);
292 294
			dataSource.setSelection(fbs);
......
302 304
		// By Pablo: if no filter expression -> no element selected
303 305
		if (! this.filterExpressionFromWhereIsEmpty(expression)) {
304 306
			long[] sel = doSet(expression);
305
	
307

  
306 308
			if (sel == null) {
307 309
				throw new RuntimeException("Not a 'where' clause?");
308 310
			}
309
	
311

  
310 312
			FBitSet selection = new FBitSet();
311
	
313

  
312 314
			for (int i = 0; i < sel.length; i++) {
313 315
				selection.set((int) sel[i]);
314 316
			}
315
	
317

  
316 318
			FBitSet fbs = dataSource.getSelection();
317 319
			fbs.and(selection);
318 320
			dataSource.setSelection(fbs);
......
322 324
			dataSource.clearSelection();
323 325
		}
324 326
	}
325
	
327

  
326 328
	/**
327 329
	 * Returns true if the WHERE subconsultation of the filterExpression is empty ("")
328
	 * 
330
	 *
329 331
	 * @author Pablo Piqueras Bartolom? (p_queras@hotmail.com)
330 332
	 * @param expression An string
331
	 * @return A boolean value 
333
	 * @return A boolean value
332 334
	 */
333 335
	private boolean filterExpressionFromWhereIsEmpty(String expression) {
334 336
		String subExpression = expression.trim();
335
		int pos;	
336
		
337
		int pos;
338

  
337 339
		// Remove last ';' if exists
338 340
		if (subExpression.charAt(subExpression.length() -1) == ';')
339 341
			subExpression = subExpression.substring(0, subExpression.length() -1).trim();
340
		
342

  
341 343
		// If there is no 'where' clause
342 344
		if ((pos = subExpression.indexOf("where")) == -1)
343 345
			return false;
344
		
346

  
345 347
		// If there is no subexpression in the WHERE clause -> true
346 348
		subExpression = subExpression.substring(pos + 5, subExpression.length()).trim(); // + 5 is the length of 'where'
347 349
		if ( subExpression.length() == 0 )
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/RasterExtension.java
79 79
		}
80 80
	}
81 81

  
82
	
82

  
83 83
	/* (non-Javadoc)
84 84
	 * @see com.iver.andami.plugins.Extension#isEnabled()
85 85
	 */
86 86
	public boolean isEnabled() {
87 87
		com.iver.andami.ui.mdiManager.IWindow vista = (com.iver.andami.ui.mdiManager.IWindow) PluginServices.getMDIManager().getActiveWindow();
88 88

  
89
		if (vista == null) 
89
		if (vista == null)
90 90
			return false;
91 91

  
92 92
		if (vista instanceof com.iver.cit.gvsig.project.documents.view.gui.View) {
......
94 94
				IProjectView model = view.getModel();
95 95
				FLayer[] seleccionadas = model.getMapContext().getLayers().getActives();
96 96
				FLayers lyrs = model.getMapContext().getLayers();
97
				
97

  
98 98
				//Se visualiza el control si al menos una de las capas cargadas es raster
99 99
				for(int i=0;i<lyrs.getLayersCount();i++){
100 100
					if(lyrs.getLayer(i) instanceof FLyrRaster && lyrs.getLayer(i).isAvailable())
101 101
						return true;
102
				}				
102
				}
103 103
		}
104 104

  
105 105
		return false;
106 106
	}
107 107

  
108
	
108

  
109 109
	/* (non-Javadoc)
110 110
	 * @see com.iver.andami.plugins.Extension#isVisible()
111 111
	 */
112 112
	public boolean isVisible() {
113 113
		com.iver.andami.ui.mdiManager.IWindow vista = (com.iver.andami.ui.mdiManager.IWindow) PluginServices.getMDIManager().getActiveWindow();
114 114

  
115
		if (vista == null) 
115
		if (vista == null)
116 116
			return false;
117 117

  
118 118
		if (vista instanceof com.iver.cit.gvsig.project.documents.view.gui.View) {
......
120 120
				IProjectView model = view.getModel();
121 121
				FLayer[] seleccionadas = model.getMapContext().getLayers().getActives();
122 122
				FLayers lyrs = model.getMapContext().getLayers();
123
				
123

  
124 124
				//Se visualiza el control si al menos una de las capas cargadas es raster
125 125
				for(int i=0;i<lyrs.getLayersCount();i++){
126 126
					if(lyrs.getLayer(i) instanceof FLyrRaster)
127 127
						return true;
128
				}				
128
				}
129 129
		}
130 130

  
131 131
		return false;
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ThemeToAnnotationExtension.java
62 62
import com.iver.cit.gvsig.gui.panels.annotation.ConfigureLabel;
63 63
import com.iver.cit.gvsig.gui.panels.annotation.SelectAnnotationLayerNameAndField;
64 64
import com.iver.cit.gvsig.gui.simpleWizard.SimpleWizard;
65
import com.iver.cit.gvsig.project.documents.ProjectDocument;
65 66
import com.iver.cit.gvsig.project.documents.view.IProjectView;
67
import com.iver.cit.gvsig.project.documents.view.gui.View;
66 68

  
67 69

  
68 70
/**
......
72 74
 */
73 75
public class ThemeToAnnotationExtension extends Extension {
74 76
    private MapContext map=null;
77
    private IWindow view=null;
75 78
	/**
76 79
     * @see com.iver.andami.plugins.IExtension#initialize()
77 80
     */
......
186 189
			wizard.getWindowInfo().setTitle(PluginServices.getText(this,"to_annotation"));
187 190

  
188 191
			PluginServices.getMDIManager().addWindow(wizard);
192
			((ProjectDocument)((View)view).getModel()).setModified(true);
189 193

  
190 194

  
191

  
192 195
        	/*
193 196
            FLyrVect lv=(FLyrVect)map.getLayers().getActives()[0];
194 197
            FLyrAnnotation la=new FLyrAnnotation();
......
242 245
     * @see com.iver.andami.plugins.IExtension#isVisible()
243 246
     */
244 247
    public boolean isVisible() {
245
        IWindow v = PluginServices.getMDIManager().getActiveWindow();
248
        view = PluginServices.getMDIManager().getActiveWindow();
246 249

  
247
        if (v == null) {
250
        if (view == null) {
248 251
            return false;
249
        } else if (v instanceof com.iver.cit.gvsig.project.documents.view.gui.View) {
252
        } else if (view instanceof com.iver.cit.gvsig.project.documents.view.gui.View) {
250 253
            return true;
251 254
        } else {
252 255
            return false;
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutCommandStackExtension.java
58 58
			csd.setModel(layout.getLayoutContext().getEFS().getCommandRecord());
59 59
			layout.getLayoutContext().getEFS().getCommandRecord().addCommandListener(layout);
60 60
			PluginServices.getMDIManager().addWindow(csd);
61
			layout.getModel().setModified(true);
61 62
		}
62 63
	}
63 64

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TableFieldOperations.java
39 39
			    Table table = (Table) v;
40 40

  
41 41
			    doExecute(actionCommand,table);
42
            }
42
			    table.getModel().setModified(true);
43
			}
43 44
		}
44 45
    }
45 46

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutUndoExtension.java
56 56
			layout.getLayoutContext().getEFS().undo();
57 57
			layout.getLayoutContext().updateFFrames();
58 58
			layout.getLayoutControl().refresh();
59
			layout.getModel().setModified(true);
59 60
		}
60 61
	}
61 62

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/PaletteViewInfoExtension.java
47 47
import com.iver.andami.plugins.Extension;
48 48
import com.iver.andami.ui.mdiManager.IWindow;
49 49
import com.iver.andami.ui.mdiManager.IWindowTransform;
50
import com.iver.cit.gvsig.project.documents.ProjectDocument;
50 51

  
51 52

  
52 53
public class PaletteViewInfoExtension extends Extension{
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ProjectExtension.java
344 344
			}
345 345
		} else if (actionCommand.equals("GUARDAR")) {
346 346
			guardar();
347
			p.setModified(false);
347 348
		} else if (actionCommand.equals("GUARDAR_COMO")) {
348 349
			guardarDialogo();
350
			p.setModified(false);
349 351
		} else if (actionCommand.equals("SALIR")){
350 352
			int option = JOptionPane.showConfirmDialog((Component)PluginServices.getMainFrame(),
351 353
					Messages.getString("MDIFrame.quiere_salir"),
......
357 359
			}
358 360
		} else if (actionCommand.compareTo("OPENTEMPLATE")==0){
359 361
			openLayout();
362
			p.setModified(true);
360 363
		}
361 364
	}
362 365
	public void openLayout() {
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ViewSelectionControls.java
43 43
 *
44 44
 * $Id$
45 45
 * $Log$
46
 * Revision 1.14  2006-12-27 11:08:56  fdiaz
46
 * Revision 1.15  2007-01-04 07:24:32  caballero
47
 * isModified
48
 *
49
 * Revision 1.14  2006/12/27 11:08:56  fdiaz
47 50
 * Arreglado el metodo hasVectorLayers para que no se pare en los grupos de capas cuando estos no tienen capas vectoriales.
48 51
 *
49 52
 * Revision 1.13  2006/09/25 16:54:12  caballero
......
106 109
import com.iver.cit.gvsig.gui.selectionByTheme.DefaultSelectionByThemeModel;
107 110
import com.iver.cit.gvsig.gui.selectionByTheme.MySelectionByThemeListener;
108 111
import com.iver.cit.gvsig.gui.selectionByTheme.SelectionByTheme;
112
import com.iver.cit.gvsig.project.documents.ProjectDocument;
109 113
import com.iver.cit.gvsig.project.documents.view.IProjectView;
110 114
import com.iver.cit.gvsig.project.documents.view.gui.View;
111 115

  
......
133 137
		logger.debug("Comand : " + actionCommand);
134 138
		if (actionCommand.equals("SELRECT")) {
135 139
			mapCtrl.setTool("rectSelection");
140
			((ProjectDocument)vista.getModel()).setModified(true);
136 141
		} else if (actionCommand.equals("SELPOINT")) {
137 142
			mapCtrl.setTool("pointSelection");
143
			((ProjectDocument)vista.getModel()).setModified(true);
138 144
		} else if (actionCommand.equals("SELPOL")) {
139 145
			mapCtrl.setTool("polSelection");
146
			((ProjectDocument)vista.getModel()).setModified(true);
140 147
		} else if (actionCommand.equals("SELECTIONBYSHAPE")) {
141 148
			SelectionByTheme dlg = new SelectionByTheme();
142 149
			// FLayer[] layers = mapa.getLayers().getActives();
......
144 151
			dlg.setModel(new DefaultSelectionByThemeModel());
145 152
			dlg.addSelectionListener(new MySelectionByThemeListener());
146 153
			PluginServices.getMDIManager().addWindow(dlg);
154
			((ProjectDocument)vista.getModel()).setModified(true);
147 155
		} else if (actionCommand.equals("INVERT_SELECTION")) {
148 156
			for (int i = 0; i < mapa.getLayers().getActives().length; i++) {
149 157
				FLayer lyr = mapa.getLayers().getActives()[i];
......
165 173

  
166 174
				}
167 175
			}
176
			((ProjectDocument)vista.getModel()).setModified(true);
168 177
		}
169 178
	}
170 179

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/CopyPasteExtension.java
26 26
import com.hardcode.gdbms.engine.data.SourceInfo;
27 27
import com.iver.andami.PluginServices;
28 28
import com.iver.andami.plugins.Extension;
29
import com.iver.andami.ui.mdiManager.IWindow;
29 30
import com.iver.cit.gvsig.fmap.DriverException;
30 31
import com.iver.cit.gvsig.fmap.layers.CancelationException;
31 32
import com.iver.cit.gvsig.fmap.layers.FLayer;
......
46 47
import com.iver.cit.gvsig.project.documents.table.ProjectTableFactory;
47 48
import com.iver.cit.gvsig.project.documents.view.ProjectView;
48 49
import com.iver.cit.gvsig.project.documents.view.ProjectViewFactory;
50
import com.iver.cit.gvsig.project.documents.view.gui.BaseView;
49 51
import com.iver.cit.gvsig.project.documents.view.toc.AbstractTocContextMenuAction;
50 52
import com.iver.cit.gvsig.project.documents.view.toc.ITocItem;
51 53
import com.iver.utiles.XMLEntity;
......
523 525

  
524 526
		getMapContext().endAtomicEvent();
525 527

  
526
		if (isOK) getMapContext().invalidate();
528
		if (isOK) {
529
			getMapContext().invalidate();
530
			IWindow view=PluginServices.getMDIManager().getActiveWindow();
531
			if (view instanceof BaseView)
532
				((ProjectDocument)((BaseView)view).getModel()).setModified(true);
533
		}
527 534
	}
528 535

  
529 536
}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/TagExtension.java
49 49
import com.iver.andami.PluginServices;
50 50
import com.iver.andami.plugins.Extension;
51 51
import com.iver.andami.ui.mdiManager.IWindow;
52
import com.iver.cit.gvsig.project.documents.layout.fframes.FFrameText;
53 52
import com.iver.cit.gvsig.project.documents.layout.fframes.IFFrame;
54 53
import com.iver.cit.gvsig.project.documents.layout.gui.Layout;
55 54

  
......
86 85
                if (selectedFrames.length == 1)
87 86
                    defaultStr = selectedFrames[0].getTag();
88 87
                String theTag = JOptionPane.showInputDialog((Component)PluginServices.getMainFrame(), "Introduzca el tag:", defaultStr);
89
                if (theTag!=null)
88
                if (theTag!=null) {
90 89
                	for (int i=0; i< selectedFrames.length; i++)
91 90
                		selectedFrames[i].setTag(theTag);
92 91
            		}
93
        }
94
        else if (s.equals("VIEW_TAGS"))
92
                	layout.getModel().setModified(true);
93
            	}
94
        } else if (s.equals("VIEW_TAGS"))
95 95
        {
96 96
//            IFFrame[] frames = layout.getFFrames();
97 97
//            for (int i=0; i< frames.length; i++)
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/UndoTableExtension.java
70 70
		Table tabla = (Table) PluginServices.getMDIManager().getActiveWindow();
71 71

  
72 72
		if (s.compareTo("UNDO") == 0) {
73

  
74
						if (tabla.isEditing()){
75
							IEditableSource vea=(IEditableSource)tabla.getModel().getModelo();
76
							try {
77
								vea.undo();
78
							} catch (DriverIOException e) {
79
								NotificationManager.addError("Error accediendo a los Drivers para deshacer un comando",
80
										e);
81
							} catch (IOException e) {
82
								NotificationManager.addError("Error accediendo a los Drivers para deshacer un comando",
83
										e);
84
							}
85
							vea.getSelection().clear();
86
							tabla.refresh();
87
						}
88

  
89

  
90

  
73
			if (tabla.isEditing()){
74
				IEditableSource vea=tabla.getModel().getModelo();
75
				try {
76
					vea.undo();
77
				} catch (DriverIOException e) {
78
					NotificationManager.addError("Error accediendo a los Drivers para deshacer un comando",
79
							e);
80
				} catch (IOException e) {
81
					NotificationManager.addError("Error accediendo a los Drivers para deshacer un comando",
82
							e);
83
				}
84
				vea.getSelection().clear();
85
				tabla.refresh();
86
			}
87
			tabla.getModel().setModified(true);
91 88
		}
92 89
	}
93 90

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/FFrameLegendExtension.java
74 74
		FLayoutGraphics lg = new FLayoutGraphics(layout);
75 75
		if (s.compareTo("SIMPLIFICAR") == 0) {
76 76
			lg.simplify();
77
			layout.getModel().setModified(true);
77 78
		}
78 79
	}
79 80

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutInsertToolsExtension.java
111 111
     		layout.getLayoutContext().delFFrameSelected();
112 112
     		layout.getLayoutControl().refresh();
113 113
     	}
114
        layout.getModel().setModified(true);
114 115
   }
115 116

  
116 117

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ZoomPrev.java
44 44
import com.iver.andami.plugins.Extension;
45 45
import com.iver.cit.gvsig.fmap.MapContext;
46 46
import com.iver.cit.gvsig.fmap.ViewPort;
47
import com.iver.cit.gvsig.project.documents.ProjectDocument;
47 48
import com.iver.cit.gvsig.project.documents.view.gui.View;
48 49

  
49 50

  
......
80 81
			MapContext mapa = v.getModel().getMapContext();
81 82

  
82 83
			return mapa.getLayers().getLayersCount() > 0;
83
		} else {
84
			return false;
85 84
		}
85
		return false;
86 86
	}
87 87

  
88 88
	/**
......
92 92
		View vista = (View) PluginServices.getMDIManager().getActiveWindow();
93 93
		ViewPort vp = vista.getModel().getMapContext().getViewPort();
94 94
		vp.setPreviousExtent();
95
		((ProjectDocument)vista.getModel()).setModified(true);
95 96
	}
96 97

  
97 98
	/**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/LayoutRedoExtension.java
56 56
			layout.getLayoutContext().getEFS().redo();
57 57
			layout.getLayoutContext().updateFFrames();
58 58
			layout.getLayoutControl().refresh();
59
			layout.getModel().setModified(true);
59 60
		}
60 61
	}
61 62

  
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/ViewPropertiesExtension.java
114 114
        	if (viewModel != null) {
115 115
              ViewProperties viewProperties = new ViewProperties(viewModel);
116 116
              PluginServices.getMDIManager().addWindow(viewProperties);
117
              if (viewProperties.isAcceppted()) {
118
            	  viewModel.setModified(true);
119
              }
117 120
        	}
118 121
        }
119 122
    }
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutGraphics.java
231 231
	 * Abre el di?logo adecuadao a las propiedades del FFrame seleccionado,
232 232
	 * ahora mismo solo se abre cuando hay un solo FFrame seleccionado.
233 233
	 */
234
	public void openFFrameDialog() {
234
	public boolean openFFrameDialog() {
235 235
		IFFrame[] selecList = layout.getLayoutContext().getFFrameSelected();
236 236

  
237 237
		if (selecList.length == 1) {
......
250 250
				layout.getLayoutControl().refresh();
251 251
			}
252 252
//			layout.setTool(toolaux);
253

  
253
			if (fframeAux!=null)
254
				return true;
254 255
		}
256
		return false;
255 257
	}
256 258

  
257 259
	/**
......
269 271
	/**
270 272
	 * Abre el di?logo para a?adir un borde a los fframes.
271 273
	 */
272
	public void border() {
274
	public boolean border() {
273 275
		borderdialog = new FBorderDialog(layout);
274 276
		PluginServices.getMDIManager().addWindow(borderdialog);
277
		return borderdialog.isAccepted();
275 278
	}
276 279

  
277 280
	/**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/ProjectMap.java
73 73
public class ProjectMap extends ProjectDocument {
74 74
	public static int numMaps = 0;
75 75
	private Layout model;
76
	private boolean isModified=false;
76 77

  
77 78
	/**
78 79
	 * @see com.iver.cit.gvsig.project.documents.layout.ProjectMap#getModel()
......
282 283

  
283 284
	}
284 285

  
286
	public boolean isModified() {
287
		return isModified;
288
	}
285 289

  
290
	public void setModified(boolean modified) {
291
		isModified=modified;
292
	}
286 293

  
294

  
295

  
287 296
//	public int computeSignature() {
288 297
//		int result = 17;
289 298
//
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/Layout.java
256 256
    /**
257 257
     * Mestra el di?logo de propiedades del Layout.
258 258
     */
259
    public void showFProperties() {
259
    public boolean showFProperties() {
260 260
        if (map == null) {
261 261
            map = new ProjectMap();
262 262
            map.setModel(this);
......
265 265

  
266 266
        m_propertiesLayout = new MapProperties(map);
267 267
        PluginServices.getMDIManager().addWindow(m_propertiesLayout);
268
        return m_propertiesLayout.isAccepted();
268 269
    }
269 270

  
270 271
    /**
......
550 551
    public Object getWindowModel() {
551 552
        return map;
552 553
    }
553

  
554
    public ProjectMap getModel() {
555
    	return map;
556
    }
554 557
    /**
555 558
     * @see com.iver.cit.gvsig.fmap.ExtentListener#extentChanged(com.iver.cit.gvsig.fmap.ExtentEvent)
556 559
     */
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/dialogs/FBorderDialog.java
99 99
	private String m_NameUnit = null;
100 100
	private javax.swing.JButton bConfigurar = null;
101 101
	GeometryAdapter geometry=new RectangleAdapter();
102
	private boolean isAccepted=false;
102 103

  
103 104
	/**
104 105
	 * This is the default constructor
......
637 638
						PluginServices.getMDIManager().closeWindow(FBorderDialog.this);
638 639
						layout.getLayoutControl().setStatus(LayoutControl.DESACTUALIZADO);
639 640
						layout.getLayoutControl().repaint();
641
						isAccepted=true;
640 642
					}
641 643
				});
642 644
		}
......
657 659
			bCancelar.addActionListener(new java.awt.event.ActionListener() {
658 660
					public void actionPerformed(java.awt.event.ActionEvent e) {
659 661
						PluginServices.getMDIManager().closeWindow(FBorderDialog.this);
662
						isAccepted=false;
660 663
					}
661 664
				});
662 665
		}
......
729 732
		}
730 733
		return re;
731 734
	}
735
	public boolean isAccepted() {
736
		return isAccepted;
737
	}
732 738
}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/gui/MapProperties.java
91 91
	private JCheckBox showGrid = null;
92 92
	private JCheckBox chbEditable = null;
93 93
	private AcceptCancelPanel accept;
94
	private boolean isAccepted=false;
94 95
	/**
95 96
	 * This method initializes
96 97
	 *
......
650 651
                     } catch (NumberFormatException ex) {
651 652
                         NotificationManager.addInfo("no es un double", ex);
652 653
                     }
654
                     isAccepted=true;
653 655
				}
654 656
			};
655 657
			cancelAction = new java.awt.event.ActionListener() {
656 658
				public void actionPerformed(java.awt.event.ActionEvent e) {
659
					isAccepted=false;
657 660
					PluginServices.getMDIManager().closeWindow(MapProperties.this);
658 661
				}
659 662
			};
......
662 665
		}
663 666
		return accept;
664 667
	}
668
	public boolean isAccepted() {
669
		return isAccepted;
670
	}
665 671

  
666 672

  
667 673
  }  //  @jve:visual-info  decl-index=0 visual-constraint="10,10"
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/FLayoutFunctions.java
94 94
			if (((Math.abs(difx) > 3) || (Math.abs(dify) > 3)) &&
95 95
					(fframe.getSelected() != IFFrame.NOSELECT)) {
96 96
				Rectangle2D rectangle = fframe.getLastMoveRect();
97
				if (rectangle==null)
97
				if (rectangle==null) {
98
					efs.endComplexCommand("move");
98 99
					return;
100
				}
99 101
//				if (layout.isAdjustingToGrid()) {
100 102
//					//cuadrar con la cuadr?cula dibujada y despu?s en el mouseReleased guardar ese rect?ngulo de la misma forma.
101 103
//					FLayoutUtilities.setRectGrid(rectangle,
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/commands/DefaultEditableFeatureSource.java
231 231
     * Terminate a composed command.
232 232
     */
233 233
    public void endComplexCommand(String description) {
234
        commands.setDescription(description);
234
        if (commands.isEmpty()) {
235
        	complex = false;
236
        	return;
237
        }
238
    	commands.setDescription(description);
235 239
    	cr.pushCommand(commands);
236 240
        complex = false;
237 241
        PluginServices.getMainFrame().enableControls();
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/layout/LayoutContext.java
30 30
    private Boolean m_showRuler;
31 31
    private Boolean isGridVisible = null;
32 32

  
33

  
34 33
	public LayoutContext() {
35 34
		m_attributes=new Attributes();
36 35
		efs = new DefaultEditableFeatureSource();
......
301 300
    public void setGridVisible(boolean b) {
302 301
        isGridVisible = new Boolean(b);
303 302
    }
303

  
304 304
}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/gui/ProjectWindow.java
187 187
	/**
188 188
	 * Devuelve el nombre del tipo de documento
189 189
	 * activo (el mismo que ProjectDocumentFactory.getRegisterName)
190
	 * 
191
	 * 
190
	 *
191
	 *
192 192
	 * @return
193 193
	 */
194 194

  
......
258 258

  
259 259
		layout.setConstraints(getJPanel(),c);
260 260
		add(getJPanel(), null);
261
		
261

  
262 262
		c.fill = GridBagConstraints.BOTH;
263 263
		c.gridy=1;
264 264
		c.weightx = 1.0;
......
295 295
					ProjectDocument document=documentFactory.createFromGUI(p);
296 296
					if (document == null) return null;
297 297
					document.setProjectDocumentFactory(documentFactory);
298
					p.setModified(true);
298 299
					return document;
299 300
				}
300 301
			} catch (InstantiationException e) {
......
335 336
			IWindow window=doc.createWindow();
336 337
			PluginServices.getMDIManager().addWindow(window);
337 338
		}
339
		p.setModified(true);
338 340
	}
339 341

  
340 342
	/**
......
387 389
		doc.setName(nuevoNombre);
388 390

  
389 391
		refreshList();
392
		p.setModified(true);
390 393
	}
391 394

  
392 395
	/**
......
413 416
				p.delDocument(doc);
414 417
			}
415 418
			refreshList();
416

  
419
			p.setModified(true);
417 420
		}
418 421
	}
419 422

  
......
440 443

  
441 444
		refreshControls();
442 445
		lstDocs.setSelectedIndex(index);
446
		p.setModified(true);
443 447
	}
444 448

  
445 449
	/**
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/ProjectDocument.java
271 271
					e);
272 272
			}
273 273
			ProjectDocument pe=pde.create(p);
274
			pe.setProjectDocumentFactory(pde);		
274
			pe.setProjectDocumentFactory(pde);
275 275
			return pe;
276 276
		}catch (Exception e) {
277 277
			throw new OpenException(e,pde.getNameType());
......
291 291
	 */
292 292
	public void setXMLEntity(XMLEntity xml)
293 293
		throws XMLException, DriverException, DriverIOException, OpenException{
294
		
294

  
295 295
		this.setComment(xml.getStringProperty("comment"));
296 296
		this.setCreationDate(xml.getStringProperty("creationDate"));
297 297
		this.setName(xml.getStringProperty("name"));
298 298
		this.setOwner(xml.getStringProperty("owner"));
299
		
299

  
300 300
	}
301 301

  
302 302
	/**
......
311 311
	 */
312 312
	public void setXMLEntity03(XMLEntity xml)
313 313
		throws XMLException, DriverException, DriverIOException{
314
			
314

  
315 315
			this.setComment(xml.getStringProperty("comment"));
316 316
			this.setCreationDate(xml.getStringProperty("creationDate"));
317 317
			this.setName(xml.getStringProperty("name"));
318 318
			this.setOwner(xml.getStringProperty("owner"));
319
			
319

  
320 320
		}
321 321

  
322 322
	/**
......
380 380
	public ProjectDocumentFactory getProjectDocumentFactory() {
381 381
		return projectDocumentFactory;
382 382
	}
383
	
383

  
384 384
	public abstract void exportToXML(XMLEntity root, Project project)  throws SaveException ;
385
	
385

  
386 386
	public abstract void importFromXML(XMLEntity root, XMLEntity typeRoot,int elementIndex ,Project project, boolean removeDocumentsFromRoot) throws XMLException, DriverException, OpenException;
387
		
388
	
387

  
388

  
389 389
	public void importFromXML(XMLEntity root, XMLEntity typeRoot,int elementIndex ,Project project) throws XMLException, DriverException, OpenException{
390 390
		importFromXML(root,typeRoot, elementIndex,project,false);
391 391
	}
392
	
392

  
393 393
	/**
394 394
	 * Get the layout properties (size, position, state of the components)
395 395
	 * of the window associated with this ProjectDocument.
396 396
	 * This is used to re-open the window with the same properties it had
397 397
	 * when it was closed.
398
	 * 
398
	 *
399 399
	 * @return A WindowData object storing the properties of the window.
400 400
	 */
401 401
	public WindowData getWindowData() {
402 402
		return windowData;
403 403
	}
404
	
404

  
405 405
	/**
406 406
	 * Store the layout properties (size, position, state of the components)
407 407
	 * of the window associated with this ProjectDocument.
......
411 411
	public void storeWindowData(WindowData data) {
412 412
		windowData = data;
413 413
	}
414

  
415
	public abstract boolean isModified();
416
	public abstract void setModified(boolean modified);
414 417
}
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/ProjectTable.java
109 109

  
110 110
	private Columns columns = new Columns();
111 111

  
112
	private boolean isModified=false;
113

  
112 114
	/**
113 115
	 * Establece a true el bit index-?simo del bitmap de campos visibles. Los
114 116
	 * campos cuyos bits est?n a true se considerar?n visibles y viceversa
......
824 826

  
825 827
	}
826 828

  
829
	public boolean isModified() {
830
		return isModified;
831
	}
827 832

  
833
	public void setModified(boolean modified) {
834
		isModified=modified;
835
	}
828 836

  
837

  
838

  
829 839
//	public int computeSignature() {
830 840
//		int result = 17;
831 841
//
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/table/gui/Table.java
1073 1073
			e.printStackTrace();
1074 1074
			NotificationManager.addError(e);
1075 1075
		}
1076
	}
1076 1077

  
1077
    }
1078

  
1079 1078
    /**
1080 1079
     * DOCUMENT ME!
1081 1080
     */
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/contextMenu/actions/CopyDocumentContextMenuAction.java
16 16
	public int getOrder() {
17 17
		return 0;
18 18
	}
19
	
19

  
20 20
	public boolean isVisible(ProjectDocument item,
21 21
			ProjectDocument[] selectedItems) {
22 22
		return true;
......
43 43
			return;
44 44
		}
45 45
		PluginServices.putInClipboard(data);
46
		project.setModified(true);
46 47
	}
47 48

  
48 49
	public String getText() {
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/contextMenu/actions/CutDocumentContextMenuAction.java
15 15
	public int getOrder() {
16 16
		return 1;
17 17
	}
18
	
18

  
19 19
	public boolean isVisible(ProjectDocument item,
20 20
			ProjectDocument[] selectedItems) {
21 21
		return true;
......
30 30
		ProjectExtension projectExtension = (ProjectExtension)PluginServices.getExtension(ProjectExtension.class);
31 31
		Project project = projectExtension.getProject();
32 32
		String data;
33
		
34 33

  
35
		
36
		
37
		
34

  
35

  
36

  
37

  
38 38
		try {
39 39
			data = project.exportToXML(selectedItems);
40 40
		} catch (SaveException e) {
......
47 47
			return;
48 48
		}
49 49
		PluginServices.putInClipboard(data);
50
		
50

  
51 51
		for (int i =0;i<selectedItems.length;i++) {
52 52
			if (selectedItems[i].isLocked()) {
53 53
				JOptionPane.showMessageDialog(
......
55 55
						PluginServices.getText(this, "locked_element_it_cannot_be_deleted") + ": " +selectedItems[i].getName()
56 56
				);
57 57
				return;
58
				
58

  
59 59
			}
60 60
		}
61
		
62
				
61

  
62

  
63 63
    	int option=JOptionPane.showConfirmDialog((Component)PluginServices.getMainFrame(),PluginServices.getText(this,"desea_borrar_el_documento"));
64 64
    	if (option!=JOptionPane.OK_OPTION) {
65 65
    		return;
66 66
    	}
67 67

  
68 68
		this.removeDocuments(selectedItems,project);
69
		
70
			
69
		project.setModified(true);
70

  
71 71
	}
72 72

  
73 73
	public String getText() {
74 74
		return PluginServices.getText(this, "cortar");
75 75
	}
76
	
77
	private boolean removeDocuments(ProjectDocument[] selectedItems,Project project) {		
76

  
77
	private boolean removeDocuments(ProjectDocument[] selectedItems,Project project) {
78 78
		ProjectDocument element;
79 79
		int index;
80 80
		for (int i=selectedItems.length-1;i>=0;i--) {
81 81

  
82 82
			element = selectedItems[i];
83
			
84
			
83

  
84

  
85 85
			if (element.isLocked()) {
86 86
				JOptionPane.showMessageDialog(
87 87
						(Component)PluginServices.getMainFrame(),
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/contextMenu/actions/PasteDocumentContextMenuAction.java
49 49
					"<html>"+PluginServices.getText(this,"No_ha_sido_posible_realizar_la_operacion")+"</html>",//Mensaje
50 50
					PluginServices.getText(this,"pegar"),//titulo
51 51
					JOptionPane.ERROR_MESSAGE
52
					);			
52
					);
53 53
		}
54
		project.setModified(true);
54 55
	}
55 56

  
56 57
	public String getText() {
trunk/applications/appgvSIG/src/com/iver/cit/gvsig/project/documents/view/ProjectView.java
59 59
import com.iver.cit.gvsig.project.documents.ProjectDocumentFactory;
60 60
import com.iver.cit.gvsig.project.documents.exceptions.OpenException;
61 61
import com.iver.cit.gvsig.project.documents.exceptions.SaveException;
62
import com.iver.cit.gvsig.project.documents.gui.WindowData;
63 62
import com.iver.cit.gvsig.project.documents.table.ProjectTable;
64 63
import com.iver.cit.gvsig.project.documents.table.ProjectTableFactory;
65 64
import com.iver.cit.gvsig.project.documents.view.gui.ViewProperties;
......
73 72
 */
74 73
public class ProjectView extends ProjectViewBase {
75 74
	public static int numViews = 0;
75
	private boolean isModified=false;
76 76

  
77 77
	//public static int METROS = 0;
78 78
	//public static int KILOMETROS = 1;
......
192 192
	public String getFrameName() {
193 193
		return PluginServices.getText(this,"Vista");
194 194
	}
195
	
195

  
196 196
	public IWindow createWindow() {
197 197
		com.iver.cit.gvsig.project.documents.view.gui.View view = new com.iver.cit.gvsig.project.documents.view.gui.View();
198 198
		if (windowData != null)
......
207 207
	}
208 208

  
209 209
	public void exportToXML(XMLEntity root, Project project) throws SaveException {
210
		XMLEntity viewsRoot = project.getExportXMLTypeRootNode(root,ProjectViewFactory.registerName);		
210
		XMLEntity viewsRoot = project.getExportXMLTypeRootNode(root,ProjectViewFactory.registerName);
211 211
		viewsRoot.addChild(this.getXMLEntity());
212 212
		this.exportToXMLLayerDependencies(this.getMapContext().getLayers(),root,project);
213 213
		if (this.getMapOverViewContext() != null) {
214 214
			this.exportToXMLLayerDependencies(this.getMapOverViewContext().getLayers(),root,project);
215 215
		}
216 216
	}
217
	
217

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff