svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extEditing / sm / StretchCADTool.sm @ 39127
History | View | Annotate | Download (2.01 KB)
1 |
// -*- tab-width: 4; -*- |
---|---|
2 |
|
3 |
%{ |
4 |
// |
5 |
// Vicente Caballero Navarro |
6 |
%} |
7 |
|
8 |
%start Stretch::SelFirstPoint |
9 |
%class StretchCADTool |
10 |
%package com.iver.cit.gvsig.gui.cad.tools.smc |
11 |
%import com.iver.cit.gvsig.gui.cad.tools.StretchCADTool |
12 |
%import java.awt.event.InputEvent |
13 |
%import com.iver.andami.PluginServices |
14 |
|
15 |
%map Stretch |
16 |
%% |
17 |
// A task begins life in suspended animation. |
18 |
|
19 |
SelFirstPoint |
20 |
Entry { |
21 |
selection(); |
22 |
setQuestion( |
23 |
PluginServices.getText(this,"insert_selection_point")); |
24 |
setDescription(new String[]{"cancel"}); |
25 |
|
26 |
} |
27 |
Exit{ |
28 |
} |
29 |
|
30 |
{ |
31 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
32 |
SelLastPoint { |
33 |
setQuestion(PluginServices.getText(this,"insert_selection_last_point")); |
34 |
setDescription(new String[]{"cancel"}); |
35 |
addPoint( pointX,pointY,event); |
36 |
} |
37 |
} |
38 |
SelLastPoint{ |
39 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
40 |
MoveFirstPoint { |
41 |
setQuestion(PluginServices.getText(this,"insert_move_first_point")); |
42 |
setDescription(new String[]{"cancel"}); |
43 |
addPoint( pointX,pointY,event); |
44 |
} |
45 |
} |
46 |
MoveFirstPoint{ |
47 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
48 |
MoveLastPoint { |
49 |
setQuestion(PluginServices.getText(this,"insert_move_last_point")); |
50 |
setDescription(new String[]{"cancel"}); |
51 |
addPoint( pointX,pointY,event); |
52 |
} |
53 |
} |
54 |
MoveLastPoint{ |
55 |
addPoint( pointX:double,pointY:double,event:InputEvent) |
56 |
SelFirstPoint { |
57 |
setQuestion(PluginServices.getText(this,"insert_selection_point")); |
58 |
setDescription(new String[]{"cancel"}); |
59 |
addPoint( pointX,pointY,event); |
60 |
end(); |
61 |
refresh(); |
62 |
} |
63 |
} |
64 |
Default |
65 |
{ |
66 |
addOption(s:String) |
67 |
[s.equals(PluginServices.getText(this,"cancel"))] |
68 |
SelFirstPoint{ |
69 |
end(); |
70 |
} |
71 |
addOption(s:String) |
72 |
SelFirstPoint{ |
73 |
throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
74 |
} |
75 |
addValue(d:double) |
76 |
SelFirstPoint{ |
77 |
throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
78 |
} |
79 |
addPoint(pointX:double,pointY:double,event:InputEvent) |
80 |
SelFirstPoint{ |
81 |
throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
82 |
} |
83 |
} |
84 |
%% |