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 @ 546
History | View | Annotate | Download (2.86 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 |
|
34 |
public interface EditingContext extends Observable { |
35 |
|
36 |
static final int CANCEL = 0; |
37 |
static final int DISCARD_CHANGES = 1; |
38 |
static final int EXPORT_LAYER = 2; |
39 |
static final int SAVE_CHANGES = 3; |
40 |
static final String DEFAULT_TOOL = "default_tool"; |
41 |
|
42 |
static final String CHANGE_SELECTED_TOOL_NOTIFICATION = "EditingContext.changeSelectedTool"; |
43 |
static final String REFRESH_TOOLS_NOTIFICATION = "EditingContext.refreshTools"; |
44 |
/**
|
45 |
* Activates service as of name and {@link MapControl}
|
46 |
*
|
47 |
* @param name
|
48 |
* of service
|
49 |
* @param mapControl
|
50 |
* of
|
51 |
*/
|
52 |
public void activateService(String name); |
53 |
|
54 |
/**
|
55 |
* @deprecated Use {@link EditingContext#beginEdition(FLyrVect)}
|
56 |
*/
|
57 |
public void beginEdition(FLyrVect layer, Behavior[] additionalBehaviors); |
58 |
|
59 |
/**
|
60 |
* Begins edition of a layer
|
61 |
*
|
62 |
* @param layer
|
63 |
* to begin edition
|
64 |
*/
|
65 |
public void beginEdition(FLyrVect layer); |
66 |
|
67 |
/**
|
68 |
* Ends edition of a layer
|
69 |
*
|
70 |
* @param layer
|
71 |
* to end edition
|
72 |
*/
|
73 |
public void endEdition(FLyrVect layer); |
74 |
|
75 |
/**
|
76 |
* Gets mapControl object. It is referenced by {@link WeakReference}.
|
77 |
*
|
78 |
* @return
|
79 |
*/
|
80 |
public MapControl getMapControl();
|
81 |
|
82 |
/**
|
83 |
*
|
84 |
* @param name
|
85 |
* @return
|
86 |
*/
|
87 |
public boolean isServiceCompatible(String name); |
88 |
|
89 |
/**
|
90 |
* Updates the weak reference at editing context.
|
91 |
*
|
92 |
* @param mapControl
|
93 |
*/
|
94 |
public void setMapControl(MapControl mapControl); |
95 |
|
96 |
|
97 |
public Behavior[] getDefaultBehaviors(); |
98 |
|
99 |
public void setDefaultBehaviors(Behavior[] defaultBehaviors); |
100 |
} |