Revision 159 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

View differences:

EditingContext.java
1
/*
2
 * Copyright 2014 DiSiD Technologies S.L.L. All rights reserved.
3
 * 
4
 * Project  : DiSiD org.gvsig.vectorediting.swing.api 
5
 * SVN Id   : $Id$
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.
6 23
 */
24

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

  
9 27
import java.lang.ref.WeakReference;
......
13 31
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
14 32
import org.gvsig.tools.observer.Observable;
15 33

  
16
public interface EditingContext extends Observable{
17
  
18
  static final int CANCEL = 0;
19
  static final int DISCARD_CHANGES = 1;
20
  static final int EXPORT_LAYER = 2;
21
  static final int SAVE_CHANGES = 3;
34
public interface EditingContext extends Observable {
22 35

  
23
  /**
24
   * Activates service as of name and {@link MapControl}
25
   * 
26
   * @param name of service
27
   * @param mapControl of
28
   */
29
  public void activateService(String name);
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;
30 40

  
31
  /**
32
   * Begins edition of a layer with the {@link MapControl} received as parameter.
33
   * 
34
   * @param layer to begin edition
35
   * @param mapControl necessary to add listeners, console... See
36
   *          {@link EditingBehavior}.
37
   */
38
  public void beginEdition(FLyrVect layer, Behavior[] additionalBehaviors);
39
  
40
  /**
41
   * 
42
   * @param enableSelection
43
   */
44
  public void enableSelection(boolean enableSelection);
41
    /**
42
     * Activates service as of name and {@link MapControl}
43
     * 
44
     * @param name
45
     *            of service
46
     * @param mapControl
47
     *            of
48
     */
49
    public void activateService(String name);
45 50

  
46
  /**
47
   * Ends edition of a layer with the {@link MapControl} received as parameter.
51
    /**
52
     * Begins edition of a layer with the {@link MapControl} received as
53
     * parameter.
54
     * 
55
     * @param layer
56
     *            to begin edition
57
     * @param mapControl
58
     *            necessary to add listeners, console... See
59
     *            {@link EditingBehavior}.
60
     */
61
    public void beginEdition(FLyrVect layer, Behavior[] additionalBehaviors);
62

  
63
    /**
64
     * 
65
     * @param enableSelection
66
     */
67
    public void enableSelection(boolean enableSelection);
68

  
69
    /**
70
     * Ends edition of a layer with the {@link MapControl} received as
71
     * parameter.
72
     * 
73
     * @param layer
74
     *            to end edition
75
     * @param mapControl
76
     *            necessary to delete observers, stop drawing, obtain
77
     *            {@link EditingBehavior}...
78
     */
79
    public void endEdition(FLyrVect layer);
80

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

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

  
95
    /**
48 96
   * 
49
   * @param layer to end edition
50
   * @param mapControl necessary to delete observers, stop drawing, obtain
51
   *          {@link EditingBehavior}...
52 97
   */
53
  public void endEdition(FLyrVect layer);
54
  
55
  /**
56
   * Gets mapControl object. It is referenced by {@link WeakReference}. 
57
   * 
58
   * @return 
59
   */
60
  public MapControl getMapControl();
61
  
62
  /**
63
   * 
64
   * @param name
65
   * @return
66
   */
67
  public boolean isServiceCompatible(String name);
68
  
69
  /**
70
   * 
71
   */
72
  public void refreshMenusAndToolBars();
73
  
74
  /**
75
   * Updates the weak reference at editing context.
76
   * 
77
   * @param mapControl
78
   */
79
  public void setMapControl(MapControl mapControl);
98
    public void refreshMenusAndToolBars();
80 99

  
81
  /**
82
   * Shows text at console.
83
   * 
84
   * @param text to be showed.
85
   */
86
  public void showConsoleMessage(String text);
87
 }
100
    /**
101
     * Updates the weak reference at editing context.
102
     * 
103
     * @param mapControl
104
     */
105
    public void setMapControl(MapControl mapControl);
106

  
107
    /**
108
     * Shows text at console.
109
     * 
110
     * @param text
111
     *            to be showed.
112
     */
113
    public void showConsoleMessage(String text);
114
}

Also available in: Unified diff