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
Jan Schubert
Enigma
Commits
e81f4d2b
Commit
e81f4d2b
authored
5 years ago
by
Dennis Eisold
Browse files
Options
Downloads
Patches
Plain Diff
Progress Dialog für Funkraum
parent
88f56483
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/projekt/enigma/GuiController.java
+36
-48
36 additions, 48 deletions
src/main/java/projekt/enigma/GuiController.java
with
36 additions
and
48 deletions
src/main/java/projekt/enigma/GuiController.java
+
36
−
48
View file @
e81f4d2b
...
...
@@ -10,9 +10,7 @@ import javafx.scene.input.MouseEvent;
import
javafx.scene.layout.GridPane
;
import
javafx.scene.layout.Pane
;
import
javafx.scene.shape.Circle
;
import
javafx.stage.StageStyle
;
import
org.apache.http.HttpException
;
import
org.controlsfx.dialog.ProgressDialog
;
import
projekt.enigma.model.Codierer
;
import
projekt.enigma.model.Fehler
;
...
...
@@ -56,10 +54,10 @@ public class GuiController {
@FXML
private
Label
lblA
,
lblB
,
lblC
,
lblD
,
lblE
,
lblF
,
lblG
,
lblH
,
lblI
,
lblJ
,
lblK
,
lblL
,
lblM
,
lblN
,
lblO
,
lblP
,
lblQ
,
lblR
,
lblS
,
lblT
,
lblU
,
lblV
,
lblW
,
lblX
,
lblY
,
lblZ
,
lblLadeNachricht
,
lblTagesschluessel
,
lblSpruchschluessel
,
lblKenngruppe
;
//deklariert d
i
e Progress
Ba
r
lblSpruchschluessel
,
lblKenngruppe
,
lblProgressText
;
//deklariert de
n
Progress
Indicato
r
@FXML
private
Progress
Bar
pbLadeNachricht
;
private
Progress
Indicator
piProgress
;
//deklariert die MenueButtons
@FXML
private
MenuButton
mBtnWalzPos1
,
mBtnWalzPos2
,
mBtnWalzPos3
,
mBtnNotchPos1
,
mBtnNotchPos2
,
mBtnNotchPos3
,
...
...
@@ -70,7 +68,7 @@ public class GuiController {
tfStecker9
,
tfStecker10
,
tfCodiert
,
tfKlartext
;
//deklariert benötigtes pane
@FXML
private
Pane
portPane
;
private
Pane
portPane
,
paneProgress
;
//deklariert benötigtes GridPane
@FXML
private
GridPane
mainGrid
;
...
...
@@ -90,7 +88,6 @@ public class GuiController {
textEingabe
=
""
;
textCodiert
=
""
;
resetDisplay
=
true
;
lblKenngruppe
.
setText
(
this
.
codierer
.
getKenngruppe
());
//Einträge für Walzen
menu
(
mBtnWalzPos1
,
walzenNr
);
...
...
@@ -550,25 +547,7 @@ public class GuiController {
* sowie den Klartext in das Textfeld tfKlartext. Setzt den Spruchschlüssel
*/
private
void
empfangeFunkspruch
()
{
progressDialogue
(
"rx"
);
try
{
if
(
this
.
empfangeneNachricht
[
2
]
!=
null
&&
this
.
empfangeneNachricht
[
1
]
!=
null
)
{
setzeTagesSchluessel
();
tfKlartext
.
setText
(
this
.
empfangeneNachricht
[
2
]);
tfCodiert
.
setText
(
this
.
empfangeneNachricht
[
1
]);
resetDisplay
=
true
;
// Spruchschluessel in das Feld lblSpruchschluessel schreiben
lblSpruchschluessel
.
setText
(
codierer
.
empfangenerSpruchschluessel
(
this
.
empfangeneNachricht
[
2
]));
}
}
catch
(
NullPointerException
ignored
)
{
new
Fehler
().
showErrorDialog
(
"warning"
,
"Keiner schreibt dir..."
,
"Es liegen keine neuen Nachrichten im Funkraum für Sie vor."
);
}
funkraumProgressDialogue
(
"rx"
);
}
/**
...
...
@@ -576,11 +555,10 @@ public class GuiController {
* Löscht die Textfelder tfKlartext und tfCodiert
*/
private
void
sendeFunkspruch
()
{
this
.
tfKlartext
.
setText
(
""
);
this
.
tfCodiert
.
setText
(
""
);
p
rogressDialogue
(
"tx"
);
funkraumP
rogressDialogue
(
"tx"
);
}
/**
...
...
@@ -588,25 +566,18 @@ public class GuiController {
*
* @param strRxTx
*/
private
void
progressDialogue
(
String
strRxTx
)
{
private
void
funkraumProgressDialogue
(
String
strRxTx
)
{
Task
copyWorker
=
createWorker
(
strRxTx
);
ProgressDialog
dialog
=
new
ProgressDialog
(
copyWorker
);
dialog
.
initStyle
(
StageStyle
.
TRANSPARENT
);
dialog
.
setGraphic
(
null
);
dialog
.
initStyle
(
StageStyle
.
TRANSPARENT
);
dialog
.
setTitle
(
"Kommunikation zum Funkraum"
);
if
(
strRxTx
.
equals
(
"rx"
))
{
dialog
.
setContentText
(
"Empfange Nachricht"
);
//dialog.setContentText("Empfange Nachricht");
paneProgress
.
setVisible
(
true
);
}
else
if
(
strRxTx
.
equals
(
"tx"
))
{
dialog
.
setContentText
(
"Sende Nachricht"
);
paneProgress
.
setVisible
(
true
);
//dialog.setContentText("Sende Nachricht");
}
dialog
.
setHeaderText
(
null
);
dialog
.
setGraphic
(
null
);
dialog
.
initStyle
(
StageStyle
.
UTILITY
);
new
Thread
(
copyWorker
).
start
();
dialog
.
showAndWait
();
}
/**
...
...
@@ -619,16 +590,33 @@ public class GuiController {
return
new
Task
()
{
@Override
protected
Object
call
()
throws
Exception
{
if
(
strRxTx
.
equals
(
"rx"
))
{
empfangeneNachricht
=
codierer
.
empfangeNachricht
();
}
else
if
(
strRxTx
.
equals
(
"tx"
))
{
try
{
try
{
if
(
strRxTx
.
equals
(
"rx"
))
{
empfangeneNachricht
=
codierer
.
empfangeNachricht
();
try
{
if
(
empfangeneNachricht
[
2
]
!=
null
&&
empfangeneNachricht
[
1
]
!=
null
)
{
setzeTagesSchluessel
();
tfKlartext
.
setText
(
empfangeneNachricht
[
2
]);
tfCodiert
.
setText
(
empfangeneNachricht
[
1
]);
resetDisplay
=
true
;
// Spruchschluessel in das Feld lblSpruchschluessel schreiben
lblSpruchschluessel
.
setText
(
codierer
.
empfangenerSpruchschluessel
(
empfangeneNachricht
[
2
]));
}
}
catch
(
NullPointerException
ignored
)
{
new
Fehler
().
showErrorDialog
(
"warning"
,
"Keiner schreibt dir..."
,
"Es liegen keine neuen Nachrichten im Funkraum für Sie vor."
);
}
}
else
if
(
strRxTx
.
equals
(
"tx"
))
{
codierer
.
sendeNachricht
();
}
catch
(
HttpException
|
IOException
e
)
{
e
.
printStackTrace
();
}
}
catch
(
HttpException
|
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
paneProgress
.
setVisible
(
false
);
}
return
true
;
}
};
...
...
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