Statistics
| Revision:

svn-gvsig-desktop / trunk / extensions / extCAD / sm / JoinCADTool.sm @ 18368

History | View | Annotate | Download (1.67 KB)

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