svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extEditing / sm / CircleCADTool.sm @ 39127
History | View | Annotate | Download (2.35 KB)
1 | 3748 | caballero | // -*- tab-width: 4; -*- |
---|---|---|---|
2 | |||
3 | %{ |
||
4 | // |
||
5 | // Vicente Caballero Navarro |
||
6 | %} |
||
7 | |||
8 | 3978 | caballero | %start Circle::CenterPointOr3p |
9 | 3748 | caballero | %class CircleCADTool |
10 | %package com.iver.cit.gvsig.gui.cad.tools.smc |
||
11 | %import com.iver.cit.gvsig.gui.cad.tools.CircleCADTool |
||
12 | 4324 | caballero | %import java.awt.event.InputEvent |
13 | 4583 | caballero | %import com.iver.andami.PluginServices |
14 | 3748 | caballero | |
15 | 3978 | caballero | %map Circle |
16 | 3748 | caballero | %% |
17 | // A task begins life in suspended animation. |
||
18 | |||
19 | 3978 | caballero | CenterPointOr3p |
20 | 3748 | caballero | |
21 | Entry { |
||
22 | 4892 | caballero | setQuestion( |
23 | 9121 | caballero | PluginServices.getText(this,"insert_central_point_or_3p")+ |
24 | "["+PluginServices.getText(this,"CircleCADTool.3p")+"]"); |
||
25 | 4583 | caballero | setDescription(new String[]{"cancel","3P"}); |
26 | 3748 | caballero | } |
27 | Exit{ |
||
28 | } |
||
29 | |||
30 | { |
||
31 | 4324 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
32 | 3978 | caballero | PointOrRadius { |
33 | 4583 | caballero | setQuestion(PluginServices.getText(this,"insert_radius_or_second_point")); |
34 | setDescription(new String[]{"cancel"}); |
||
35 | 4365 | caballero | addPoint( pointX,pointY,event); |
36 | 3748 | caballero | } |
37 | 3828 | caballero | addOption( s:String) |
38 | 9121 | caballero | [s.equalsIgnoreCase(PluginServices.getText(this,"CircleCADTool.3p"))] |
39 | 3978 | caballero | FirstPoint{ |
40 | 4583 | caballero | setQuestion(PluginServices.getText(this,"insert_first_point")); |
41 | setDescription(new String[]{"cancel"}); |
||
42 | 3828 | caballero | addOption( s); |
43 | 3748 | caballero | } |
44 | 3883 | caballero | } |
45 | 3978 | caballero | PointOrRadius{ |
46 | 4324 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
47 | 3978 | caballero | CenterPointOr3p { |
48 | 4365 | caballero | addPoint( pointX,pointY,event); |
49 | 3748 | caballero | } |
50 | 3828 | caballero | addValue( d:double) |
51 | 3978 | caballero | CenterPointOr3p { |
52 | 3828 | caballero | addValue( d); |
53 | 3748 | caballero | } |
54 | } |
||
55 | 3978 | caballero | SecondPoint{ |
56 | 4324 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
57 | 3978 | caballero | ThirdPoint { |
58 | 4583 | caballero | setQuestion(PluginServices.getText(this,"insert_third_point")); |
59 | setDescription(new String[]{"cancel"}); |
||
60 | 4365 | caballero | addPoint( pointX,pointY,event); |
61 | 3748 | caballero | } |
62 | } |
||
63 | 3978 | caballero | ThirdPoint{ |
64 | 4324 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
65 | 3978 | caballero | CenterPointOr3p { |
66 | 4365 | caballero | addPoint( pointX,pointY,event); |
67 | 3748 | caballero | } |
68 | } |
||
69 | |||
70 | 3978 | caballero | FirstPoint{ |
71 | 4324 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
72 | 3978 | caballero | SecondPoint { |
73 | 4583 | caballero | setQuestion(PluginServices.getText(this,"insert_second_point")); |
74 | setDescription(new String[]{"cancel"}); |
||
75 | 4365 | caballero | addPoint( pointX,pointY,event); |
76 | 3748 | caballero | } |
77 | } |
||
78 | |||
79 | 3883 | caballero | Default |
80 | { |
||
81 | addOption(s:String) |
||
82 | 4583 | caballero | [s.equals(PluginServices.getText(this,"cancel"))] |
83 | 3978 | caballero | CenterPointOr3p{ |
84 | 3883 | caballero | end(); |
85 | } |
||
86 | 5730 | caballero | addOption(s:String) |
87 | CenterPointOr3p{ |
||
88 | throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
||
89 | } |
||
90 | addValue(d:double) |
||
91 | CenterPointOr3p{ |
||
92 | throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
||
93 | } |
||
94 | addPoint(pointX:double,pointY:double,event:InputEvent) |
||
95 | CenterPointOr3p{ |
||
96 | throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
||
97 | } |
||
98 | 3748 | caballero | } |
99 | %% |