Revision 1498 branches/pilotoDWG/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Linea.java
Linea.java | ||
---|---|---|
11 | 11 |
public int transition(String label){ |
12 | 12 |
switch (status){ |
13 | 13 |
|
14 |
case -1: |
|
15 |
|
|
16 |
break; |
|
17 |
|
|
14 | 18 |
case 0: |
15 | 19 |
|
16 | 20 |
if ("punto".equalsIgnoreCase(label)){ |
... | ... | |
22 | 26 |
|
23 | 27 |
if ("cancel".equalsIgnoreCase(label)){ |
24 | 28 |
previousStatus = status; |
25 |
status = 4;
|
|
29 |
status = -1;
|
|
26 | 30 |
|
27 | 31 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
28 | 32 |
} |
... | ... | |
47 | 51 |
|
48 | 52 |
if ("cancel".equalsIgnoreCase(label)){ |
49 | 53 |
previousStatus = status; |
50 |
status = 4;
|
|
54 |
status = -1;
|
|
51 | 55 |
|
52 | 56 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
53 | 57 |
} |
... | ... | |
67 | 71 |
previousStatus = status; |
68 | 72 |
status = 4; |
69 | 73 |
|
70 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
|
74 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
|
71 | 75 |
} |
72 | 76 |
|
73 | 77 |
if ("cancel".equalsIgnoreCase(label)){ |
74 | 78 |
previousStatus = status; |
75 |
status = 4;
|
|
79 |
status = -1;
|
|
76 | 80 |
|
77 | 81 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
78 | 82 |
} |
... | ... | |
90 | 94 |
|
91 | 95 |
if ("cancel".equalsIgnoreCase(label)){ |
92 | 96 |
previousStatus = status; |
93 |
status = 4;
|
|
97 |
status = -1;
|
|
94 | 98 |
|
95 | 99 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
96 | 100 |
} |
... | ... | |
108 | 112 |
|
109 | 113 |
if ("cancel".equalsIgnoreCase(label)){ |
110 | 114 |
previousStatus = status; |
111 |
status = 4;
|
|
115 |
status = -1;
|
|
112 | 116 |
|
113 | 117 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
114 | 118 |
} |
... | ... | |
133 | 137 |
|
134 | 138 |
if ("cancel".equalsIgnoreCase(label)){ |
135 | 139 |
previousStatus = status; |
136 |
status = 4;
|
|
140 |
status = -1;
|
|
137 | 141 |
|
138 | 142 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
139 | 143 |
} |
... | ... | |
155 | 159 |
|
156 | 160 |
public boolean checkState(char c){ |
157 | 161 |
|
162 |
if (status == -1){ |
|
163 |
return "".indexOf(c) != -1; |
|
164 |
} |
|
165 |
|
|
158 | 166 |
if (status == 0){ |
159 | 167 |
return "".indexOf(c) != -1; |
160 | 168 |
} |
... | ... | |
185 | 193 |
|
186 | 194 |
public String[] getCurrentTransitions(){ |
187 | 195 |
|
196 |
if (status == -1){ |
|
197 |
return new String[]{}; |
|
198 |
} |
|
199 |
|
|
188 | 200 |
if (status == 0){ |
189 | 201 |
return new String[]{"punto", "cancel"}; |
190 | 202 |
} |
... | ... | |
215 | 227 |
|
216 | 228 |
public String[] getCurrentTransitionDescriptions(){ |
217 | 229 |
|
230 |
if (status == -1){ |
|
231 |
return new String[]{}; |
|
232 |
} |
|
233 |
|
|
218 | 234 |
if (status == 0){ |
219 | 235 |
return new String[]{null, "Cancelar"}; |
220 | 236 |
} |
Also available in: Unified diff