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