root / branches / v2_0_0_prep / extensions / extEditing / src / org / gvsig / editing / gui / cad / CADTool.java @ 38539
History | View | Annotate | Download (3.8 KB)
1 | 37138 | cordinyana | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | 29685 | jpiera | *
|
3 | 37138 | cordinyana | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 | * of the Valencian Government (CIT)
|
||
5 | *
|
||
6 | 29685 | jpiera | * 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 | 37138 | cordinyana | *
|
11 | 29685 | jpiera | * 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 | 37138 | cordinyana | *
|
16 | 29685 | jpiera | * 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 | 37138 | cordinyana | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | 29685 | jpiera | */
|
22 | package org.gvsig.editing.gui.cad; |
||
23 | 37138 | cordinyana | |
24 | 29685 | jpiera | import java.awt.event.InputEvent; |
25 | import java.awt.event.MouseEvent; |
||
26 | |||
27 | import org.gvsig.editing.gui.cad.exception.CommandException; |
||
28 | import org.gvsig.editing.layers.VectorialLayerEdited; |
||
29 | import org.gvsig.fmap.dal.exception.DataException; |
||
30 | 37328 | cordinyana | import org.gvsig.fmap.geom.type.GeometryType; |
31 | 30335 | jpiera | import org.gvsig.fmap.mapcontrol.MapControlDrawer; |
32 | 29685 | jpiera | |
33 | /**
|
||
34 | * DOCUMENT ME!
|
||
35 | 37138 | cordinyana | *
|
36 | 29685 | jpiera | * @author $author$
|
37 | */
|
||
38 | public interface CADTool { |
||
39 | |||
40 | 37138 | cordinyana | public static int TOPGEOMETRY = 2000; |
41 | 29685 | jpiera | |
42 | 37138 | cordinyana | public void init(); |
43 | 29685 | jpiera | |
44 | 37138 | cordinyana | public void end(); |
45 | 29685 | jpiera | |
46 | 37138 | cordinyana | public void transition(double x, double y, InputEvent event); |
47 | 29685 | jpiera | |
48 | 37138 | cordinyana | public void transition(double d); |
49 | 29685 | jpiera | |
50 | 37138 | cordinyana | public void transition(String s) throws CommandException; |
51 | 29685 | jpiera | |
52 | 37138 | cordinyana | public void addPoint(double x, double y, InputEvent event); |
53 | |||
54 | public void addValue(double d); |
||
55 | |||
56 | public void addOption(String s); |
||
57 | |||
58 | public void setQuestion(String s); |
||
59 | |||
60 | /**
|
||
61 | * Recibe un graphics en el que se encuentra dibujada la
|
||
62 | * EditableFeatureSource que se pasa como par�metro. En este m�todo, la
|
||
63 | * herramienta ha de implementar el dibujado de la operaci�n que se est�
|
||
64 | * realizando dependiendo del estado. Por ejemplo al dibujar un c�rculo
|
||
65 | * mediante 3 puntos, cuando la herramienta se encuentre en el estado en
|
||
66 | * el que s�lo falta un punto, se dibujar� el c�rculo teniendo en
|
||
67 | * cuenta
|
||
68 | * como tercer punto el puntero del rat�n (pasado en los par�metros x e
|
||
69 | * y). Este m�todo es invocado tras cada transici�n y cada vez que se
|
||
70 | * mueve el rat�n.
|
||
71 | *
|
||
72 | * @param g
|
||
73 | * DOCUMENT ME!
|
||
74 | * @param efs
|
||
75 | * DOCUMENT ME!
|
||
76 | * @param selectedGeometries
|
||
77 | * DOCUMENT ME!
|
||
78 | * @param x
|
||
79 | * DOCUMENT ME!
|
||
80 | * @param y
|
||
81 | * DOCUMENT ME!
|
||
82 | */
|
||
83 | void drawOperation(MapControlDrawer renderer, double x, double y); |
||
84 | |||
85 | /**
|
||
86 | * Obtiene la pregunta que saldr� en la consola relativa al estado en el
|
||
87 | * que se encuentra la herramienta
|
||
88 | *
|
||
89 | * @return DOCUMENT ME!
|
||
90 | */
|
||
91 | String getQuestion();
|
||
92 | |||
93 | /**
|
||
94 | * DOCUMENT ME!
|
||
95 | *
|
||
96 | * @param cta
|
||
97 | * DOCUMENT ME!
|
||
98 | */
|
||
99 | public void setCadToolAdapter(CADToolAdapter cta); |
||
100 | |||
101 | /**
|
||
102 | * DOCUMENT ME!
|
||
103 | *
|
||
104 | * @return DOCUMENT ME!
|
||
105 | */
|
||
106 | public CADToolAdapter getCadToolAdapter();
|
||
107 | |||
108 | public String[] getDescriptions(); |
||
109 | |||
110 | public void setDescription(String[] descriptions); |
||
111 | |||
112 | public String getName(); |
||
113 | |||
114 | public VectorialLayerEdited getVLE();
|
||
115 | |||
116 | void clearSelection() throws DataException; |
||
117 | |||
118 | 37328 | cordinyana | /**
|
119 | * @deprecated Use {@link #isApplicable(GeometryType)} instead. To be
|
||
120 | * removed in gvSIG 2.1 .
|
||
121 | */
|
||
122 | 37138 | cordinyana | public boolean isApplicable(int shapeType); |
123 | |||
124 | 37328 | cordinyana | public boolean isApplicable(GeometryType geometryType); |
125 | |||
126 | 37138 | cordinyana | public void setPreviosTool(DefaultCADTool tool); |
127 | |||
128 | public void restorePreviousTool(); |
||
129 | |||
130 | public void endTransition(double x, double y, MouseEvent e); |
||
131 | 29685 | jpiera | } |