Browse Source

connected Transponation to the tranpose Button

featureMatrixCalculator
Lukas Reichwein 5 years ago
parent
commit
2d2c08e674
  1. 18
      src/main/java/com/ugsbo/matrixcalc/MatrixCalcController.java

18
src/main/java/com/ugsbo/matrixcalc/MatrixCalcController.java

@ -44,10 +44,28 @@ public class MatrixCalcController {
double[][] result = math.matrixMultiplication(matrixA, matrixB); double[][] result = math.matrixMultiplication(matrixA, matrixB);
String DisplayableString = util.outputMatrixToOutputText(result); String DisplayableString = util.outputMatrixToOutputText(result);
outputText.setText(DisplayableString); outputText.setText(DisplayableString);
outputText.setTextAlignment(TextAlignment.CENTER); outputText.setTextAlignment(TextAlignment.CENTER);
} }
// System.out.println(matrixATextArea.getText()); // 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);
}
});
} }
} }
Loading…
Cancel
Save