Revision 4445 trunk/extensions/extCAD/sm/SelectionCADTool.sm

View differences:

SelectionCADTool.sm
29 29

  
30 30
	{
31 31
		addPoint( pointX:double,pointY:double,event:InputEvent)
32
			[ctxt.select(pointX,pointY) && ctxt.getState().equals("Selection.SecondPoint")]
32
			[ctxt.selectFeatures(pointX,pointY) && ctxt.getNextState().equals("Selection.SecondPoint")]
33 33
			SecondPoint{
34 34
				setQuestion("Precise segundo punto del rect?ngulo de seleccion");
35 35
				setDescription(new String[]{"Cancelar"});
36 36
				addPoint( pointX,pointY,event);
37 37
				}
38 38
		addPoint( pointX:double,pointY:double,event:InputEvent)
39
			[ctxt.getState().equals("Selection.FirstPoint")]
40
			FirstPoint {
41
				setQuestion("Precise punto");
39
			[ctxt.getNextState().equals("Selection.WithSelectedFeatures")]
40
			WithSelectedFeatures {
41
				setQuestion("select_handlers");
42 42
				setDescription(new String[]{"Cancelar"});
43 43
				addPoint( pointX,pointY,event);
44 44
				}
45
		addPoint( pointX:double,pointY:double,event:InputEvent)
46
			[ctxt.getState().equals("Selection.EndPoint")]
47
			EndPoint {
48
				setQuestion("Precise punto destino");
49
				setDescription(new String[]{"Cancelar"});
50
				addPoint( pointX,pointY,event);
51
				}
52 45
}
53 46

  
54 47
SecondPoint{
55 48
	addPoint( pointX:double,pointY:double,event:InputEvent)
49
		[ctxt.selectFeatures(pointX,pointY) && ctxt.getNextState().equals("Selection.FirstPoint")]
56 50
			FirstPoint {
57
				setQuestion("Precise punto de estiramiento");
51
				setQuestion("Precise punto del rect?ngulo de selecci?n");
58 52
				setDescription(new String[]{"Cancelar"});
53

  
54
				}
55
	addPoint( pointX:double,pointY:double,event:InputEvent)
56
			[ctxt.getNextState().equals("Selection.WithSelectedFeatures")]
57
			WithSelectedFeatures {
58
				setQuestion("select_handlers");
59
				setDescription(new String[]{"Cancelar"});
59 60
				addPoint( pointX,pointY,event);
60
				end();
61 61
				}
62 62

  
63 63

  
64 64
}
65
EndPoint{
65
WithSelectedFeatures{
66 66
	addPoint( pointX:double,pointY:double,event:InputEvent)
67
	[ctxt.selectHandlers(pointX,pointY)==0]
67 68
			FirstPoint {
69
				setQuestion("Precise punto del rect?ngulo de selecci?n");
70
				setDescription(new String[]{"Cancelar"});
71
				addPoint( pointX,pointY,event);
72
				refresh();
73
				}
74
				addPoint( pointX:double,pointY:double,event:InputEvent)
75
	[ctxt.selectHandlers(pointX, pointY)>0]
76
			WithHandlers {
68 77
				setQuestion("Precise punto destino");
69 78
				setDescription(new String[]{"Cancelar"});
70 79
				addPoint( pointX,pointY,event);
71
				end();
72 80
				refresh();
73 81
				}
74 82
}
75 83

  
84
WithHandlers{
85
	addPoint( pointX:double,pointY:double,event:InputEvent)
86
			WithSelectedFeatures {
87
				setQuestion("select_handlers");
88
				setDescription(new String[]{"Cancelar"});
89
				addPoint( pointX,pointY,event);
90
				refresh();
91
				}
92
}
93

  
76 94
Default
77 95
{
78 96
	addOption(s:String)

Also available in: Unified diff