Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / applications / appgvSIG / src / org / gvsig / app / project / documents / layout / commands / InsertFrameCommand.java @ 33420

History | View | Annotate | Download (1.11 KB)

1

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

    
4
import java.io.IOException;
5

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

    
10

    
11

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

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

    
50
        }
51

    
52
}