Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
f123a7ac
Commit
f123a7ac
authored
2 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Refactor: Add locking of entryList during operations
parent
cdbfb988
master
dev
dev_gui_features_zip_loading
archive/dev_gui_features_zip_loading
2 merge requests
!28
Version 3.17.0 Release
,
!26
Add ZIP-archive support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
+13
-4
...ava/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
with
13 additions
and
4 deletions
+13
-4
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java
+
13
-
4
View file @
f123a7ac
...
...
@@ -150,6 +150,7 @@ public class ZipEntryManager {
decompressBtn
.
setOnAction
(
e
->
{
disableTaskButtons
();
setEntryListLocked
(
true
);
Thread
t
=
new
Thread
(()
->
{
CityGmlZipEntry
entry
=
entryList
.
getSelectionModel
().
getSelectedItem
().
getEntry
();
logger
.
info
(
"Decompressing entry \"{}\""
,
entry
.
getDisplayName
());
...
...
@@ -158,6 +159,8 @@ public class ZipEntryManager {
);
Platform
.
runLater
(()
->
{
populateZipEntryList
(
entryList
.
getSelectionModel
().
getSelectedIndex
());
progress
.
setProgress
(
0
);
setEntryListLocked
(
false
);
});
});
t
.
setDaemon
(
true
);
...
...
@@ -167,8 +170,7 @@ public class ZipEntryManager {
loadBtn
.
setOnAction
(
e
->
{
disableTaskButtons
();
entryList
.
setMouseTransparent
(
true
);
entryList
.
setFocusTraversable
(
false
);
setEntryListLocked
(
true
);
try
{
int
selectedIndex
=
entryList
.
getSelectionModel
().
getSelectedIndex
();
if
(
selectedIndex
==
currentlyLoadedEntry
)
{
...
...
@@ -189,14 +191,14 @@ public class ZipEntryManager {
currentlyLoadedEntry
=
selectedIndex
;
stage
.
hide
();
}
finally
{
entryList
.
setMouseTransparent
(
false
);
entryList
.
setFocusTraversable
(
true
);
setEntryListLocked
(
false
);
}
});
decompressAllBtn
.
setOnAction
(
e
->
{
disableTaskButtons
();
setEntryListLocked
(
true
);
subProgress
.
setVisible
(
true
);
subProgress
.
setProgress
(
0
);
Thread
t
=
new
Thread
(()
->
{
...
...
@@ -215,6 +217,8 @@ public class ZipEntryManager {
Platform
.
runLater
(()
->
{
subProgress
.
setVisible
(
false
);
populateZipEntryList
(
entryList
.
getSelectionModel
().
getSelectedIndex
());
progress
.
setProgress
(
0
);
setEntryListLocked
(
false
);
});
});
t
.
setDaemon
(
true
);
...
...
@@ -329,6 +333,11 @@ public class ZipEntryManager {
}
}
private
void
setEntryListLocked
(
boolean
locked
)
{
entryList
.
setMouseTransparent
(
locked
);
entryList
.
setFocusTraversable
(!
locked
);
}
public
void
show
()
{
Platform
.
runLater
(()
->
{
stage
.
showAndWait
();
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets