Statistics
| Revision:

svn-gvsig-desktop / tags / v1_0_2_Build_915 / extensions / extCAD / sm / MultiPointCADTool.sm @ 38511

History | View | Annotate | Download (1.5 KB)

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

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

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

    
15

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

    
20
InsertPoint
21

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

    
30
	{
31

    
32
		addPoint( pointX:double,pointY:double,event:InputEvent)
33
			InsertPoint {
34
				setQuestion(PluginServices.getText(this,"insert_point_or_end"));
35
				setDescription(new String[]{"cancel","end"});
36
				addPoint( pointX,pointY,event);
37
				}
38
		addOption( s:String)
39
			[s.equals("e") || s.equals("E") || s.equals(PluginServices.getText(this,"end"))]
40
			InsertPoint {
41
				setQuestion(PluginServices.getText(this,"insert_point"));
42
				setDescription(new String[]{"cancel"});
43
				addOption(s);
44
				endGeometry();
45
				}
46
	}
47

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