1 package com.example.furt.myapplication;
3 import android.view.View;
4 import android.widget.TextView;
5 import android.widget.Toast;
7 public class touchParserHandler implements View.OnClickListener
9 int type; //0=and 1=or 2=impl 3=not 4=literal
10 char l; //for literals
11 touchParserHandler(int t,char l)
16 public void onClick(View view)
18 if(!parserDialog.F.toString().contains("_"))
20 Toast.makeText(DrawActivity.rootNode.view.getContext(),"Formula completa! Premere \"Undo\" per modificare", Toast.LENGTH_SHORT).show();
23 parserDialog.undo.add(parserDialog.F.duplicate());
24 parserDialog.formulaLayout.removeAllViews();
27 UndefinedFormula newCursor=new UndefinedFormula();
28 newCursor.currentF=true;
29 Formula newF=new FormulaAnd(newCursor,new UndefinedFormula());
30 if ((parserDialog.F).toString().equals("_"))
35 parserDialog.F.Fill(newF);
36 parserDialog.F.setCursor();
41 UndefinedFormula newCursor=new UndefinedFormula();
42 newCursor.currentF=true;
43 Formula newF=new FormulaOr(newCursor,new UndefinedFormula());
44 if ((parserDialog.F).toString().equals("_"))
49 parserDialog.F.Fill(newF);
53 UndefinedFormula newCursor=new UndefinedFormula();
54 newCursor.currentF=true;
55 Formula newF=new FormulaImpl(newCursor,new UndefinedFormula());
56 if ((parserDialog.F).toString().equals("_"))
61 parserDialog.F.Fill(newF);
62 parserDialog.F.setCursor();
67 UndefinedFormula newCursor=new UndefinedFormula();
68 newCursor.currentF=true;
69 Formula newF=new FormulaNot(newCursor);
70 if ((parserDialog.F).toString().equals("_"))
75 parserDialog.F.Fill(newF);
76 parserDialog.F.setCursor();
83 newF=new FormulaBOT();
85 newF=new FormulaTOP();
88 if ((parserDialog.F).toString().equals("_"))
93 parserDialog.F.Fill(newF);
94 parserDialog.F.setCursor();
97 TextView FView=new TextView(parserDialog.formulaLayout.getContext());
98 FView.setText(parserDialog.F.toString());
99 FView.setTextSize(DrawActivity.textSize);
100 parserDialog.formulaLayout.addView(FView);