Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.editing.app / org.gvsig.editing.app.mainplugin / src / main / java / org / gvsig / editing / gui / cad / CADTool.java @ 40557

History | View | Annotate | Download (3.84 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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
package org.gvsig.editing.gui.cad;
25

    
26
import java.awt.event.InputEvent;
27
import java.awt.event.MouseEvent;
28

    
29
import org.gvsig.editing.gui.cad.exception.CommandException;
30
import org.gvsig.editing.layers.VectorialLayerEdited;
31
import org.gvsig.fmap.dal.exception.DataException;
32
import org.gvsig.fmap.geom.type.GeometryType;
33
import org.gvsig.fmap.mapcontrol.MapControlDrawer;
34

    
35
/**
36
 * DOCUMENT ME!
37
 * 
38
 * @author $author$
39
 */
40
public interface CADTool {
41

    
42
    public static int TOPGEOMETRY = 2000;
43

    
44
    public void init();
45

    
46
    public void end();
47

    
48
    public void transition(double x, double y, InputEvent event);
49

    
50
    public void transition(double d);
51

    
52
    public void transition(String s) throws CommandException;
53

    
54
    public void addPoint(double x, double y, InputEvent event);
55

    
56
    public void addValue(double d);
57

    
58
    public void addOption(String s);
59

    
60
    public void setQuestion(String s);
61

    
62
    /**
63
     * Recibe un graphics en el que se encuentra dibujada la
64
     * EditableFeatureSource que se pasa como par�metro. En este m�todo, la
65
     * herramienta ha de implementar el dibujado de la operaci�n que se est�
66
     * realizando dependiendo del estado. Por ejemplo al dibujar un c�rculo
67
     * mediante 3 puntos, cuando la herramienta se encuentre en el estado en
68
     * el que s�lo falta un punto, se dibujar� el c�rculo teniendo en
69
     * cuenta
70
     * como tercer punto el puntero del rat�n (pasado en los par�metros x e
71
     * y). Este m�todo es invocado tras cada transici�n y cada vez que se
72
     * mueve el rat�n.
73
     * 
74
     * @param g
75
     *            DOCUMENT ME!
76
     * @param efs
77
     *            DOCUMENT ME!
78
     * @param selectedGeometries
79
     *            DOCUMENT ME!
80
     * @param x
81
     *            DOCUMENT ME!
82
     * @param y
83
     *            DOCUMENT ME!
84
     */
85
    void drawOperation(MapControlDrawer renderer, double x, double y);
86

    
87
    /**
88
     * Obtiene la pregunta que saldr� en la consola relativa al estado en el
89
     * que se encuentra la herramienta
90
     * 
91
     * @return DOCUMENT ME!
92
     */
93
    String getQuestion();
94

    
95
    /**
96
     * DOCUMENT ME!
97
     * 
98
     * @param cta
99
     *            DOCUMENT ME!
100
     */
101
    public void setCadToolAdapter(CADToolAdapter cta);
102

    
103
    /**
104
     * DOCUMENT ME!
105
     * 
106
     * @return DOCUMENT ME!
107
     */
108
    public CADToolAdapter getCadToolAdapter();
109

    
110
    public String[] getDescriptions();
111

    
112
    public void setDescription(String[] descriptions);
113

    
114
    public String getName();
115

    
116
    public VectorialLayerEdited getVLE();
117

    
118
    void clearSelection() throws DataException;
119

    
120
    /**
121
     * @deprecated Use {@link #isApplicable(GeometryType)} instead. To be
122
     *             removed in gvSIG 2.1 .
123
     */
124
    public boolean isApplicable(int shapeType);
125

    
126
    public boolean isApplicable(GeometryType geometryType);
127

    
128
    public void setPreviosTool(DefaultCADTool tool);
129

    
130
    public void restorePreviousTool();
131

    
132
    public void endTransition(double x, double y, MouseEvent e);
133
}