Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / extensions / extEditing / sm / MatrixCADTool.sm @ 39127

History | View | Annotate | Download (1.55 KB)

1
// -*- tab-width: 4; -*-
2

    
3
%{
4
//
5
// Vicente Caballero Navarro
6
%}
7

    
8
%start Matrix::Start
9
%class MatrixCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.MatrixCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14

    
15
%map Matrix
16
%%
17
// A task begins life in suspended animation.
18

    
19
Start
20
	Entry {
21
		selection();
22
		setQuestion(
23
		PluginServices.getText(this,"insert_first_point"));
24
		setDescription(new String[]{"cancel"});
25

    
26
		}
27
	Exit{
28
		}
29

    
30
	{
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			SecondPoint {
33
				setQuestion(PluginServices.getText(this,"insert_second_point"));
34
				setDescription(new String[]{"cancel"});
35
				addPoint( pointX,pointY,event);
36
				}
37

    
38
	}
39

    
40
FirstPoint{
41
	addPoint( pointX:double,pointY:double,event:InputEvent)
42
		SecondPoint {
43
			setDescription(new String[]{"cancel"});
44
			addPoint( pointX,pointY,event);
45
			}
46
}
47
SecondPoint{
48
	addPoint( pointX:double,pointY:double,event:InputEvent)
49
		FirstPoint {
50
			setDescription(new String[]{"cancel"});
51
			addPoint( pointX,pointY,event);
52
			endMatrix();
53
			}
54
}
55

    
56
Default
57
{
58
	addOption(s:String)
59
		[s.equals(PluginServices.getText(this,"cancel"))]
60
		Start{
61
			end();
62
			}
63
	addOption(s:String)
64
		Start{
65
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
66
			}
67
	addValue(d:double)
68
		Start{
69
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
70
			}
71
	addPoint(pointX:double,pointY:double,event:InputEvent)
72
		Start{
73
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
74
			}
75
}
76
%%