Statistics
| Revision:

svn-gvsig-desktop / tags / gvsig_redes-1_0_0-1233 / extensions / extCAD / sm / PointCADTool.sm @ 42980

History | View | Annotate | Download (1.2 KB)

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

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

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

    
15

    
16
%map Point
17
%%
18
// A task begins life in suspended animation.
19

    
20
FirstPoint
21

    
22
	Entry {
23
		setQuestion(
24
		PluginServices.getText(this,"define_point"));
25
		setDescription(new String[]{"cancel"});
26
		}
27
	Exit {
28
		}
29

    
30
	{
31

    
32
		addPoint( pointX:double,pointY:double,event:InputEvent)
33
			FirstPoint {
34
				setQuestion(PluginServices.getText(this,"insert_point"));
35
				setDescription(new String[]{"cancel"});
36
				addPoint( pointX,pointY,event);
37
				}
38
	}
39

    
40
Default
41
{
42
	addOption(s:String)
43
		[s.equals(PluginServices.getText(this,"cancel"))]
44
		FirstPoint{
45
			end();
46
			}
47
	addOption(s:String)
48
		FirstPoint{
49
			throwOptionException(PluginServices.getText(this,"incorrect_option"),s);
50
			}
51
	addValue(d:double)
52
		FirstPoint{
53
			throwValueException(PluginServices.getText(this,"incorrect_value"),d);
54
			}
55
	addPoint(pointX:double,pointY:double,event:InputEvent)
56
		FirstPoint{
57
			throwPointException(PluginServices.getText(this,"incorrect_point"),pointX,pointY);
58
			}
59
}
60
%%