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
AlfaTrainingKurse
Java
Enigma
Commits
217ae4b1
Commit
217ae4b1
authored
5 years ago
by
Jan Schubert
Browse files
Options
Downloads
Patches
Plain Diff
2 Szenen für Kenngruppe und Gui. Stand 3.12. 08:40
parent
a5968a82
No related branches found
No related tags found
1 merge request
!91
Master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/projekt/enigma/App.java
+103
-43
103 additions, 43 deletions
src/main/java/projekt/enigma/App.java
with
103 additions
and
43 deletions
src/main/java/projekt/enigma/App.java
+
103
−
43
View file @
217ae4b1
...
...
@@ -4,7 +4,12 @@ import javafx.application.Application;
import
javafx.fxml.FXMLLoader
;
import
javafx.scene.Parent
;
import
javafx.scene.Scene
;
import
javafx.scene.control.Button
;
import
javafx.scene.control.Label
;
import
javafx.scene.control.TextField
;
import
javafx.scene.layout.VBox
;
import
javafx.stage.Stage
;
import
projekt.enigma.model.Codierer
;
import
java.io.IOException
;
...
...
@@ -13,54 +18,109 @@ import java.io.IOException;
*/
public
class
App
extends
Application
{
/**
* TODO Dokumentieren
*/
private
static
Scene
scene
;
/**
* TODO Dokumentieren
*
* @param fxml
* @throws IOException
*/
static
void
setRoot
(
String
fxml
)
throws
IOException
{
scene
.
setRoot
(
loadFXML
(
fxml
));
}
Scene
sce1
,
sce2
;
@Override
public
void
start
(
Stage
primaryStage
)
throws
IOException
{
Codierer
cod
=
new
Codierer
();
primaryStage
.
setTitle
(
"Kenngruppenabfrage"
);
//Scene 1
Label
label1
=
new
Label
(
"Bitte Kenngruppe eingeben!"
);
label1
.
setTranslateX
(
55
);
Label
l1
=
new
Label
(
""
);
Label
l2
=
new
Label
(
""
);
TextField
tfield
=
new
TextField
();
Button
button1
=
new
Button
(
"Kenngruppe setzen!"
);
VBox
layout1
=
new
VBox
();
// kc.btnGui(primaryStage, sce2);
button1
.
setOnAction
(
e
->
{
if
(
tfield
.
getText
().
length
()
<
9
)
{
for
(
char
c
:
tfield
.
getText
().
toCharArray
())
{
if
(
c
==
'a'
||
c
==
'b'
||
c
==
'c'
||
c
==
'd'
||
c
==
'e'
||
c
==
'f'
||
c
==
'g'
||
c
==
'h'
||
c
==
'i'
||
c
==
'j'
||
c
==
'k'
||
c
==
'l'
||
c
==
'm'
||
c
==
'n'
||
c
==
'o'
||
c
==
'p'
||
c
==
'q'
||
c
==
'r'
||
c
==
's'
||
c
==
't'
||
c
==
'u'
||
c
==
'v'
||
c
==
'w'
||
c
==
'x'
||
c
==
'y'
||
c
==
'z'
||
c
==
'A'
||
c
==
'B'
||
c
==
'C'
||
c
==
'D'
||
c
==
'E'
||
c
==
'F'
||
c
==
'G'
||
c
==
'H'
||
c
==
'I'
||
c
==
'J'
||
c
==
'K'
||
c
==
'L'
||
c
==
'M'
||
c
==
'N'
||
c
==
'O'
||
c
==
'P'
||
c
==
'Q'
||
c
==
'R'
||
c
==
'S'
||
c
==
'T'
||
c
==
'U'
||
c
==
'V'
||
c
==
'W'
||
c
==
'X'
||
c
==
'Y'
||
c
==
'Z'
)
{
cod
.
setKenngruppe
(
tfield
.
getText
());
primaryStage
.
setScene
(
sce2
);
}
}
}
else
{
tfield
.
setStyle
(
"-fx-background-color:#FF0000"
);
tfield
.
setText
(
"Fehlerhafte Kenngruppe!"
);
}
});
layout1
.
getChildren
().
addAll
(
label1
,
l1
,
tfield
,
l2
,
button1
);
//sce1= new Scene(loadFXML("kenngruppe"), 300, 250);
/**
* TODO Dokumentieren
*
* @param fxml
* @return
* @throws IOException
*/
private
static
Parent
loadFXML
(
String
fxml
)
throws
IOException
{
sce1
=
new
Scene
(
layout1
,
234
,
137
);
sce2
=
new
Scene
(
loadFXML
(
"gui"
),
962
,
677
);
primaryStage
.
setScene
(
sce1
);
primaryStage
.
show
();
}
private
static
Parent
loadFXML
(
String
fxml
)
throws
IOException
{
FXMLLoader
fxmlLoader
=
new
FXMLLoader
(
App
.
class
.
getResource
(
fxml
+
".fxml"
));
return
fxmlLoader
.
load
();
}
/**
* TODO Dokumentieren
*
* @param args
*/
public
static
void
main
(
String
[]
args
)
{
Application
.
launch
();
}
/**
* TODO Dokumentieren
*
* @param stage
* @throws IOException
*/
@Override
public
void
start
(
Stage
stage
)
throws
IOException
{
scene
=
new
Scene
(
loadFXML
(
"kenngruppe"
));
stage
.
setScene
(
scene
);
stage
.
setResizable
(
true
);
stage
.
show
();
}
public
static
void
main
(
String
[]
args
)
{
launch
(
args
);
}
// /**
// * TODO Dokumentieren
// */
// private static Scene scene;
// /**
// * TODO Dokumentieren
// *
// * @param fxml
// * @throws IOException
// */
// static void setRoot(String fxml) throws IOException {
// scene.setRoot(loadFXML(fxml));
//
// }
//
// /**
// * TODO Dokumentieren
// *
// * @param fxml
// * @return
// * @throws IOException
// */
// private static Parent loadFXML(String fxml) throws IOException {
// FXMLLoader fxmlLoader = new FXMLLoader(App.class.getResource(fxml + ".fxml"));
// return fxmlLoader.load();
// }
//
// /**
// * TODO Dokumentieren
// *
// * @param args
// */
// public static void main(String[] args) {
// Application.launch();
// }
//
// /**
// * TODO Dokumentieren
// *
// * @param stage
// * @throws IOException
// */
// @Override
// public void start(Stage stage) throws IOException {
// scene = new Scene(loadFXML("kenngruppe"));
// stage.setScene(scene);
// stage.setResizable(true);
// stage.show();
// }
}
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