Statistics
| Revision:

svn-gvsig-desktop / tags / v2_0_Build_1215 / extensions / extCAD / sm / RotateCADTool.sm @ 44644

History | View | Annotate | Download (1.53 KB)

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

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

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

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

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

    
26
		}
27
	Exit{
28
		}
29

    
30
	{
31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			AngleOrPoint {
33
				setQuestion(PluginServices.getText(this,"insert_rotation_angle"));
34
				setDescription(new String[]{"cancel"});
35
				addPoint( pointX,pointY,event);
36
				}
37
	}
38
AngleOrPoint{
39
	addValue(d:double)
40
		PointMain{
41
			setDescription(new String[]{"cancel"});
42
			addValue(d);
43
			end();
44
			refresh();
45
			}
46
	addPoint( pointX:double,pointY:double,event:InputEvent)
47
		PointMain {
48
			setDescription(new String[]{"cancel"});
49
			addPoint( pointX,pointY,event);
50
			end();
51
			refresh();
52
			}
53
}
54

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