|
@ -9,7 +9,7 @@ public class MatrixCalcController { |
|
|
|
|
|
|
|
|
// Hier werden die fx:id Attribute verknuepft. |
|
|
// Hier werden die fx:id Attribute verknuepft. |
|
|
@FXML |
|
|
@FXML |
|
|
private Button multiplyButton, addButton, swapInputButton, substractButton, transposeButton; |
|
|
|
|
|
|
|
|
private Button multiplyButton, addButton, DetAButton, DetBButton, substractButton, transposeButton; |
|
|
@FXML |
|
|
@FXML |
|
|
private Text errorText, outputText; |
|
|
private Text errorText, outputText; |
|
|
@FXML |
|
|
@FXML |
|
@ -105,5 +105,39 @@ public class MatrixCalcController { |
|
|
outputText.setTextAlignment(TextAlignment.CENTER); |
|
|
outputText.setTextAlignment(TextAlignment.CENTER); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
DetAButton.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.calcDeterminat(matrixA); |
|
|
|
|
|
|
|
|
|
|
|
String DisplayableString = Double.toString(result); |
|
|
|
|
|
|
|
|
|
|
|
outputText.setText(DisplayableString); |
|
|
|
|
|
outputText.setTextAlignment(TextAlignment.CENTER); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
DetBButton.setOnMouseClicked((event) -> { |
|
|
|
|
|
MatrixCalcMath math = new MatrixCalcMath(); |
|
|
|
|
|
MatrixCalcIOUtils util = new MatrixCalcIOUtils(); |
|
|
|
|
|
|
|
|
|
|
|
String stringMatrixB = matrixBTextArea.getText(); |
|
|
|
|
|
if (util.checkInput(stringMatrixB)) { |
|
|
|
|
|
|
|
|
|
|
|
double[][] matrixB = util.stringToMatrix(stringMatrixB); |
|
|
|
|
|
double result = math.calcDeterminat(matrixB); |
|
|
|
|
|
|
|
|
|
|
|
String DisplayableString = Double.toString(result); |
|
|
|
|
|
|
|
|
|
|
|
outputText.setText(DisplayableString); |
|
|
|
|
|
outputText.setTextAlignment(TextAlignment.CENTER); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |