|
1 package isac.gui.mawen; |
|
2 |
|
3 import java.rmi.RemoteException; |
|
4 import java.util.Vector; |
|
5 |
|
6 import isac.interfaces.ICalcElement; |
|
7 import isac.interfaces.ICalcIterator; |
|
8 import isac.util.formulae.Assumptions; |
|
9 import isac.util.formulae.CalcFormula; |
|
10 import isac.util.formulae.CalcHead; |
|
11 import isac.util.formulae.Context; |
|
12 import isac.util.formulae.ContextMethod; |
|
13 import isac.util.formulae.ContextProblem; |
|
14 import isac.util.formulae.ContextTheory; |
|
15 import isac.util.formulae.Formula; |
|
16 import isac.util.formulae.Match; |
|
17 import isac.util.formulae.MethodID; |
|
18 import isac.util.formulae.Position; |
|
19 import isac.util.formulae.ProblemID; |
|
20 import isac.util.tactics.Tactic; |
|
21 import isac.wsdialog.IContextProvider.ContextType; |
|
22 |
|
23 public class MockDialogIterator implements ICalcIterator { |
|
24 |
|
25 Position pos_; |
|
26 private CalcFormula calc_formula_; |
|
27 private MockCalcTree calc_tree_; |
|
28 |
|
29 public MockDialogIterator(Position pos) { |
|
30 pos_ = pos; |
|
31 calc_tree_= new MockCalcTree(); |
|
32 } |
|
33 |
|
34 @Override |
|
35 public Position getPosition() throws RemoteException { |
|
36 return pos_; |
|
37 } |
|
38 |
|
39 @Override |
|
40 public boolean moveRoot() throws RemoteException { |
|
41 // TODO Auto-generated method stub |
|
42 return false; |
|
43 } |
|
44 |
|
45 @Override |
|
46 public boolean moveCalcHead() throws RemoteException { |
|
47 // TODO Auto-generated method stub |
|
48 return false; |
|
49 } |
|
50 |
|
51 @Override |
|
52 public boolean moveUp() throws RemoteException { |
|
53 // TODO Auto-generated method stub |
|
54 return false; |
|
55 } |
|
56 |
|
57 @Override |
|
58 public boolean moveDown() throws RemoteException { |
|
59 // TODO Auto-generated method stub |
|
60 return false; |
|
61 } |
|
62 |
|
63 @Override |
|
64 public boolean moveLevelUp() throws RemoteException { |
|
65 // TODO Auto-generated method stub |
|
66 return false; |
|
67 } |
|
68 |
|
69 @Override |
|
70 public boolean moveLevelDown() throws RemoteException { |
|
71 // TODO Auto-generated method stub |
|
72 return false; |
|
73 } |
|
74 |
|
75 @Override |
|
76 public boolean isLast() throws RemoteException { |
|
77 // TODO Auto-generated method stub |
|
78 return false; |
|
79 } |
|
80 |
|
81 @Override |
|
82 public boolean onCalcHead() throws RemoteException { |
|
83 // TODO Auto-generated method stub |
|
84 return false; |
|
85 } |
|
86 |
|
87 @Override |
|
88 public boolean onEndOfCalculation() throws RemoteException { |
|
89 // TODO Auto-generated method stub |
|
90 return false; |
|
91 } |
|
92 |
|
93 @Override |
|
94 public boolean switchToGuard() throws RemoteException { |
|
95 // TODO Auto-generated method stub |
|
96 return false; |
|
97 } |
|
98 |
|
99 @Override |
|
100 public boolean switchToModel() throws RemoteException { |
|
101 // TODO Auto-generated method stub |
|
102 return false; |
|
103 } |
|
104 |
|
105 @Override |
|
106 public ICalcElement getElement() throws RemoteException { |
|
107 // TODO Auto-generated method stub |
|
108 return null; |
|
109 } |
|
110 |
|
111 @Override |
|
112 public Vector<CalcFormula> getFormulaeFromTo(ICalcIterator iterator_to, Integer level, |
|
113 boolean result_includes_tactics) throws RemoteException { |
|
114 |
|
115 calc_tree_ = new MockCalcTree(); |
|
116 Vector<CalcFormula> ct = calc_tree_.getTree(); |
|
117 Vector<CalcFormula> from_to = new Vector<>(); |
|
118 |
|
119 Position pfrom = this.getPosition(); |
|
120 Position pto = iterator_to.getPosition(); |
|
121 |
|
122 int i = 0; |
|
123 if (pto.getIntList().size() != 0) { |
|
124 // iterate to start Position |
|
125 while (ct.elementAt(i).getPosition().compareTo(pfrom) != 1) { |
|
126 i = i + 1; |
|
127 } |
|
128 } |
|
129 // iterate from start Position to iterator_to |
|
130 while (ct.elementAt(i).getPosition().compareTo(pto) == -1) { |
|
131 from_to.add(ct.elementAt(i)); |
|
132 i = i + 1; |
|
133 } |
|
134 from_to.add(ct.elementAt(i)); |
|
135 //set for context_formula, which is needed in the context-menu |
|
136 calc_formula_= (CalcFormula)(ct.elementAt(i)); |
|
137 return from_to; |
|
138 } |
|
139 |
|
140 public CalcFormula getFormula(Position pos){ |
|
141 Formula formula=calc_tree_.get(pos); |
|
142 return calc_formula_= new CalcFormula(pos, formula); |
|
143 } |
|
144 @Override |
|
145 public CalcFormula getFormula() throws RemoteException { |
|
146 return calc_formula_; |
|
147 } |
|
148 |
|
149 @Override |
|
150 public Tactic getTactic() throws RemoteException { |
|
151 // TODO Auto-generated method stub |
|
152 return null; |
|
153 } |
|
154 |
|
155 @Override |
|
156 public Vector<Tactic> getApplicableTactics(int scope) throws RemoteException { |
|
157 // TODO Auto-generated method stub |
|
158 return null; |
|
159 } |
|
160 |
|
161 @Override |
|
162 public Assumptions getAssumptions() throws RemoteException { |
|
163 // TODO Auto-generated method stub |
|
164 return null; |
|
165 } |
|
166 |
|
167 @Override |
|
168 public Assumptions getAccumulatedAssumptions() throws RemoteException { |
|
169 // TODO Auto-generated method stub |
|
170 return null; |
|
171 } |
|
172 |
|
173 @Override |
|
174 public int getLevel() throws RemoteException { |
|
175 // TODO Auto-generated method stub |
|
176 return 0; |
|
177 } |
|
178 |
|
179 @Override |
|
180 public ICalcIterator cloneIterator() throws RemoteException { |
|
181 // TODO Auto-generated method stub |
|
182 return null; |
|
183 } |
|
184 |
|
185 @Override |
|
186 public int compareToIterator(ICalcIterator compare) throws RemoteException { |
|
187 // TODO Auto-generated method stub |
|
188 return 0; |
|
189 } |
|
190 |
|
191 @Override |
|
192 public String toSMLString() throws RemoteException { |
|
193 // TODO Auto-generated method stub |
|
194 return null; |
|
195 } |
|
196 |
|
197 @Override |
|
198 public Match initMatchProblem() throws RemoteException { |
|
199 // TODO Auto-generated method stub |
|
200 return null; |
|
201 } |
|
202 |
|
203 @Override |
|
204 public Match tryMatchProblem(ProblemID problemID) throws RemoteException { |
|
205 // TODO Auto-generated method stub |
|
206 return null; |
|
207 } |
|
208 |
|
209 @Override |
|
210 public Match tryRefineProblem(ProblemID problemID) throws RemoteException { |
|
211 // TODO Auto-generated method stub |
|
212 return null; |
|
213 } |
|
214 |
|
215 @Override |
|
216 public Match initMatchMethod() throws RemoteException { |
|
217 // TODO Auto-generated method stub |
|
218 return null; |
|
219 } |
|
220 |
|
221 @Override |
|
222 public Match tryMatchMethod(MethodID methodID) throws RemoteException { |
|
223 // TODO Auto-generated method stub |
|
224 return null; |
|
225 } |
|
226 |
|
227 @Override |
|
228 public Context initContext(ContextType type) throws RemoteException { |
|
229 // TODO Auto-generated method stub |
|
230 return null; |
|
231 } |
|
232 |
|
233 @Override |
|
234 public Context checkContext(Context context2check) throws RemoteException { |
|
235 // TODO Auto-generated method stub |
|
236 return null; |
|
237 } |
|
238 |
|
239 @Override |
|
240 public Context refineProblem(Context context2refine) throws RemoteException { |
|
241 // TODO Auto-generated method stub |
|
242 return null; |
|
243 } |
|
244 |
|
245 @Override |
|
246 public CalcHead setContext(ContextProblem context2set) |
|
247 throws RemoteException { |
|
248 // TODO Auto-generated method stub |
|
249 return null; |
|
250 } |
|
251 |
|
252 @Override |
|
253 public CalcHead setContext(ContextMethod context2set) |
|
254 throws RemoteException { |
|
255 // TODO Auto-generated method stub |
|
256 return null; |
|
257 } |
|
258 |
|
259 @Override |
|
260 public void setContext(ContextTheory context2set) throws RemoteException { |
|
261 // TODO Auto-generated method stub |
|
262 |
|
263 } |
|
264 |
|
265 } |