Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
2f90e7f0
Commit
2f90e7f0
authored
Jan 27, 2025
by
Riegel
Browse files
Style: Cleanup code
parent
5eab063f
Pipeline
#10968
passed with stage
in 1 minute and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
View file @
2f90e7f0
...
...
@@ -116,7 +116,12 @@ public class ZipEntryManager {
private
int
currentlyLoadedEntry
=
-
1
;
private
CheckDialog
dialog
;
private
String
unknownValueText
=
Localization
.
getText
(
"ZipEntryManager.unknownValue"
);
private
final
String
unknownValueText
=
Localization
.
getText
(
"ZipEntryManager.unknownValue"
);
private
static
final
Predicate
<
ZipEntryNode
>
entryDecompressed
=
node
->
(
node
.
getEntry
().
isDecompressed
()
||
node
.
getEntry
().
getErrorType
()
!=
null
);
private
static
final
Predicate
<
ZipEntryNode
>
entryValidated
=
entryDecompressed
.
and
(
node
->
(
node
.
getEntry
().
getModel
()
!=
null
&&
node
.
getEntry
().
getModel
().
isValidated
()));
public
ZipEntryManager
(
Window
parent
,
CityDoctorController
controller
)
throws
IOException
{
FXMLLoader
loader
=
new
FXMLLoader
(
ZipEntryManager
.
class
.
getResource
(
"ZipEntryManager.fxml"
));
...
...
@@ -192,7 +197,7 @@ public class ZipEntryManager {
Platform
.
runLater
(()
->
progress
.
setProgress
(
progressValue
))
);
Platform
.
runLater
(()
->
{
populateZipEntryList
(
entryList
.
getSelectionModel
().
getSelectedIndex
()
);
refresh
(
);
progress
.
setProgress
(
0
);
setEntryListLocked
(
false
);
});
...
...
@@ -250,7 +255,7 @@ public class ZipEntryManager {
}
Platform
.
runLater
(()
->
{
subProgress
.
setVisible
(
false
);
populateZipEntryList
(
entryList
.
getSelectionModel
().
getSelectedIndex
()
);
refresh
(
);
progress
.
setProgress
(
0
);
setEntryListLocked
(
false
);
});
...
...
@@ -344,9 +349,8 @@ public class ZipEntryManager {
entryList
.
getSelectionModel
().
clearSelection
();
entryList
.
getSelectionModel
().
select
(
selectionIndex
);
showMetadata
(
entryList
.
getSelectionModel
().
getSelectedItem
().
getEntry
());
Predicate
<
ZipEntryNode
>
allEntriesDecompressed
=
node
->
(
node
.
getEntry
().
isDecompressed
()
||
node
.
getEntry
().
getErrorType
()
!=
null
);
decompressAllBtn
.
setDisable
(
entryList
.
getItems
().
stream
().
allMatch
(
allEntriesDecompressed
));
saveBtn
.
setDisable
(
entryList
.
getItems
().
stream
().
allMatch
(
Predicate
.
not
(
allEntriesDecompressed
)));
decompressAllBtn
.
setDisable
(
entryList
.
getItems
().
stream
().
allMatch
(
entryDecompressed
));
saveBtn
.
setDisable
(
entryList
.
getItems
().
stream
().
noneMatch
(
entryValidated
));
}
private
void
showMetadata
(
CityGmlZipEntry
entry
)
{
...
...
@@ -403,6 +407,8 @@ public class ZipEntryManager {
decompressBtn
.
setDisable
(
true
);
loadBtn
.
setDisable
(
true
);
decompressAllBtn
.
setDisable
(
true
);
showReportBtn
.
setDisable
(
true
);
saveBtn
.
setDisable
(
true
);
}
public
void
refresh
()
{
...
...
@@ -429,9 +435,7 @@ public class ZipEntryManager {
}
public
void
show
()
{
Platform
.
runLater
(()
->
{
stage
.
showAndWait
();
});
populateZipEntryList
(
entryList
.
getSelectionModel
().
getSelectedIndex
());
Platform
.
runLater
(()
->
stage
.
showAndWait
());
refresh
();
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment