01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.tools.edit.activator;
16:
17: import net.refractions.udig.tools.edit.Activator;
18: import net.refractions.udig.tools.edit.EditState;
19: import net.refractions.udig.tools.edit.EditToolHandler;
20:
21: /**
22: * Resets the state that has to do with Editing. IE. Current edit state and shape
23: *
24: * @author jones
25: * @since 1.1.0
26: */
27: public class ResetAllStateActivator implements Activator {
28:
29: public void activate(EditToolHandler handler) {
30: handler.setCurrentShape(null);
31: handler.setCurrentState(EditState.NONE);
32: handler.getEditBlackboard(handler.getEditLayer()).clear();
33: }
34:
35: public void deactivate(EditToolHandler handler) {
36: }
37:
38: public void handleActivateError(EditToolHandler handler,
39: Throwable error) {
40: }
41:
42: public void handleDeactivateError(EditToolHandler handler,
43: Throwable error) {
44: }
45:
46: }
|