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