Revision 9052
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/CADTool.java | ||
---|---|---|
62 | 62 |
new Color(100, 100, 100, 100)); |
63 | 63 |
public static FSymbol selectSymbol = new FSymbol(FConstant.SYMBOL_TYPE_POINT, |
64 | 64 |
Color.ORANGE); |
65 |
|
|
65 |
|
|
66 | 66 |
public static int TOPGEOMETRY = 2000; |
67 | 67 |
|
68 | 68 |
public void init(); |
... | ... | |
121 | 121 |
public VectorialLayerEdited getVLE(); |
122 | 122 |
void clearSelection(); |
123 | 123 |
public boolean isApplicable(int shapeType); |
124 |
public void setPreviosTool(DefaultCADTool tool); |
|
125 |
public void restorePreviousTool(); |
|
124 | 126 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/DefaultCADTool.java | ||
---|---|---|
75 | 75 |
import com.iver.cit.gvsig.fmap.layers.FBitSet; |
76 | 76 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
77 | 77 |
import com.iver.cit.gvsig.gui.cad.exception.CommandException; |
78 |
import com.iver.cit.gvsig.gui.cad.tools.SelectionCADTool; |
|
78 | 79 |
import com.iver.cit.gvsig.layers.VectorialLayerEdited; |
79 | 80 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
80 | 81 |
import com.iver.utiles.console.JConsole; |
... | ... | |
96 | 97 |
|
97 | 98 |
private String tool = "selection"; |
98 | 99 |
|
100 |
private DefaultCADTool previousTool; |
|
101 |
|
|
99 | 102 |
/** |
100 | 103 |
* DOCUMENT ME! |
101 | 104 |
*/ |
... | ... | |
325 | 328 |
public void end() { |
326 | 329 |
CADExtension.setCADTool("_selection", true); |
327 | 330 |
PluginServices.getMainFrame().setSelectedTool("_selection"); |
331 |
CADTool cadtool=CADExtension.getCADTool(); |
|
332 |
cadtool.setPreviosTool(this); |
|
328 | 333 |
} |
329 | 334 |
|
330 | 335 |
public void init() { |
... | ... | |
417 | 422 |
JConsole.ERROR); |
418 | 423 |
} |
419 | 424 |
|
425 |
public void setPreviosTool(DefaultCADTool tool) { |
|
426 |
previousTool=tool; |
|
427 |
} |
|
428 |
public void restorePreviousTool() { |
|
429 |
CADExtension.setCADTool(previousTool.toString(), true); |
|
430 |
PluginServices.getMainFrame().setSelectedTool(previousTool.toString()); |
|
431 |
} |
|
432 |
|
|
420 | 433 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/smc/EquidistanceCADToolContext.java | ||
---|---|---|
342 | 342 |
context.clearState(); |
343 | 343 |
try |
344 | 344 |
{ |
345 |
ctxt.setQuestion(PluginServices.getText(this,"position")); |
|
345 | 346 |
ctxt.setDescription(new String[]{"cancel"}); |
346 | 347 |
ctxt.addValue(d); |
347 | 348 |
} |
trunk/extensions/extCAD/src/com/iver/cit/gvsig/gui/cad/tools/smc/SelectionCADToolContext.java | ||
---|---|---|
168 | 168 |
{ |
169 | 169 |
SelectionCADTool ctxt = context.getOwner(); |
170 | 170 |
|
171 |
if (s.equals(PluginServices.getText(this,"cancel")))
|
|
171 |
if (s.equals(""))
|
|
172 | 172 |
{ |
173 | 173 |
boolean loopbackFlag = |
174 | 174 |
context.getState().getName().equals( |
... | ... | |
182 | 182 |
context.clearState(); |
183 | 183 |
try |
184 | 184 |
{ |
185 |
ctxt.restorePreviousTool(); |
|
186 |
ctxt.setQuestion(PluginServices.getText(this,"insert_point_selection")); |
|
187 |
ctxt.setDescription(new String[]{"cancel"}); |
|
185 | 188 |
ctxt.end(); |
186 | 189 |
} |
187 | 190 |
finally |
... | ... | |
195 | 198 |
|
196 | 199 |
} |
197 | 200 |
} |
201 |
else if (s.equals(PluginServices.getText(this,"cancel"))) |
|
202 |
{ |
|
203 |
boolean loopbackFlag = |
|
204 |
context.getState().getName().equals( |
|
205 |
Selection.FirstPoint.getName()); |
|
206 |
|
|
207 |
if (loopbackFlag == false) |
|
208 |
{ |
|
209 |
(context.getState()).Exit(context); |
|
210 |
} |
|
211 |
|
|
212 |
context.clearState(); |
|
213 |
try |
|
214 |
{ |
|
215 |
ctxt.end(); |
|
216 |
} |
|
217 |
finally |
|
218 |
{ |
|
219 |
context.setState(Selection.FirstPoint); |
|
220 |
|
|
221 |
if (loopbackFlag == false) |
|
222 |
{ |
|
223 |
(context.getState()).Entry(context); |
|
224 |
} |
|
225 |
|
|
226 |
} |
|
227 |
} |
|
198 | 228 |
else |
199 | 229 |
{ |
200 | 230 |
boolean loopbackFlag = |
trunk/extensions/extCAD/sm/SelectionCADTool.sm | ||
---|---|---|
123 | 123 |
|
124 | 124 |
Default |
125 | 125 |
{ |
126 |
addOption(s:String) |
|
127 |
[s.equals("")] |
|
128 |
FirstPoint{ |
|
129 |
restorePreviousTool(); |
|
130 |
setQuestion(PluginServices.getText(this,"insert_point_selection")); |
|
131 |
setDescription(new String[]{"cancel"}); |
|
132 |
end(); |
|
133 |
} |
|
126 | 134 |
addOption(s:String) |
127 | 135 |
[s.equals(PluginServices.getText(this,"cancel"))] |
128 | 136 |
FirstPoint{ |
Also available in: Unified diff