root / tags / tmp_build / extensions / extCAD / sm / InternalPolygonCADTool.sm @ 31327
History | View | Annotate | Download (2.09 KB)
1 | 5322 | caballero | // -*- tab-width: 4; -*- |
---|---|---|---|
2 | |||
3 | %{ |
||
4 | // |
||
5 | // Vicente Caballero Navarro |
||
6 | %} |
||
7 | |||
8 | 5388 | caballero | %start InternalPolygon::AddNextPoint |
9 | 5322 | caballero | %class InternalPolygonCADTool |
10 | %package com.iver.cit.gvsig.gui.cad.tools.smc |
||
11 | %import com.iver.cit.gvsig.gui.cad.tools.InternalPolygonCADTool |
||
12 | %import java.awt.event.InputEvent |
||
13 | %import com.iver.andami.PluginServices |
||
14 | |||
15 | 5388 | caballero | %map InternalPolygon |
16 | 5322 | caballero | %% |
17 | // A task begins life in suspended animation. |
||
18 | |||
19 | AddNextPoint |
||
20 | Entry { |
||
21 | selection(); |
||
22 | setQuestion( |
||
23 | 9121 | caballero | PluginServices.getText(this,"next_point")+" "+ |
24 | PluginServices.getText(this,"cad.or")+" "+ |
||
25 | PluginServices.getText(this,"end")+ |
||
26 | "["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]"); |
||
27 | 5322 | caballero | setDescription(new String[]{"end","cancel"}); |
28 | |||
29 | } |
||
30 | Exit{ |
||
31 | } |
||
32 | |||
33 | { |
||
34 | addPoint( pointX:double,pointY:double,event:InputEvent) |
||
35 | AddNextPoint { |
||
36 | 9121 | caballero | setQuestion( |
37 | PluginServices.getText(this,"next_point")+" "+ |
||
38 | PluginServices.getText(this,"cad.or")+" "+ |
||
39 | PluginServices.getText(this,"end")+ |
||
40 | "["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]"); |
||
41 | 5322 | caballero | setDescription(new String[]{"end","cancel"}); |
42 | addPoint( pointX,pointY,event); |
||
43 | } |
||
44 | addOption(s:String) |
||
45 | AddNextPoint { |
||
46 | 9121 | caballero | setQuestion( |
47 | PluginServices.getText(this,"next_point")+" "+ |
||
48 | PluginServices.getText(this,"cad.or")+" "+ |
||
49 | "["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]"); |
||
50 | 5322 | caballero | setDescription(new String[]{"end","cancel"}); |
51 | addOption(s); |
||
52 | } |
||
53 | } |
||
54 | |||
55 | |||
56 | Default |
||
57 | { |
||
58 | addOption(s:String) |
||
59 | [s.equals(PluginServices.getText(this,"cancel"))] |
||
60 | AddNextPoint{ |
||
61 | end(); |
||
62 | } |
||
63 | 5730 | caballero | addOption(s:String) |
64 | AddNextPoint{ |
||
65 | throwOptionException(PluginServices.getText(this,"incorrect_option"),s); |
||
66 | } |
||
67 | addValue(d:double) |
||
68 | AddNextPoint{ |
||
69 | throwValueException(PluginServices.getText(this,"incorrect_value"),d); |
||
70 | } |
||
71 | addPoint(pointX:double,pointY:double,event:InputEvent) |
||
72 | AddNextPoint{ |
||
73 | throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY); |
||
74 | } |
||
75 | 17984 | vcaballero | endPoint(pointX:double,pointY:double,event:InputEvent) |
76 | AddNextPoint{ |
||
77 | addPoint( pointX,pointY,event); |
||
78 | addOption(PluginServices.getText(this,"InternalPolygonCADTool.end")); |
||
79 | } |
||
80 | 5322 | caballero | } |
81 | %% |