From 2d2c08e674dfdbd81b349478af7d9840bef4f8d9 Mon Sep 17 00:00:00 2001 From: Lukas Reichwein Date: Mon, 15 Jul 2019 09:14:12 +0200 Subject: [PATCH] connected Transponation to the tranpose Button --- .../ugsbo/matrixcalc/MatrixCalcController.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main/java/com/ugsbo/matrixcalc/MatrixCalcController.java b/src/main/java/com/ugsbo/matrixcalc/MatrixCalcController.java index b674671..ce3a7ee 100644 --- a/src/main/java/com/ugsbo/matrixcalc/MatrixCalcController.java +++ b/src/main/java/com/ugsbo/matrixcalc/MatrixCalcController.java @@ -44,10 +44,28 @@ public class MatrixCalcController { double[][] result = math.matrixMultiplication(matrixA, matrixB); String DisplayableString = util.outputMatrixToOutputText(result); + outputText.setText(DisplayableString); outputText.setTextAlignment(TextAlignment.CENTER); } // System.out.println(matrixATextArea.getText()); }); + + transposeButton.setOnMouseClicked((event) -> { + MatrixCalcMath math = new MatrixCalcMath(); + MatrixCalcIOUtils util = new MatrixCalcIOUtils(); + + String stringMatrixA = matrixATextArea.getText(); + if (util.checkInput(stringMatrixA)) { + + double[][] matrixA = util.stringToMatrix(stringMatrixA); + double[][] result = math.matrixTransponation(matrixA); + + String DisplayableString = util.outputMatrixToOutputText(result); + + outputText.setText(DisplayableString); + outputText.setTextAlignment(TextAlignment.CENTER); + } + }); } } \ No newline at end of file