Spreadsheet new uiMethod cellInput implemented.
parent
82406c871d
commit
8a9fe270b1
|
@ -16,10 +16,6 @@ public class Axel {
|
|||
|
||||
while (true) {
|
||||
|
||||
|
||||
spr.cells[sc.nextInt()-1][5].setFormula(sc.next());
|
||||
spr.updateSpreadsheet();
|
||||
|
||||
System.out.println(spr.toStringShowFormula());
|
||||
System.out.println(spr);
|
||||
|
||||
|
|
|
@ -443,6 +443,32 @@ public class Spreadsheet {
|
|||
for (int c = 0; c < cells[r].length; c++)
|
||||
evaluateCell(r, c);
|
||||
}
|
||||
public void cellInput() throws FileNotFoundException {
|
||||
Scanner cs = new Scanner(System.in);
|
||||
|
||||
String input = cs.nextLine();
|
||||
ArrayList<String> inputs = new ArrayList<>();
|
||||
inputs.add(input.split(" ")[0]);
|
||||
inputs.add(input.split(" ")[1]);
|
||||
|
||||
try {
|
||||
if (inputs.contains("EINLESEN"))
|
||||
readCsv(inputs.get(1).split(" ")[0], inputs.get(1).split(" ")[1].charAt(0), inputs.get(1).split(" ")[2]);
|
||||
else if (inputs.contains("SPEICHERN"))
|
||||
saveCsv(inputs.get(1));
|
||||
else if (inputs.contains("FORMELN"))
|
||||
System.out.println(toStringShowFormula());
|
||||
else
|
||||
cells[getRow(inputs.get(0)) - 1][getCol(inputs.get(1)) - 1].setFormula(cs.next());
|
||||
|
||||
updateSpreadsheet();
|
||||
} catch(ArrayIndexOutOfBoundsException a){
|
||||
System.out.println("\nEingegebene Zelle existiert nicht!");
|
||||
}
|
||||
|
||||
inputs.clear();
|
||||
|
||||
}
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
|
Loading…
Reference in New Issue