Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
twi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maria Barbatei
twi
Commits
4ba271d1
Commit
4ba271d1
authored
May 30, 2016
by
Aljoscha Niazi-Shahabi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Methode zum Erstellen des JSON Strings in die GUI Klasse eingefügt
parent
9ae05d55
Pipeline
#2948
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
3 deletions
+33
-3
Sandbox/TWI.gruppe2/src/main/java/uebung7/fin/gui/Uebung7GUI1.java
...WI.gruppe2/src/main/java/uebung7/fin/gui/Uebung7GUI1.java
+33
-3
No files found.
Sandbox/TWI.gruppe2/src/main/java/uebung7/fin/gui/Uebung7GUI1.java
View file @
4ba271d1
...
@@ -345,7 +345,7 @@ public class Uebung7GUI1 extends Application {
...
@@ -345,7 +345,7 @@ public class Uebung7GUI1 extends Application {
FileWriter
fileWriter
=
new
FileWriter
(
file
);
FileWriter
fileWriter
=
new
FileWriter
(
file
);
// TEST STRING!
// TEST STRING!
String
content
=
"GET JSON STRING VOM BACKEND_____"
;
String
content
=
getJsonString
()
;
fileWriter
.
write
(
content
);
fileWriter
.
write
(
content
);
fileWriter
.
close
();
fileWriter
.
close
();
...
@@ -382,8 +382,7 @@ public class Uebung7GUI1 extends Application {
...
@@ -382,8 +382,7 @@ public class Uebung7GUI1 extends Application {
TreeItem
<
String
>
item
=
new
TreeItem
<>(
title
);
TreeItem
<
String
>
item
=
new
TreeItem
<>(
title
);
item
.
setExpanded
(
false
);
item
.
setExpanded
(
false
);
tmpTreeItem
.
getChildren
().
add
(
item
);
tmpTreeItem
.
getChildren
().
add
(
item
);
}
}
/**
/**
...
@@ -399,5 +398,36 @@ public class Uebung7GUI1 extends Application {
...
@@ -399,5 +398,36 @@ public class Uebung7GUI1 extends Application {
makeBranch
(
"ICD-Code: "
+
icdCode
);
makeBranch
(
"ICD-Code: "
+
icdCode
);
}
}
private
static
String
getJsonString
()
{
String
s
=
"{\"Diagnosen\":[\n"
;
for
(
int
i
=
0
;
tree
.
getTreeItem
(
i
)
!=
null
;
i
++)
{
s
=
s
+
"\t{\"Name\":\""
+
tree
.
getTreeItem
(
i
).
getValue
()
+
"\", "
;
for
(
int
j
=
0
;
j
<
tree
.
getTreeItem
(
i
).
getChildren
().
size
();
j
++)
{
if
(
tree
.
getTreeItem
(
i
).
getChildren
().
get
(
j
).
getValue
().
startsWith
(
"ICD-Code"
))
{
s
=
s
+
"\"ICD-Code\":\""
+
tree
.
getTreeItem
(
i
).
getChildren
().
get
(
j
).
getValue
().
substring
(
10
)
+
"\""
;
}
if
(
tree
.
getTreeItem
(
i
).
getChildren
().
get
(
j
).
getValue
().
startsWith
(
"Alpha-ID"
))
{
s
=
s
+
"\"Alpha-ID\":\""
+
tree
.
getTreeItem
(
i
).
getChildren
().
get
(
j
).
getValue
().
substring
(
10
)
+
"\", "
;
}
}
s
=
s
+
"}\n"
;
}
s
=
s
+
"\n]}"
;
return
s
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment