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
Dennis Eisold
Enigma
Commits
bb9bd955
Commit
bb9bd955
authored
5 years ago
by
Jan Schubert
Browse files
Options
Downloads
Patches
Plain Diff
Leuchtfelder leuchten.
parent
a59ed727
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/Enigma/GuiController.java
+177
-17
177 additions, 17 deletions
src/main/java/Enigma/GuiController.java
src/main/resources/Enigma/gui.fxml
+36
-26
36 additions, 26 deletions
src/main/resources/Enigma/gui.fxml
with
213 additions
and
43 deletions
src/main/java/Enigma/GuiController.java
+
177
−
17
View file @
bb9bd955
package
Enigma
;
package
Enigma
;
import
javafx.event.ActionEvent
;
import
javafx.fxml.FXML
;
import
javafx.fxml.FXML
;
import
javafx.scene.control.*
;
import
javafx.scene.control.*
;
import
javafx.scene.input.MouseEvent
;
import
javafx.scene.layout.Background
;
import
javafx.scene.layout.BackgroundFill
;
import
javafx.scene.paint.Color
;
import
java.awt.event.ActionEvent
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
public
class
GuiController
{
public
class
GuiController
{
...
@@ -96,6 +100,85 @@ public class GuiController {
...
@@ -96,6 +100,85 @@ public class GuiController {
@FXML
@FXML
private
Button
btnLöschen
;
private
Button
btnLöschen
;
@FXML
private
Button
btnP1
;
@FXML
private
Button
btnY1
;
@FXML
private
Button
btnX1
;
@FXML
private
Button
btnC1
;
@FXML
private
Button
btnV1
;
@FXML
private
Button
btnB1
;
@FXML
private
Button
btnN1
;
@FXML
private
Button
btnM1
;
@FXML
private
Button
btnL1
;
@FXML
private
Button
btnA1
;
@FXML
private
Button
btnS1
;
@FXML
private
Button
btnD1
;
@FXML
private
Button
btnF1
;
@FXML
private
Button
btnG1
;
@FXML
private
Button
btnH1
;
@FXML
private
Button
btnJ1
;
@FXML
private
Button
btnK1
;
@FXML
private
Button
btnQ1
;
@FXML
private
Button
btnW1
;
@FXML
private
Button
btnE1
;
@FXML
private
Button
btnR1
;
@FXML
private
Button
btnT1
;
@FXML
private
Button
btnZ1
;
@FXML
private
Button
btnU1
;
@FXML
private
Button
btnI1
;
@FXML
private
Button
btnO1
;
@FXML
@FXML
private
MenuButton
mBtnWalzPos1
;
private
MenuButton
mBtnWalzPos1
;
...
@@ -160,9 +243,18 @@ public class GuiController {
...
@@ -160,9 +243,18 @@ public class GuiController {
@FXML
@FXML
private
TextField
tfStecker10
;
private
TextField
tfStecker10
;
// @FXML
@FXML
// void gedrueckteTaste() {
void
leuchtTaste
(
MouseEvent
e
)
{
// }
while
(
e
.
getSource
()
==
btnA
){
btnA1
.
setStyle
(
"-fx-background-color: #ff0000"
);
// setText(btnA);
}
}
@FXML
@FXML
void
btnempfangen
()
{
void
btnempfangen
()
{
...
@@ -200,16 +292,6 @@ public class GuiController {
...
@@ -200,16 +292,6 @@ public class GuiController {
});
});
}
}
}
}
@FXML
private
Button
btnQ1
;
@FXML
void
gedrueckteTasteQ
()
{
btnQ1
.
setStyle
(
"-fx-background-color: #ff0000"
);
//btnQ2.setStyle("-fx-background-color: #ffffff");
}
@FXML
@FXML
void
initialize
()
{
void
initialize
()
{
//Einträge für Walzen
//Einträge für Walzen
...
@@ -264,8 +346,10 @@ public class GuiController {
...
@@ -264,8 +346,10 @@ public class GuiController {
assert
tfcodiert
!=
null
:
"fx:id=\"tfcodiert\" was not injected: check your FXML file 'gui.fxml'."
;
assert
tfcodiert
!=
null
:
"fx:id=\"tfcodiert\" was not injected: check your FXML file 'gui.fxml'."
;
assert
mBtnNotchPos1
!=
null
:
"fx:id=\"mBtnNotchPos1\" was not injected: check your FXML file 'gui.fxml'."
;
assert
mBtnNotchPos1
!=
null
:
"fx:id=\"mBtnNotchPos1\" was not injected: check your FXML file 'gui.fxml'."
;
// ActionListener den Butten hinzufügen
/* ActionListener den Butten hinzufügen
btnA
.
setOnAction
(
e
->
{
gedrueckteTaste
(
e
);});
btnA.setOnAction(e -> {
gedrueckteTaste(e);
});
btnB.setOnAction(e -> {gedrueckteTaste(e);});
btnB.setOnAction(e -> {gedrueckteTaste(e);});
btnC.setOnAction(e -> {gedrueckteTaste(e);});
btnC.setOnAction(e -> {gedrueckteTaste(e);});
btnD.setOnAction(e -> {gedrueckteTaste(e);});
btnD.setOnAction(e -> {gedrueckteTaste(e);});
...
@@ -291,13 +375,79 @@ public class GuiController {
...
@@ -291,13 +375,79 @@ public class GuiController {
btnX.setOnAction(e -> {gedrueckteTaste(e);});
btnX.setOnAction(e -> {gedrueckteTaste(e);});
btnY.setOnAction(e -> {gedrueckteTaste(e);});
btnY.setOnAction(e -> {gedrueckteTaste(e);});
btnZ.setOnAction(e -> {gedrueckteTaste(e);});
btnZ.setOnAction(e -> {gedrueckteTaste(e);});
btnA.setOnMouseEntered (e->{
leuchtTaste(e);
});
btnA1.setOnMouseDragEntered (e -> {leuchtTaste(e);});
btnB1.setOnAction(e -> {gedrueckteTaste(e);});
btnC1.setOnAction(e -> {gedrueckteTaste(e);});
btnD1.setOnAction(e -> {gedrueckteTaste(e);});
btnE1.setOnAction(e -> {gedrueckteTaste(e);});
btnF1.setOnAction(e -> {gedrueckteTaste(e);});
btnG1.setOnAction(e -> {gedrueckteTaste(e);});
btnH1.setOnAction(e -> {gedrueckteTaste(e);});
btnI1.setOnAction(e -> {gedrueckteTaste(e);});
btnJ1.setOnAction(e -> {gedrueckteTaste(e);});
btnK1.setOnAction(e -> {gedrueckteTaste(e);});
btnL1.setOnAction(e -> {gedrueckteTaste(e);});
btnM1.setOnAction(e -> {gedrueckteTaste(e);});
btnN1.setOnAction(e -> {gedrueckteTaste(e);});
btnO1.setOnAction(e -> {gedrueckteTaste(e);});
btnP1.setOnAction(e -> {gedrueckteTaste(e);});
btnQ1.setOnAction(e -> {gedrueckteTaste(e);});
btnR1.setOnAction(e -> {gedrueckteTaste(e);});
btnS1.setOnAction(e -> {gedrueckteTaste(e);});
btnT1.setOnAction(e -> {gedrueckteTaste(e);});
btnU1.setOnAction(e -> {gedrueckteTaste(e);});
btnV1.setOnAction(e -> {gedrueckteTaste(e);});
btnW1.setOnAction(e -> {gedrueckteTaste(e);});
btnX1.setOnAction(e -> {gedrueckteTaste(e);});
btnY1.setOnAction(e -> {gedrueckteTaste(e);});
btnZ1.setOnAction(e -> {gedrueckteTaste(e);});*/
leuchten
(
btnA
,
btnA1
);
leuchten
(
btnB
,
btnB1
);
leuchten
(
btnC
,
btnC1
);
leuchten
(
btnD
,
btnD1
);
leuchten
(
btnE
,
btnE1
);
leuchten
(
btnF
,
btnF1
);
leuchten
(
btnG
,
btnG1
);
leuchten
(
btnH
,
btnH1
);
leuchten
(
btnI
,
btnI1
);
leuchten
(
btnJ
,
btnJ1
);
leuchten
(
btnK
,
btnK1
);
leuchten
(
btnL
,
btnL1
);
leuchten
(
btnM
,
btnM1
);
leuchten
(
btnN
,
btnN1
);
leuchten
(
btnO
,
btnO1
);
leuchten
(
btnP
,
btnP1
);
leuchten
(
btnQ
,
btnQ1
);
leuchten
(
btnR
,
btnR1
);
leuchten
(
btnS
,
btnS1
);
leuchten
(
btnT
,
btnT1
);
leuchten
(
btnU
,
btnU1
);
leuchten
(
btnV
,
btnV1
);
leuchten
(
btnW
,
btnW1
);
leuchten
(
btnX
,
btnX1
);
leuchten
(
btnY
,
btnY1
);
leuchten
(
btnZ
,
btnZ1
);
}
}
/**
/**
* Auswertung welcher Button gedrückt wurde
* Auswertung welcher Button gedrückt wurde
* @param e => ActionEvent des auslösenden Button
* @param e => ActionEvent des auslösenden Button
*/
*/
@FXML
@FXML
private
void
gedrueckteTaste
(
javafx
.
event
.
ActionEvent
e
)
{
// private void gedrueckteTaste(javafx.event.ActionEvent e) {
private
void
gedrueckteTaste
(
ActionEvent
e
)
{
//TODO Anbindung an Klasse Hardware
//TODO Anbindung an Klasse Hardware
if
(
e
.
getSource
()
==
btnA
)
setText
(
btnA
);
if
(
e
.
getSource
()
==
btnA
)
setText
(
btnA
);
if
(
e
.
getSource
()
==
btnB
)
setText
(
btnB
);
if
(
e
.
getSource
()
==
btnB
)
setText
(
btnB
);
...
@@ -337,6 +487,16 @@ public class GuiController {
...
@@ -337,6 +487,16 @@ public class GuiController {
}
}
}
}
private
void
leuchten
(
Button
taste
,
Button
leuchte
){
taste
.
setOnMousePressed
(
mouseEvent
->
{
leuchte
.
setStyle
(
"-fx-background-color: #FFA500"
);
});
taste
.
setOnMouseReleased
(
mouseEvent
->
{
//btnA1.setBackground(Background.EMPTY);
leuchte
.
setStyle
(
"-fx-background-color: "
+
taste
.
getBackground
());
});
}
/**
/**
* Setzt die Anzeige des entsprechende Gui-Element auf die entsprechende Walze
* Setzt die Anzeige des entsprechende Gui-Element auf die entsprechende Walze
* ->d.h. welche Walze sitzt auf welcher Position
* ->d.h. welche Walze sitzt auf welcher Position
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/Enigma/gui.fxml
+
36
−
26
View file @
bb9bd955
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
<?import javafx.scene.control.MenuButton?>
<?import javafx.scene.control.MenuButton?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.paint.RadialGradient?>
<?import javafx.scene.paint.Stop?>
<AnchorPane
maxHeight=
"-Infinity"
maxWidth=
"-Infinity"
minHeight=
"-Infinity"
minWidth=
"-Infinity"
prefHeight=
"677.0"
prefWidth=
"967.0"
xmlns=
"http://javafx.com/javafx/8.0.171"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"Enigma.GuiController"
>
<AnchorPane
maxHeight=
"-Infinity"
maxWidth=
"-Infinity"
minHeight=
"-Infinity"
minWidth=
"-Infinity"
prefHeight=
"677.0"
prefWidth=
"967.0"
xmlns=
"http://javafx.com/javafx/8.0.171"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"Enigma.GuiController"
>
<children>
<children>
...
@@ -115,40 +117,48 @@
...
@@ -115,40 +117,48 @@
<Label
layoutX=
"380.0"
layoutY=
"27.0"
prefHeight=
"17.0"
prefWidth=
"172.0"
text=
"Tageseinstellungen"
/>
<Label
layoutX=
"380.0"
layoutY=
"27.0"
prefHeight=
"17.0"
prefWidth=
"172.0"
text=
"Tageseinstellungen"
/>
<ButtonBar
layoutX=
"-15.0"
layoutY=
"408.0"
prefHeight=
"36.0"
prefWidth=
"860.0"
>
<ButtonBar
layoutX=
"-15.0"
layoutY=
"408.0"
prefHeight=
"36.0"
prefWidth=
"860.0"
>
<buttons>
<buttons>
<Button
fx:id=
"btnP1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"P"
/>
<Button
fx:id=
"btnP1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"P"
/>
<Button
fx:id=
"btnY1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"Y"
/>
<Button
fx:id=
"btnY1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"Y"
/>
<Button
fx:id=
"btnX1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"X"
/>
<Button
fx:id=
"btnX1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"X"
/>
<Button
fx:id=
"btnC1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"C"
/>
<Button
fx:id=
"btnC1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"C"
/>
<Button
fx:id=
"btnV1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"V"
/>
<Button
fx:id=
"btnV1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"V"
/>
<Button
fx:id=
"btnB1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"B"
/>
<Button
fx:id=
"btnB1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"B"
/>
<Button
fx:id=
"btnN1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"N"
/>
<Button
fx:id=
"btnN1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"N"
/>
<Button
fx:id=
"btnM1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"M"
/>
<Button
fx:id=
"btnM1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"M"
/>
<Button
fx:id=
"btnL1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"L"
/>
<Button
fx:id=
"btnL1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"L"
/>
</buttons>
</buttons>
</ButtonBar>
</ButtonBar>
<ButtonBar
layoutX=
"-63.0"
layoutY=
"364.0"
prefHeight=
"36.0"
prefWidth=
"860.0"
>
<ButtonBar
layoutX=
"-63.0"
layoutY=
"364.0"
prefHeight=
"36.0"
prefWidth=
"860.0"
>
<buttons>
<buttons>
<Button
fx:id=
"btnA1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"A"
/>
<Button
fx:id=
"btnA1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"A"
/>
<Button
fx:id=
"btnS1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"S"
/>
<Button
fx:id=
"btnS1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"S"
/>
<Button
fx:id=
"btnD1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"D"
/>
<Button
fx:id=
"btnD1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"D"
>
<Button
fx:id=
"btnF1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"F"
/>
<textFill>
<Button
fx:id=
"btnG1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"G"
/>
<RadialGradient
centerX=
"0.5"
centerY=
"0.5"
radius=
"0.5"
>
<Button
fx:id=
"btnH1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"H"
/>
<stops>
<Button
fx:id=
"btnJ1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"J"
/>
<Stop
color=
"BLACK"
/>
<Button
fx:id=
"btnK1"
mnemonicParsing=
"false"
onAction=
"#gedrueckteTaste"
text=
"K"
/>
<Stop
color=
"WHITE"
offset=
"1.0"
/>
</stops>
</RadialGradient>
</textFill></Button>
<Button
fx:id=
"btnF1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"F"
/>
<Button
fx:id=
"btnG1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"G"
/>
<Button
fx:id=
"btnH1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"H"
/>
<Button
fx:id=
"btnJ1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"J"
/>
<Button
fx:id=
"btnK1"
mnemonicParsing=
"false"
onAction=
"#leuchtTaste"
text=
"K"
/>
</buttons>
</buttons>
</ButtonBar>
</ButtonBar>
<ButtonBar
layoutX=
"46.0"
layoutY=
"328.0"
prefHeight=
"25.0"
prefWidth=
"583.0"
>
<ButtonBar
layoutX=
"46.0"
layoutY=
"328.0"
prefHeight=
"25.0"
prefWidth=
"583.0"
>
<buttons>
<buttons>
<Button
fx:id=
"btnQ1"
minWidth=
"
13
.0"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste
Q
"
prefHeight=
"25.0"
text=
"Q"
/>
<Button
fx:id=
"btnQ1"
disable=
"true"
minWidth=
"
26
.0"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
prefHeight=
"25.0"
text=
"Q"
textFill=
"#544d4d"
/>
<Button
fx:id=
"btnW1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"W"
/>
<Button
fx:id=
"btnW1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"W"
/>
<Button
fx:id=
"btnE1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"E"
/>
<Button
fx:id=
"btnE1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"E"
/>
<Button
fx:id=
"btnR1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"R"
/>
<Button
fx:id=
"btnR1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"R"
/>
<Button
fx:id=
"btnT1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"T"
/>
<Button
fx:id=
"btnT1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"T"
/>
<Button
fx:id=
"btnZ1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"Z"
/>
<Button
fx:id=
"btnZ1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"Z"
/>
<Button
fx:id=
"btnU1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"U"
/>
<Button
fx:id=
"btnU1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"U"
/>
<Button
fx:id=
"btnI1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"I"
/>
<Button
fx:id=
"btnI1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"I"
/>
<Button
fx:id=
"btnO1"
mnemonicParsing=
"false"
onAction=
"#
gedrueckte
Taste"
text=
"O"
/>
<Button
fx:id=
"btnO1"
mnemonicParsing=
"false"
onAction=
"#
leucht
Taste"
text=
"O"
/>
</buttons>
</buttons>
</ButtonBar>
</ButtonBar>
</children>
</children>
...
...
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