root / branches / pilotoDWG / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / cad / cadTools / poligono.java @ 1360
History | View | Annotate | Download (1.65 KB)
1 |
package com.iver.cit.gvsig.fmap.edition.cad.cadTools; |
---|---|
2 |
|
3 |
public class poligono implements com.iver.fsac.Automaton{ |
4 |
private int status = 0; |
5 |
|
6 |
public int transition(String label){ |
7 |
switch (status){
|
8 |
|
9 |
case -1: |
10 |
|
11 |
break;
|
12 |
|
13 |
case 0: |
14 |
|
15 |
if (label.equalsIgnoreCase("numero")){ |
16 |
status = 1;
|
17 |
|
18 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
19 |
} |
20 |
|
21 |
if (label.equalsIgnoreCase("cancel")){ |
22 |
status = -1;
|
23 |
|
24 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
25 |
} |
26 |
|
27 |
break;
|
28 |
|
29 |
case 1: |
30 |
|
31 |
if (label.equalsIgnoreCase("punto")){ |
32 |
status = 2;
|
33 |
|
34 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
35 |
} |
36 |
|
37 |
if (label.equalsIgnoreCase("cancel")){ |
38 |
status = -1;
|
39 |
|
40 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
41 |
} |
42 |
|
43 |
break;
|
44 |
|
45 |
case 2: |
46 |
|
47 |
if (label.equalsIgnoreCase("numero")){ |
48 |
status = 3;
|
49 |
|
50 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
51 |
} |
52 |
|
53 |
if (label.equalsIgnoreCase("punto")){ |
54 |
status = 4;
|
55 |
|
56 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
57 |
} |
58 |
|
59 |
if (label.equalsIgnoreCase("cancel")){ |
60 |
status = -1;
|
61 |
|
62 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
63 |
} |
64 |
|
65 |
break;
|
66 |
|
67 |
case 3: |
68 |
|
69 |
if (label.equalsIgnoreCase("cancel")){ |
70 |
status = -1;
|
71 |
|
72 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
73 |
} |
74 |
|
75 |
break;
|
76 |
|
77 |
case 4: |
78 |
|
79 |
if (label.equalsIgnoreCase("cancel")){ |
80 |
status = -1;
|
81 |
|
82 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
83 |
} |
84 |
|
85 |
break;
|
86 |
|
87 |
} |
88 |
|
89 |
return com.iver.fsac.Automaton.TRANSITION_FAILED;
|
90 |
} |
91 |
|
92 |
public int getStatus(){ |
93 |
return status;
|
94 |
} |
95 |
} |