Statistics
| Revision:

gvsig-vectorediting / org.gvsig.vectorediting / trunk / org.gvsig.vectorediting / org.gvsig.vectorediting.swing / org.gvsig.vectorediting.swing.api / src / main / java / org / gvsig / vectorediting / swing / api / EditingContext.java @ 2125

History | View | Annotate | Download (3.39 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2014 gvSIG Association
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24

    
25
package org.gvsig.vectorediting.swing.api;
26

    
27
import java.lang.ref.WeakReference;
28

    
29
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect;
30
import org.gvsig.fmap.mapcontrol.MapControl;
31
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
32
import org.gvsig.tools.observer.Observable;
33
import org.gvsig.vectorediting.lib.api.EditingService;
34
import org.gvsig.vectorediting.lib.api.EditingServiceParameter;
35
import org.gvsig.vectorediting.lib.api.exceptions.InvalidEntryException;
36

    
37
public interface EditingContext extends Observable {
38

    
39
    static final int CANCEL = 0;
40
    static final int DISCARD_CHANGES = 1;
41
    static final int EXPORT_LAYER = 2;
42
    static final int SAVE_CHANGES = 3;
43
    static final String DEFAULT_TOOL = "default_tool";
44

    
45
    static final String CHANGE_SELECTED_TOOL_NOTIFICATION = "EditingContext.changeSelectedTool";
46
    static final String REFRESH_TOOLS_NOTIFICATION = "EditingContext.refreshTools";
47
    static final String EXPORT_LAYER_NOTIFICATION = "EditingContext.exportLayer";
48
    /**
49
     * Activates service as of name and {@link MapControl}
50
     *
51
     * @param name
52
     *            of service
53
     * @param mapControl
54
     *            of
55
     */
56
    public void activateService(String name);
57

    
58
    /**
59
      * @deprecated Use {@link EditingContext#beginEdition(FLyrVect)}
60
     */
61
    public void beginEdition(FLyrVect layer, Behavior[] additionalBehaviors);
62
    
63
    /**
64
     * Begins edition of a layer
65
     *
66
     * @param layer
67
     *            to begin edition
68
     */
69
    public void beginEdition(FLyrVect layer);
70

    
71
    /**
72
     * Ends edition of a layer 
73
     *
74
     * @param layer
75
     *            to end edition
76
     */
77
    public void endEdition(FLyrVect layer);
78

    
79
    /**
80
     * Gets mapControl object. It is referenced by {@link WeakReference}.
81
     *
82
     * @return
83
     */
84
    public MapControl getMapControl();
85

    
86
    /**
87
     *
88
     * @param name
89
     * @return
90
     */
91
    public boolean isServiceCompatible(String name);
92

    
93
    /**
94
     * Updates the weak reference at editing context.
95
     *
96
     * @param mapControl
97
     */
98
    public void setMapControl(MapControl mapControl);
99

    
100

    
101
    public Behavior[] getDefaultBehaviors();
102

    
103
    public void setDefaultBehaviors(Behavior[] defaultBehaviors);
104
    
105
    /**
106
     *
107
     * @param parameter
108
     * @param value
109
     * @throws InvalidEntryException
110
     */
111
    public void setValue(EditingServiceParameter parameter, String value) throws InvalidEntryException;
112
    
113
    public EditingService getActiveService();
114

    
115
}