Revision 5078

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/AnnotationEditableAdapter.java
150 150

  
151 151

  
152 152
	public int doAddRow(IRow feat) throws DriverIOException, IOException {
153
		boolean cancel = fireBeforeRowAdded();
154
		if (cancel)
155
			return -1;
153 156
		Value[] values=feat.getAttributes();
154 157
		values[mapping.getColumnText()]=ValueFactory.createValue("New");
155 158
		FLabel label=createLabel(feat);
......
174 177
		index.insert(new Envelope(r1.getX(), r1.getX() + r1.getWidth(), r1.getY(),
175 178
                r1.getY() + r1.getHeight()), new Integer(calculatedIndex));
176 179
        lyrAnnotation.getFMap().invalidate();
180
        fireAfterRowAdded(calculatedIndex);
177 181
        return calculatedIndex;
178 182
	}
179 183

  
180 184
	public int doModifyRow(int calculatedIndex, IRow feat) throws IOException, DriverIOException {
185
		boolean cancel = fireBeforeModifyRow(calculatedIndex);
186
		if (cancel)
187
			return -1;
181 188
		int posAnteriorInExpansionFile = -1;
182 189
		Integer integer = new Integer(calculatedIndex);
183 190

  
......
254 261
					calculatedIndex));
255 262
			labelExpansion.modifyLabel(num,label);
256 263
		}
264
		fireAfterModifyRow(calculatedIndex);
257 265
		return posAnteriorInExpansionFile;
258 266
	}
259 267

  
260 268
	public IRow doRemoveRow(int index) throws DriverIOException, IOException {
261
		 //Llega el calculatedIndex
269
		boolean cancel = fireBeforeRemoveRow(index);
270
		if (cancel)
271
			return null;
272
		//Llega el calculatedIndex
262 273
    	Integer integer = new Integer(index);
263 274

  
264 275
        IFeature feat = null;
......
285 296
                    r.getY(), r.getY() + r.getHeight()), new Integer(index));
286 297
        }
287 298
        setSelection(new FBitSet());
299
        fireAfterRemoveRow(index);
288 300
        return feat;
289 301
	}
290 302

  
291 303
	public void undoAddRow(int calculatedIndex) throws DriverIOException, IOException {
304
		boolean cancel = fireBeforeRemoveRow(calculatedIndex);
305
		if (cancel)
306
			return;
292 307
		Rectangle2D r = getLabel(calculatedIndex,true).getBoundBox();
293 308
        this.index.remove(new Envelope(r.getX(), r.getX() + r.getWidth(),
294 309
                r.getY(), r.getY() + r.getHeight()), new Integer(calculatedIndex));
......
297 312
		numAdd--;
298 313
        setSelection(new FBitSet());
299 314
		labelExpansion.deleteLastLabel();
315
		fireAfterRemoveRow(calculatedIndex);
300 316
	}
301 317

  
302 318
	public void undoModifyRow(int calculatedIndex, int previousExpansionFileIndex) throws IOException, DriverIOException {
303
		 if (previousExpansionFileIndex == -1) {
319
		boolean cancel = fireBeforeModifyRow(calculatedIndex);
320
		if (cancel)
321
			return;
322
		if (previousExpansionFileIndex == -1) {
304 323
	            //Se obtiene la geometr?a para actualizar el ?ndice
305 324
	        	int inverse = getInversedIndex(calculatedIndex);
306 325
	        	IRowEdited row=getRow(inverse);
......
351 370
	    			label.setRotation(((NumericValue)value).doubleValue());
352 371
	    		}
353 372
	        }
373
		fireAfterModifyRow(calculatedIndex);
354 374
	}
355 375

  
356 376
	public void undoRemoveRow(int index) throws IOException, DriverIOException {
377
		boolean cancel = fireBeforeRowAdded();
378
		if (cancel)
379
			return;
357 380
		delRows.set(index, false);
358 381
	    Rectangle2D r = getLabel(index,true).getBoundBox();
359 382
	    this.index.insert(new Envelope(r.getX(), r.getX() + r.getWidth(),
360 383
	                r.getY(), r.getY() + r.getHeight()), new Integer(index));
384
	    fireAfterRowAdded(index);
361 385
	}
362 386

  
363 387
	public AnnotationEditableAdapter(FLyrAnnotation lyrAnnotation) {

Also available in: Unified diff