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
Michael
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
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
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;
...
@@ -4,7 +4,12 @@ import javafx.application.Application;
import
javafx.fxml.FXMLLoader
;
import
javafx.fxml.FXMLLoader
;
import
javafx.scene.Parent
;
import
javafx.scene.Parent
;
import
javafx.scene.Scene
;
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
javafx.stage.Stage
;
import
projekt.enigma.model.Codierer
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -13,54 +18,109 @@ import java.io.IOException;
...
@@ -13,54 +18,109 @@ import java.io.IOException;
*/
*/
public
class
App
extends
Application
{
public
class
App
extends
Application
{
/**
Scene
sce1
,
sce2
;
* TODO Dokumentieren
*/
@Override
private
static
Scene
scene
;
public
void
start
(
Stage
primaryStage
)
throws
IOException
{
/**
Codierer
cod
=
new
Codierer
();
* TODO Dokumentieren
*
primaryStage
.
setTitle
(
"Kenngruppenabfrage"
);
* @param fxml
* @throws IOException
//Scene 1
*/
Label
label1
=
new
Label
(
"Bitte Kenngruppe eingeben!"
);
static
void
setRoot
(
String
fxml
)
throws
IOException
{
label1
.
setTranslateX
(
55
);
scene
.
setRoot
(
loadFXML
(
fxml
));
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);
/**
sce1
=
new
Scene
(
layout1
,
234
,
137
);
* TODO Dokumentieren
*
sce2
=
new
Scene
(
loadFXML
(
"gui"
),
962
,
677
);
* @param fxml
* @return
primaryStage
.
setScene
(
sce1
);
* @throws IOException
primaryStage
.
show
();
*/
}
private
static
Parent
loadFXML
(
String
fxml
)
throws
IOException
{
private
static
Parent
loadFXML
(
String
fxml
)
throws
IOException
{
FXMLLoader
fxmlLoader
=
new
FXMLLoader
(
App
.
class
.
getResource
(
fxml
+
".fxml"
));
FXMLLoader
fxmlLoader
=
new
FXMLLoader
(
App
.
class
.
getResource
(
fxml
+
".fxml"
));
return
fxmlLoader
.
load
();
return
fxmlLoader
.
load
();
}
}
/**
* TODO Dokumentieren
*
* @param args
*/
public
static
void
main
(
String
[]
args
)
{
Application
.
launch
();
}
/**
public
static
void
main
(
String
[]
args
)
{
* TODO Dokumentieren
launch
(
args
);
*
}
* @param stage
* @throws IOException
*/
// /**
@Override
// * TODO Dokumentieren
public
void
start
(
Stage
stage
)
throws
IOException
{
// */
scene
=
new
Scene
(
loadFXML
(
"kenngruppe"
));
// private static Scene scene;
stage
.
setScene
(
scene
);
// /**
stage
.
setResizable
(
true
);
// * TODO Dokumentieren
stage
.
show
();
// *
}
// * @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