Skip to content
Snippets Groups Projects
Commit dfbc2232 authored by Dennis Eisold's avatar Dennis Eisold
Browse files

Merge branch 'master' into 'master'

aktualisierte Gui

See merge request alfatrainingkurse/java/enigma!15
parents b084b268 f830b5a3
No related branches found
No related tags found
No related merge requests found
......@@ -5,11 +5,12 @@ import javafx.scene.control.Button;
import javafx.scene.control.MenuButton;
import javafx.scene.control.MenuItem;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
public class GuiController2 {
private ArrayList<MenuItem> mItem;
public class GuiController {
ArrayList<MenuItem> mItem;
private final static String[] str= {"I", "II", "III", "IV", "V"};
private final static String[] num ={"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"};
private final static String[] bs ={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
......@@ -122,18 +123,15 @@ public class GuiController2 {
@FXML
void gedrueckteTaste(ActionEvent event) {
}
public void gedrueckteTaste(){
void gedrueckteTaste() {
Button bn = new Button();
if (bn.getText().equals("A")){
System.out.println("hello");
}
// public void gedrueckteTaste() {
// txt.setText("hello");
// }
// public void action(ActionEvent ae){
// if (ae.getSource()==)
// }
}
@FXML
void empfangen(ActionEvent event) {
......@@ -143,33 +141,6 @@ public class GuiController2 {
}
// txtoriginal.setText(bn.getText());
// }
// public void gedrueckteTaste(Button bn){
// }
// public void gedrueckteTaste (){
//
// new EventHandler<KeyEvent>(){
//
// }
//
//
//
// }
@FXML
void btnsenden(ActionEvent event) {
}
......@@ -191,9 +162,8 @@ public class GuiController2 {
* @param button : Button für die die Einträge erstellt werden sollen
*/
private void menu(MenuButton button, String[] str) {
mItem = new ArrayList<>();
mItem = new ArrayList<>();
for (int i = 0; i < str.length; i++) {
//Eintrag aus str der Arraylist mi hinzufügen
mItem.add(new MenuItem(str[i]));
//MenuItem mi dem Button button hinzufügen
......@@ -261,23 +231,23 @@ public class GuiController2 {
assert mBtnNotchPos1 != null : "fx:id=\"r1\" was not injected: check your FXML file 'gui.fxml'.";
}
/**
* Setzt die Anzeige des entsprechende Gui-Element auf die entsprechende Walze
*
* @param walze => gibt die Walzennummer an (entspricht
* @param position => gibt die Position der Walze (entspricht
*/
public void setzeWalze(int walze, int position){
switch (position){
case 1:
mBtnWalzPos1.setText();
break;
case 2:
break;
case 3:
break;
}
}
// /**
// * Setzt die Anzeige des entsprechende Gui-Element auf die entsprechende Walze
// *
// * @param walze => gibt die Walzennummer an (entspricht
// * @param position => gibt die Position der Walze (entspricht
// */
// public void setzeWalze(int walze, int position){
// switch (position){
// case 1:
// // mBtnWalzPos1.setText();
// break;
// case 2:
// break;
// case 3:
// break;
// }
//
//
// }
}
package Enigma;
import Enigma.model.Codebuch;
import Enigma.model.DatenbankSqlite;
import Enigma.model.Morsecode;
import java.sql.SQLException;
......
......@@ -4,7 +4,6 @@
<?import javafx.scene.control.ButtonBar?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.MenuButton?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
......@@ -97,11 +96,11 @@
<Button mnemonicParsing="false" text="O" />
</buttons>
</ButtonBar>
<MenuButton fx:id="w1" layoutX="91.0" layoutY="76.0" mnemonicParsing="false" text="I">
<MenuButton fx:id="mBtnWalzPos1" layoutX="91.0" layoutY="76.0" mnemonicParsing="false" text="I">
</MenuButton>
<MenuButton fx:id="w3" layoutX="171.0" layoutY="76.0" mnemonicParsing="false" text="I">
<MenuButton fx:id="mBtnWalzPos3" layoutX="171.0" layoutY="76.0" mnemonicParsing="false" text="I">
</MenuButton>
<MenuButton fx:id="w2" layoutX="133.0" layoutY="76.0" mnemonicParsing="false" text="I">
<MenuButton fx:id="mBtnWalzPos2" layoutX="133.0" layoutY="76.0" mnemonicParsing="false" text="I">
</MenuButton>
<!-- <MenuButton layoutX="93.0" layoutY="114.0" mnemonicParsing="false">-->
<!-- <items>-->
......@@ -133,15 +132,15 @@
<!-- <MenuItem mnemonicParsing="false" onAction="#z26" text="26" />-->
<!-- </items>-->
<!-- </MenuButton>-->
<MenuButton fx:id="r3" layoutX="173.0" layoutY="114.0" mnemonicParsing="false" text="1">
<MenuButton fx:id="mBtnNotchPos3" layoutX="173.0" layoutY="114.0" mnemonicParsing="false" text="1">
</MenuButton>
<MenuButton fx:id="r2" layoutX="135.0" layoutY="114.0" mnemonicParsing="false" text="1">
<MenuButton fx:id="mBtnNotchPos2" layoutX="135.0" layoutY="114.0" mnemonicParsing="false" text="1">
</MenuButton>
<MenuButton fx:id="a1" layoutX="95.0" layoutY="157.0" mnemonicParsing="false" text="A">
<MenuButton fx:id="mBtnStartPos1" layoutX="95.0" layoutY="157.0" mnemonicParsing="false" text="A">
</MenuButton>
<MenuButton fx:id="a3" layoutX="175.0" layoutY="157.0" mnemonicParsing="false" text="A">
<MenuButton fx:id="mBtnStartPos3" layoutX="175.0" layoutY="157.0" mnemonicParsing="false" text="A">
</MenuButton>
<MenuButton fx:id="a2" layoutX="137.0" layoutY="157.0" mnemonicParsing="false" text="A">
<MenuButton fx:id="mBtnStartPos2" layoutX="137.0" layoutY="157.0" mnemonicParsing="false" text="A">
</MenuButton>
<TextField layoutX="246.0" layoutY="76.0" prefHeight="77.0" prefWidth="410.0" />
<TextField layoutX="248.0" layoutY="182.0" prefHeight="77.0" prefWidth="410.0" />
......@@ -149,12 +148,7 @@
<Button layoutX="717.0" layoutY="135.0" mnemonicParsing="false" onAction="#empfangen" prefHeight="69.0" prefWidth="164.0" text="Funkspruch empfangen" />
<TextField layoutX="725.0" layoutY="76.0" />
<Label layoutX="727.0" layoutY="51.0" prefHeight="17.0" prefWidth="149.0" text="Kenngruppe" />
<MenuButton fx:id="r1" layoutX="93.0" layoutY="114.0" mnemonicParsing="false" text="1">
<items>
<MenuItem mnemonicParsing="false" text="Action 1" />
<MenuItem mnemonicParsing="false" text="Action 2" />
</items>
</MenuButton>
<MenuButton fx:id="mBtnNotchPos1" layoutX="93.0" layoutY="114.0" mnemonicParsing="false" text="1" />
<Label layoutX="29.0" layoutY="80.0" text="Walze" />
<Label layoutX="29.0" layoutY="127.0" text="Ringe" />
<Label layoutX="11.0" layoutY="161.0" text="Startposition" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment