Statistics
| Revision:

svn-gvsig-desktop / tags / v1_9_Build_1251 / extensions / extCAD / sm / LineCADTool.sm @ 33816

History | View | Annotate | Download (2.14 KB)

1 3702 caballero
// -*- tab-width: 4; -*-
2
3
%{
4
//
5
// Vicente Caballero Navarro
6
%}
7
8 3978 caballero
%start Line::FirstPoint
9 3702 caballero
%class LineCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11 3734 fjp
%import com.iver.cit.gvsig.gui.cad.tools.LineCADTool
12 4324 caballero
%import java.awt.event.InputEvent
13 4583 caballero
%import com.iver.andami.PluginServices
14 3702 caballero
15 3978 caballero
%map Line
16 3702 caballero
%%
17
// A task begins life in suspended animation.
18
19 3978 caballero
FirstPoint
20 3702 caballero
21
	Entry {
22 4892 caballero
		setQuestion(
23 4583 caballero
		PluginServices.getText(this,"insert_first_point"));
24
		setDescription(new String[]{"cancel"});
25 3702 caballero
		}
26 3744 caballero
	Exit{
27 3702 caballero
		}
28
29
	{
30
31 4324 caballero
		addPoint( pointX:double,pointY:double,event:InputEvent)
32 3978 caballero
			SecondPointOrAngle {
33 4583 caballero
				setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
34
				setDescription(new String[]{"cancel"});
35 4365 caballero
				addPoint( pointX,pointY,event);
36 3702 caballero
				}
37 3744 caballero
38 3702 caballero
	}
39 3978 caballero
SecondPointOrAngle{
40 4324 caballero
	addPoint( pointX:double,pointY:double,event:InputEvent)
41 3978 caballero
		SecondPointOrAngle {
42 4583 caballero
			setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
43
			setDescription(new String[]{"cancel"});
44 4365 caballero
			addPoint( pointX,pointY,event);
45 3702 caballero
			}
46 3828 caballero
	addValue( d:double)
47 3978 caballero
		LenghtOrPoint {
48 4583 caballero
			setQuestion(PluginServices.getText(this,"insert_length_or_point"));
49
			setDescription(new String[]{"cancel"});
50 3828 caballero
			addValue( d);
51 3744 caballero
			}
52
53 3702 caballero
}
54 3978 caballero
LenghtOrPoint{
55 4324 caballero
	addPoint( pointX:double,pointY:double,event:InputEvent)
56 3978 caballero
		SecondPointOrAngle {
57 4583 caballero
			setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
58
			setDescription(new String[]{"cancel"});
59 4365 caballero
			addPoint( pointX,pointY,event);
60 3702 caballero
			}
61 3828 caballero
	addValue( d:double)
62 3978 caballero
		SecondPointOrAngle {
63 4583 caballero
			setQuestion(PluginServices.getText(this,"insert_second_point_angle"));
64
			setDescription(new String[]{"cancel"});
65 3828 caballero
			addValue( d);
66 3744 caballero
			}
67 3702 caballero
	}
68
Default
69
{
70 3883 caballero
	addOption(s:String)
71 4583 caballero
		[s.equals(PluginServices.getText(this,"cancel"))]
72 3978 caballero
		FirstPoint{
73 3883 caballero
			end();
74
			}
75 4475 fjp
	addOption(s:String)
76
		[s.equals("")]
77
		FirstPoint{
78
			end();
79
			}
80 5730 caballero
	addOption(s:String)
81
		FirstPoint{
82
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
83
			}
84
	addValue(d:double)
85
		FirstPoint{
86
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
87
			}
88
	addPoint(pointX:double,pointY:double,event:InputEvent)
89
		FirstPoint{
90
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
91
			}
92 4583 caballero
93 3702 caballero
}
94
%%