Revision 1498 branches/pilotoDWG/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/automaton/Polilinea.java
Polilinea.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 |
} |
... | ... | |
49 | 53 |
previousStatus = status; |
50 | 54 |
status = 4; |
51 | 55 |
|
52 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
|
56 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
|
53 | 57 |
} |
54 | 58 |
|
55 | 59 |
if ("aceptar".equalsIgnoreCase(label)){ |
... | ... | |
61 | 65 |
|
62 | 66 |
if ("cancel".equalsIgnoreCase(label)){ |
63 | 67 |
previousStatus = status; |
64 |
status = 4;
|
|
68 |
status = -1;
|
|
65 | 69 |
|
66 | 70 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
67 | 71 |
} |
... | ... | |
79 | 83 |
|
80 | 84 |
if ("cancel".equalsIgnoreCase(label)){ |
81 | 85 |
previousStatus = status; |
82 |
status = 4;
|
|
86 |
status = -1;
|
|
83 | 87 |
|
84 | 88 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
85 | 89 |
} |
... | ... | |
106 | 110 |
previousStatus = status; |
107 | 111 |
status = 4; |
108 | 112 |
|
109 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
|
113 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
|
110 | 114 |
} |
111 | 115 |
|
112 | 116 |
if ("aceptar".equalsIgnoreCase(label)){ |
... | ... | |
118 | 122 |
|
119 | 123 |
if ("cancel".equalsIgnoreCase(label)){ |
120 | 124 |
previousStatus = status; |
121 |
status = 4;
|
|
125 |
status = -1;
|
|
122 | 126 |
|
123 | 127 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
124 | 128 |
} |
... | ... | |
129 | 133 |
|
130 | 134 |
if ("cancel".equalsIgnoreCase(label)){ |
131 | 135 |
previousStatus = status; |
132 |
status = 4;
|
|
136 |
status = -1;
|
|
133 | 137 |
|
134 | 138 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
135 | 139 |
} |
... | ... | |
140 | 144 |
|
141 | 145 |
if ("cancel".equalsIgnoreCase(label)){ |
142 | 146 |
previousStatus = status; |
143 |
status = 4;
|
|
147 |
status = -1;
|
|
144 | 148 |
|
145 | 149 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED; |
146 | 150 |
} |
... | ... | |
162 | 166 |
|
163 | 167 |
public boolean checkState(char c){ |
164 | 168 |
|
169 |
if (status == -1){ |
|
170 |
return "".indexOf(c) != -1; |
|
171 |
} |
|
172 |
|
|
165 | 173 |
if (status == 0){ |
166 | 174 |
return "".indexOf(c) != -1; |
167 | 175 |
} |
... | ... | |
192 | 200 |
|
193 | 201 |
public String[] getCurrentTransitions(){ |
194 | 202 |
|
203 |
if (status == -1){ |
|
204 |
return new String[]{}; |
|
205 |
} |
|
206 |
|
|
195 | 207 |
if (status == 0){ |
196 | 208 |
return new String[]{"punto", "cancel"}; |
197 | 209 |
} |
... | ... | |
222 | 234 |
|
223 | 235 |
public String[] getCurrentTransitionDescriptions(){ |
224 | 236 |
|
237 |
if (status == -1){ |
|
238 |
return new String[]{}; |
|
239 |
} |
|
240 |
|
|
225 | 241 |
if (status == 0){ |
226 | 242 |
return new String[]{null, "Cancelar"}; |
227 | 243 |
} |
Also available in: Unified diff