Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libTools / src / org / gvsig / tools / undo / UndoRedoStack.java @ 31544

History | View | Annotate | Download (2.79 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
5
* 
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
10
* 
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
* GNU General Public License for more details.
15
* 
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
* MA  02110-1301, USA.
20
* 
21
*/
22

    
23
/*
24
* AUTHORS (In addition to CIT):
25
* 2008 {DiSiD Technologies}  {{Task}}
26
*/
27
package org.gvsig.tools.undo;
28

    
29
import java.util.List;
30

    
31
import org.gvsig.tools.observer.WeakReferencingObservable;
32

    
33
/**
34
 * An Stack of Undo/Redo operations.
35
 * 
36
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
37
 */
38
public interface UndoRedoStack extends WeakReferencingObservable {
39

    
40
    /**
41
     * Undoes the following undoable elements.
42
     * 
43
     * @throws UndoException
44
     *             if there is an error performing de undo element
45
     */
46
    void undo() throws UndoException;
47

    
48
    /**
49
     * Undoes a number of the following undoable elements.
50
     * 
51
     * @param num
52
     *            the number of elements to undo
53
     * @throws UndoException
54
     *             if there is an error performing de undo element
55
     */
56
    void undo(int num) throws UndoException;
57

    
58
    /**
59
     * Re-does the following redoable elements.
60
     * 
61
     * @throws RedoException
62
     *             if there is an error performing de redo element
63
     */
64
    void redo() throws RedoException;
65

    
66
    /**
67
     * Re-does a number of the following redoable element.
68
     * 
69
     * @param num
70
     *            the number of elements to redo
71
     * @throws RedoException
72
     *             if there is an error performing de redo element
73
     */
74
    void redo(int num) throws RedoException;
75

    
76
    /**
77
     * Returns the list of UndoRedoInfo in the UNDO stack
78
     * 
79
     * @return list of UndoRedoInfo in the UNDO stack
80
     */
81
    List getUndoInfos();
82

    
83
    /**
84
     * Returns the list of UndoRedoInfo in the REDO stack
85
     * 
86
     * @return list of UndoRedoInfo in the REDO stack
87
     */
88
    List getRedoInfos();
89

    
90
    /**
91
     * If an undo can be performed on the stack.
92
     * 
93
     * @return an undo can be performed
94
     */
95
    boolean canUndo();
96

    
97
    /**
98
     * If a redo can be performed on the stack.
99
     * 
100
     * @return a redo can be performed
101
     */
102
    boolean canRedo();
103
}