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