Statistics
| Revision:

svn-gvsig-desktop / tags / v1_1_Build_1010 / extensions / extCAD / sm / MoveCADTool.sm @ 43300

History | View | Annotate | Download (1.46 KB)

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

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

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

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

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

    
26
		}
27
	Exit{
28
		}
29

    
30
	{
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			SecondPointToMove {
33
				setQuestion(PluginServices.getText(this,"insert_second_point_move"));
34
				setDescription(new String[]{"cancel"});
35
				addPoint( pointX,pointY,event);
36
				}
37
	}
38
SecondPointToMove{
39
	addPoint( pointX:double,pointY:double,event:InputEvent)
40
		FirstPointToMove {
41
			setDescription(new String[]{"cancel"});
42
			addPoint( pointX,pointY,event);
43
			end();
44
			refresh();
45
			}
46
}
47

    
48
Default
49
{
50
	addOption(s:String)
51
		[s.equals(PluginServices.getText(this,"cancel"))]
52
		FirstPointToMove{
53
			end();
54
			}
55
	addOption(s:String)
56
		FirstPointToMove{
57
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
58
			}
59
	addValue(d:double)
60
		FirstPointToMove{
61
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
62
			}
63
	addPoint(pointX:double,pointY:double,event:InputEvent)
64
		FirstPointToMove{
65
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
66
			}
67
}
68
%%