root / trunk / extensions / extCAD / sm / ExtendCADTool.sm @ 11445
History | View | Annotate | Download (1.32 KB)
1 |
// -*- tab-width: 4; -*- |
---|---|
2 |
|
3 |
%{ |
4 |
// |
5 |
// Vicente Caballero Navarro |
6 |
%} |
7 |
|
8 |
%start Extend::SelectGeometryToExtend |
9 |
%class ExtendCADTool |
10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 |
%import com.iver.cit.gvsig.gui.cad.tools.ExtendCADTool |
12 |
%import java.awt.event.InputEvent |
13 |
%import com.iver.andami.PluginServices |
14 |
|
15 |
%map Extend |
16 |
%% |
17 |
// A task begins life in suspended animation. |
18 |
|
19 |
SelectGeometryToExtend |
20 |
Entry { |
21 |
selection(); |
22 |
setQuestion( |
23 |
PluginServices.getText(this,"select_geometry_to_extend")); |
24 |
setDescription(new String[]{"cancel"}); |
25 |
|
26 |
} |
27 |
Exit{ |
28 |
} |
29 |
|
30 |
{ |
31 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
32 |
SelectGeometryToExtend { |
33 |
setQuestion(PluginServices.getText(this,"select_geometry_to_extend")); |
34 |
setDescription(new String[]{"cancel"}); |
35 |
addPoint( pointX,pointY,event); |
36 |
} |
37 |
} |
38 |
|
39 |
Default |
40 |
{ |
41 |
addOption(s:String) |
42 |
[s.equals(PluginServices.getText(this,"cancel"))] |
43 |
SelectGeometryToExtend{ |
44 |
end(); |
45 |
} |
46 |
addOption(s:String) |
47 |
SelectGeometryToExtend{ |
48 |
throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
49 |
} |
50 |
addValue(d:double) |
51 |
SelectGeometryToExtend{ |
52 |
throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
53 |
} |
54 |
addPoint(pointX:double,pointY:double,event:InputEvent) |
55 |
SelectGeometryToExtend{ |
56 |
throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
57 |
} |
58 |
} |
59 |
%% |