Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Enigma
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Uli Bähr
Enigma
Commits
f830b5a3
Commit
f830b5a3
authored
5 years ago
by
Jan Schubert
Browse files
Options
Downloads
Patches
Plain Diff
aktualisierte Gui
parent
b084b268
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/Enigma/GuiController.java
+29
-59
29 additions, 59 deletions
src/main/java/Enigma/GuiController.java
src/main/java/Enigma/Main.java
+0
-3
0 additions, 3 deletions
src/main/java/Enigma/Main.java
src/main/resources/Enigma/gui.fxml
+9
-15
9 additions, 15 deletions
src/main/resources/Enigma/gui.fxml
with
38 additions
and
77 deletions
src/main/java/Enigma/GuiController.java
+
29
−
59
View file @
f830b5a3
...
...
@@ -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
GuiController
2
{
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;
//
}
//
//
//
}
}
This diff is collapsed.
Click to expand it.
src/main/java/Enigma/Main.java
+
0
−
3
View file @
f830b5a3
package
Enigma
;
import
Enigma.model.Codebuch
;
import
Enigma.model.DatenbankSqlite
;
import
Enigma.model.Morsecode
;
import
java.sql.SQLException
;
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/Enigma/gui.fxml
+
9
−
15
View file @
f830b5a3
...
...
@@ -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=
"
w
1"
layoutX=
"91.0"
layoutY=
"76.0"
mnemonicParsing=
"false"
text=
"I"
>
<MenuButton
fx:id=
"
mBtnWalzPos
1"
layoutX=
"91.0"
layoutY=
"76.0"
mnemonicParsing=
"false"
text=
"I"
>
</MenuButton>
<MenuButton
fx:id=
"
w
3"
layoutX=
"171.0"
layoutY=
"76.0"
mnemonicParsing=
"false"
text=
"I"
>
<MenuButton
fx:id=
"
mBtnWalzPos
3"
layoutX=
"171.0"
layoutY=
"76.0"
mnemonicParsing=
"false"
text=
"I"
>
</MenuButton>
<MenuButton
fx:id=
"
w
2"
layoutX=
"133.0"
layoutY=
"76.0"
mnemonicParsing=
"false"
text=
"I"
>
<MenuButton
fx:id=
"
mBtnWalzPos
2"
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=
"
r
3"
layoutX=
"173.0"
layoutY=
"114.0"
mnemonicParsing=
"false"
text=
"1"
>
<MenuButton
fx:id=
"
mBtnNotchPos
3"
layoutX=
"173.0"
layoutY=
"114.0"
mnemonicParsing=
"false"
text=
"1"
>
</MenuButton>
<MenuButton
fx:id=
"
r
2"
layoutX=
"135.0"
layoutY=
"114.0"
mnemonicParsing=
"false"
text=
"1"
>
<MenuButton
fx:id=
"
mBtnNotchPos
2"
layoutX=
"135.0"
layoutY=
"114.0"
mnemonicParsing=
"false"
text=
"1"
>
</MenuButton>
<MenuButton
fx:id=
"
a
1"
layoutX=
"95.0"
layoutY=
"157.0"
mnemonicParsing=
"false"
text=
"A"
>
<MenuButton
fx:id=
"
mBtnStartPos
1"
layoutX=
"95.0"
layoutY=
"157.0"
mnemonicParsing=
"false"
text=
"A"
>
</MenuButton>
<MenuButton
fx:id=
"
a
3"
layoutX=
"175.0"
layoutY=
"157.0"
mnemonicParsing=
"false"
text=
"A"
>
<MenuButton
fx:id=
"
mBtnStartPos
3"
layoutX=
"175.0"
layoutY=
"157.0"
mnemonicParsing=
"false"
text=
"A"
>
</MenuButton>
<MenuButton
fx:id=
"
a
2"
layoutX=
"137.0"
layoutY=
"157.0"
mnemonicParsing=
"false"
text=
"A"
>
<MenuButton
fx:id=
"
mBtnStartPos
2"
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"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment