svn-gvsig-desktop / branches / pilotoDWG / libraries / libFMap / src / com / iver / cit / gvsig / fmap / edition / cad / cadTools / Alargar.java @ 1385
History | View | Annotate | Download (1.62 KB)
1 |
package com.iver.cit.gvsig.fmap.edition.cad.cadTools; |
---|---|
2 |
|
3 |
public class Alargar 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 ("punto".equalsIgnoreCase(label)){ |
16 |
status = 1;
|
17 |
|
18 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
19 |
} |
20 |
|
21 |
if ("cancel".equalsIgnoreCase(label)){ |
22 |
status = -1;
|
23 |
|
24 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
25 |
} |
26 |
|
27 |
break;
|
28 |
|
29 |
case 1: |
30 |
|
31 |
if ("punto".equalsIgnoreCase(label)){ |
32 |
status = 1;
|
33 |
|
34 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
35 |
} |
36 |
|
37 |
if ("aceptar".equalsIgnoreCase(label)){ |
38 |
status = 2;
|
39 |
|
40 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
41 |
} |
42 |
|
43 |
if ("cancel".equalsIgnoreCase(label)){ |
44 |
status = -1;
|
45 |
|
46 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
47 |
} |
48 |
|
49 |
break;
|
50 |
|
51 |
case 2: |
52 |
|
53 |
if ("punto".equalsIgnoreCase(label)){ |
54 |
status = 3;
|
55 |
|
56 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
57 |
} |
58 |
|
59 |
if ("cancel".equalsIgnoreCase(label)){ |
60 |
status = -1;
|
61 |
|
62 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
63 |
} |
64 |
|
65 |
break;
|
66 |
|
67 |
case 3: |
68 |
|
69 |
if ("punto".equalsIgnoreCase(label)){ |
70 |
status = 3;
|
71 |
|
72 |
return com.iver.fsac.Automaton.TRANSITION_SUCCESS;
|
73 |
} |
74 |
|
75 |
if ("cancel".equalsIgnoreCase(label)){ |
76 |
status = -1;
|
77 |
|
78 |
return com.iver.fsac.Automaton.AUTOMATON_FINISHED;
|
79 |
} |
80 |
|
81 |
break;
|
82 |
|
83 |
} |
84 |
|
85 |
return com.iver.fsac.Automaton.TRANSITION_FAILED;
|
86 |
} |
87 |
|
88 |
public int getStatus(){ |
89 |
return status;
|
90 |
} |
91 |
} |