svn-gvsig-desktop / tags / v1_9_RC1 / extensions / extCAD / sm / EllipseCADTool.sm @ 43233
History | View | Annotate | Download (1.7 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 |
} |
52 |
addValue( d:double) |
53 |
FirstPointAxis { |
54 |
addValue( d); |
55 |
} |
56 |
} |
57 |
|
58 |
Default |
59 |
{ |
60 |
addOption(s:String) |
61 |
[s.equals(PluginServices.getText(this,"cancel"))] |
62 |
FirstPointAxis{ |
63 |
end(); |
64 |
} |
65 |
addOption(s:String) |
66 |
FirstPointAxis{ |
67 |
throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
68 |
} |
69 |
addValue(d:double) |
70 |
FirstPointAxis{ |
71 |
throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
72 |
} |
73 |
addPoint(pointX:double,pointY:double,event:InputEvent) |
74 |
FirstPointAxis{ |
75 |
throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
76 |
} |
77 |
} |
78 |
%% |