Statistics
| Revision:

svn-gvsig-desktop / tags / v1_12_0_Build_1413 / extensions / extCAD / sm / InternalPolygonCADTool.sm @ 40002

History | View | Annotate | Download (2.09 KB)

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

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

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

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

    
19
AddNextPoint
20
	Entry {
21
		selection();
22
		setQuestion(
23
			PluginServices.getText(this,"next_point")+" "+
24
		    PluginServices.getText(this,"cad.or")+" "+
25
		    PluginServices.getText(this,"end")+
26
		    "["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]");
27
		setDescription(new String[]{"end","cancel"});
28

    
29
		}
30
	Exit{
31
		}
32

    
33
	{
34
		addPoint( pointX:double,pointY:double,event:InputEvent)
35
			AddNextPoint {
36
				setQuestion(
37
					PluginServices.getText(this,"next_point")+" "+
38
		    		PluginServices.getText(this,"cad.or")+" "+
39
		    		PluginServices.getText(this,"end")+
40
		    		"["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]");
41
				setDescription(new String[]{"end","cancel"});
42
				addPoint( pointX,pointY,event);
43
				}
44
		addOption(s:String)
45
			AddNextPoint {
46
				setQuestion(
47
					PluginServices.getText(this,"next_point")+" "+
48
		    		PluginServices.getText(this,"cad.or")+" "+
49
		    		"["+PluginServices.getText(this,"InternalPolygonCADTool.end")+"]");
50
				setDescription(new String[]{"end","cancel"});
51
				addOption(s);
52
				}
53
	}
54

    
55

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