Statistics
| Revision:

root / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / layout / commands / InsertFrameCommand.java @ 29596

History | View | Annotate | Download (1.14 KB)

1

    
2
package org.gvsig.app.project.documents.layout.commands;
3

    
4
import java.io.IOException;
5

    
6
import org.gvsig.andami.PluginServices;
7
import org.gvsig.app.project.documents.layout.fframes.IFFrame;
8
import org.gvsig.tools.undo.command.Command;
9
import org.gvsig.tools.undo.command.impl.AbstractCommand;
10

    
11

    
12

    
13
/**
14
 * A?ade una geometr?a nueva al EditableFeatureSource
15
 */
16
public class InsertFrameCommand extends AbstractCommand {
17
        private IFFrame frame;
18
        private int index;
19
        private FrameManager fm;
20
        //private DefaultEditableFeatureSource efs;
21
        public InsertFrameCommand(FrameManager fm,IFFrame f,String description){
22
                super(description);
23
                this.fm=fm;
24
                frame=f;
25
        }
26
        /**
27
         * @throws IOException
28
         * @throws DriverIOException
29
         * @throws IOException
30
         * @throws DriverIOException
31
         * @see com.iver.cit.gvsig.fmap.edition.Command#undo()
32
         */
33
        public void undo(){
34
                fm.undoAddFFrame(index);
35
        }
36
        /**
37
         * @throws DriverIOException
38
         * @throws IOException
39
         * @see com.iver.cit.gvsig.fmap.edition.Command#redo()
40
         */
41
        public void redo(){
42
                fm.doAddFFrame(frame,index);
43

    
44
        }
45
        public int getType() {
46
                return Command.INSERT;
47
        }
48
        public void execute() {
49
                index=fm.doAddFFrame(frame);
50

    
51
        }
52

    
53
}