Statistics
| Revision:

root / trunk / extensions / extCAD / sm / StretchCADTool.sm @ 11445

History | View | Annotate | Download (1.99 KB)

1 6044 caballero
// -*- tab-width: 4; -*-
2
3
%{
4
//
5
// Vicente Caballero Navarro
6
%}
7
8
%start Stretch::SelFirstPoint
9
%class StretchCADTool
10
%package com.iver.cit.gvsig.gui.cad.tools.smc
11
%import com.iver.cit.gvsig.gui.cad.tools.StretchCADTool
12
%import java.awt.event.InputEvent
13
%import com.iver.andami.PluginServices
14
15
%map Stretch
16
%%
17
// A task begins life in suspended animation.
18
19
SelFirstPoint
20
	Entry {
21
		selection();
22
		setQuestion(
23
		PluginServices.getText(this,"insert_selection_point"));
24
		setDescription(new String[]{"cancel"});
25
26
		}
27
	Exit{
28
		}
29
30
	{
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			SelLastPoint {
33
				setQuestion(PluginServices.getText(this,"insert_selection_last_point"));
34
				setDescription(new String[]{"cancel"});
35
				addPoint( pointX,pointY,event);
36
				}
37
	}
38
SelLastPoint{
39
	addPoint( pointX:double,pointY:double,event:InputEvent)
40
		MoveFirstPoint {
41
			setQuestion(PluginServices.getText(this,"insert_move_first_point"));
42
			setDescription(new String[]{"cancel"});
43
			addPoint( pointX,pointY,event);
44
			}
45
}
46
MoveFirstPoint{
47
	addPoint( pointX:double,pointY:double,event:InputEvent)
48
		MoveLastPoint {
49
			setQuestion(PluginServices.getText(this,"insert_move_last_point"));
50
			setDescription(new String[]{"cancel"});
51
			addPoint( pointX,pointY,event);
52
			}
53
}
54
MoveLastPoint{
55
	addPoint( pointX:double,pointY:double,event:InputEvent)
56
		SelFirstPoint {
57
			setQuestion(PluginServices.getText(this,"insert_selection_point"));
58
			setDescription(new String[]{"cancel"});
59
			addPoint( pointX,pointY,event);
60
			end();
61
			}
62
}
63
Default
64
{
65
	addOption(s:String)
66
		[s.equals(PluginServices.getText(this,"cancel"))]
67
		SelFirstPoint{
68
			end();
69
			}
70
	addOption(s:String)
71
		SelFirstPoint{
72
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
73
			}
74
	addValue(d:double)
75
		SelFirstPoint{
76
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
77
			}
78
	addPoint(pointX:double,pointY:double,event:InputEvent)
79
		SelFirstPoint{
80
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
81
			}
82
}
83
%%