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