Revision 37138 branches/v2_0_0_prep/extensions/extEditing/src/org/gvsig/editing/gui/cad/CADTool.java

View differences:

CADTool.java
1
/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
1
/* gvSIG. Geographic Information System of the Valencian Government
2 2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 * 
5 6
 * This program is free software; you can redistribute it and/or
6 7
 * modify it under the terms of the GNU General Public License
7 8
 * as published by the Free Software Foundation; either version 2
8 9
 * of the License, or (at your option) any later version.
9
 *
10
 * 
10 11
 * This program is distributed in the hope that it will be useful,
11 12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 14
 * GNU General Public License for more details.
14
 *
15
 * 
15 16
 * You should have received a copy of the GNU General Public License
16 17
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib��ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
19
 * MA  02110-1301, USA.
20
 * 
40 21
 */
41 22
package org.gvsig.editing.gui.cad;
42
import java.awt.Graphics;
23

  
43 24
import java.awt.event.InputEvent;
44 25
import java.awt.event.MouseEvent;
45 26

  
......
48 29
import org.gvsig.fmap.dal.exception.DataException;
49 30
import org.gvsig.fmap.mapcontrol.MapControlDrawer;
50 31

  
51

  
52

  
53 32
/**
54 33
 * DOCUMENT ME!
55
 *
34
 * 
56 35
 * @author $author$
57 36
 */
58 37
public interface CADTool {
59 38

  
39
    public static int TOPGEOMETRY = 2000;
60 40

  
61
	public static int TOPGEOMETRY = 2000;
41
    public void init();
62 42

  
63
	public void init();
64
	public void end();
65
	public void transition(double x, double y, InputEvent event);
66
	public void transition(double d);
67
	public void transition(String s) throws CommandException;
68
	public void addPoint(double x,double y,InputEvent event);
69
	public void addValue(double d);
70
	public void addOption(String s);
71
	public void setQuestion(String s);
43
    public void end();
72 44

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

  
92
	/**
93
	 * Obtiene la pregunta que saldr� en la consola relativa al estado en el
94
	 * que se encuentra la herramienta
95
	 *
96
	 * @return DOCUMENT ME!
97
	 */
98
	String getQuestion();
47
    public void transition(double d);
99 48

  
100
	/**
101
	 * DOCUMENT ME!
102
	 *
103
	 * @param cta DOCUMENT ME!
104
	 */
105
	public void setCadToolAdapter(CADToolAdapter cta);
49
    public void transition(String s) throws CommandException;
106 50

  
107
	/**
108
	 * DOCUMENT ME!
109
	 *
110
	 * @return DOCUMENT ME!
111
	 */
112
	public CADToolAdapter getCadToolAdapter();
113
	public String[] getDescriptions();
114
	public void setDescription(String[] descriptions);
115
	public String getName();
116
	public VectorialLayerEdited getVLE();
117
	void clearSelection() throws DataException;
118
	public boolean isApplicable(int shapeType);
119
	public void setPreviosTool(DefaultCADTool tool);
120
	public void restorePreviousTool();
121
	public void endTransition(double x, double y, MouseEvent e);
51
    public void addPoint(double x, double y, InputEvent event);
52

  
53
    public void addValue(double d);
54

  
55
    public void addOption(String s);
56

  
57
    public void setQuestion(String s);
58

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

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

  
92
    /**
93
     * DOCUMENT ME!
94
     * 
95
     * @param cta
96
     *            DOCUMENT ME!
97
     */
98
    public void setCadToolAdapter(CADToolAdapter cta);
99

  
100
    /**
101
     * DOCUMENT ME!
102
     * 
103
     * @return DOCUMENT ME!
104
     */
105
    public CADToolAdapter getCadToolAdapter();
106

  
107
    public String[] getDescriptions();
108

  
109
    public void setDescription(String[] descriptions);
110

  
111
    public String getName();
112

  
113
    public VectorialLayerEdited getVLE();
114

  
115
    void clearSelection() throws DataException;
116

  
117
    public boolean isApplicable(int shapeType);
118

  
119
    public void setPreviosTool(DefaultCADTool tool);
120

  
121
    public void restorePreviousTool();
122

  
123
    public void endTransition(double x, double y, MouseEvent e);
122 124
}

Also available in: Unified diff