svn-gvsig-desktop / tags / v1_0_2_RELEASE / extensions / extCAD / sm / PointCADTool.sm @ 40799
History | View | Annotate | Download (1.2 KB)
1 | 3734 | fjp | // -*- tab-width: 4; -*- |
---|---|---|---|
2 | |||
3 | %{ |
||
4 | // |
||
5 | // Vicente Caballero Navarro |
||
6 | %} |
||
7 | |||
8 | 3978 | caballero | %start Point::FirstPoint |
9 | 3734 | fjp | %class PointCADTool |
10 | %package com.iver.cit.gvsig.gui.cad.tools.smc |
||
11 | %import com.iver.cit.gvsig.gui.cad.tools.PointCADTool |
||
12 | 4324 | caballero | %import java.awt.event.InputEvent |
13 | 4583 | caballero | %import com.iver.andami.PluginServices |
14 | 3734 | fjp | |
15 | |||
16 | 3978 | caballero | %map Point |
17 | 3734 | fjp | %% |
18 | // A task begins life in suspended animation. |
||
19 | |||
20 | 3978 | caballero | FirstPoint |
21 | 3734 | fjp | |
22 | Entry { |
||
23 | 4892 | caballero | setQuestion( |
24 | 4583 | caballero | PluginServices.getText(this,"define_point")); |
25 | setDescription(new String[]{"cancel"}); |
||
26 | 3734 | fjp | } |
27 | Exit { |
||
28 | } |
||
29 | |||
30 | { |
||
31 | |||
32 | 4324 | caballero | addPoint( pointX:double,pointY:double,event:InputEvent) |
33 | 3978 | caballero | FirstPoint { |
34 | 4583 | caballero | setQuestion(PluginServices.getText(this,"insert_point")); |
35 | setDescription(new String[]{"cancel"}); |
||
36 | 4365 | caballero | addPoint( pointX,pointY,event); |
37 | 3734 | fjp | } |
38 | } |
||
39 | 3978 | caballero | |
40 | 3734 | fjp | Default |
41 | { |
||
42 | 3883 | caballero | addOption(s:String) |
43 | 4583 | caballero | [s.equals(PluginServices.getText(this,"cancel"))] |
44 | 3978 | caballero | FirstPoint{ |
45 | 3883 | caballero | end(); |
46 | } |
||
47 | 5730 | caballero | addOption(s:String) |
48 | FirstPoint{ |
||
49 | throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
||
50 | } |
||
51 | addValue(d:double) |
||
52 | FirstPoint{ |
||
53 | throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
||
54 | } |
||
55 | addPoint(pointX:double,pointY:double,event:InputEvent) |
||
56 | FirstPoint{ |
||
57 | throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
||
58 | } |
||
59 | 3734 | fjp | } |
60 | %% |