svn-gvsig-desktop / tags / v1_0_2_Build_895 / extensions / extCAD / sm / CopyCADTool.sm @ 41849
History | View | Annotate | Download (1.46 KB)
1 | 3883 | caballero | // -*- tab-width: 4; -*- |
---|---|---|---|
2 | |||
3 | %{ |
||
4 | // |
||
5 | // Vicente Caballero Navarro |
||
6 | %} |
||
7 | |||
8 | 3978 | caballero | %start Copy::FirstPointToMove |
9 | 3883 | caballero | %class CopyCADTool |
10 | %package com.iver.cit.gvsig.gui.cad.tools.smc |
||
11 | %import com.iver.cit.gvsig.gui.cad.tools.CopyCADTool |
||
12 | 4324 | caballero | %import java.awt.event.InputEvent |
13 | 4583 | caballero | %import com.iver.andami.PluginServices |
14 | 3883 | caballero | |
15 | 3978 | caballero | %map Copy |
16 | 3883 | caballero | %% |
17 | // A task begins life in suspended animation. |
||
18 | |||
19 | 3978 | caballero | FirstPointToMove |
20 | 3883 | caballero | Entry { |
21 | selection(); |
||
22 | 4892 | caballero | setQuestion( |
23 | 4583 | caballero | PluginServices.getText(this,"insert_point_move")); |
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 | SecondPointToMove { |
33 | 4583 | caballero | setQuestion(PluginServices.getText(this,"insert_second_point_move")); |
34 | setDescription(new String[]{"cancel"}); |
||
35 | 4365 | caballero | addPoint( pointX,pointY,event); |
36 | 3883 | caballero | } |
37 | } |
||
38 | 3978 | caballero | SecondPointToMove{ |
39 | 4324 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
40 | 3978 | caballero | FirstPointToMove { |
41 | 4583 | caballero | setDescription(new String[]{"cancel"}); |
42 | 4365 | caballero | addPoint( pointX,pointY,event); |
43 | 3883 | caballero | end(); |
44 | refresh(); |
||
45 | } |
||
46 | } |
||
47 | 3978 | caballero | |
48 | 3883 | caballero | Default |
49 | { |
||
50 | addOption(s:String) |
||
51 | 4583 | caballero | [s.equals(PluginServices.getText(this,"cancel"))] |
52 | 3978 | caballero | FirstPointToMove{ |
53 | 3883 | caballero | end(); |
54 | } |
||
55 | 5730 | caballero | addOption(s:String) |
56 | FirstPointToMove{ |
||
57 | throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
||
58 | } |
||
59 | addValue(d:double) |
||
60 | FirstPointToMove{ |
||
61 | throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
||
62 | } |
||
63 | addPoint(pointX:double,pointY:double,event:InputEvent) |
||
64 | FirstPointToMove{ |
||
65 | throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
||
66 | } |
||
67 | 3883 | caballero | } |
68 | %% |