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