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
54673522
Commit
54673522
authored
2 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Feat: Implement ZipEntry decompression
parent
d08f1781
master
dev
dev_gui_features_zip_loading
3.17.0
archive/dev_gui_features_zip_loading
2 merge requests
!28
Version 3.17.0 Release
,
!26
Add ZIP-archive support
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+5
-0
...e/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryPicker.java
+38
-9
...java/de/hft/stuttgart/citydoctor2/gui/ZipEntryPicker.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/tree/ZipEntryListCell.java
+1
-0
.../hft/stuttgart/citydoctor2/gui/tree/ZipEntryListCell.java
with
44 additions
and
9 deletions
+44
-9
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+
5
-
0
View file @
54673522
...
...
@@ -13,6 +13,7 @@ import de.hft.stuttgart.citydoctor2.mapper.citygml3.GMLValidationHandler;
import
de.hft.stuttgart.citydoctor2.parser.*
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipArchive
;
import
de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry
;
import
javafx.application.Platform
;
import
javafx.scene.chart.XYChart.Data
;
import
javafx.scene.chart.XYChart.Series
;
...
...
@@ -188,6 +189,10 @@ public class CityDoctorController {
**/
}
public
void
decompressZipEntry
(
CityGmlZipEntry
entry
)
{
entry
.
loadEntry
(
currentConfig
);
}
public
CityGmlZipArchive
getZipArchive
()
{
return
zipArchive
;
}
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryPicker.java
+
38
-
9
View file @
54673522
...
...
@@ -28,6 +28,7 @@ import org.apache.logging.log4j.LogManager;
import
org.apache.logging.log4j.Logger
;
import
java.io.IOException
;
import
java.io.InputStream
;
public
class
ZipEntryPicker
{
...
...
@@ -77,13 +78,14 @@ public class ZipEntryPicker {
@FXML
private
Button
decompressBtn
;
@FXML
private
Button
decompressImageView
;
private
ImageView
decompressImageView
;
@FXML
private
ListView
<
ZipEntryNode
>
entryList
;
private
CityDoctorController
controller
;
private
String
unknownValueText
=
Localization
.
getText
(
"ZipEntryPicker.unknownValue"
);
public
ZipEntryPicker
(
Window
parent
,
CityDoctorController
controller
)
throws
IOException
{
...
...
@@ -106,22 +108,45 @@ public class ZipEntryPicker {
entryList
.
getSelectionModel
().
selectedItemProperty
().
addListener
((
obs
,
oldI
,
newI
)
->
{
if
(
newI
!=
null
)
{
showMetadata
(
newI
.
getEntry
());
// Disable loadBtn when entry is erroneous
loadBtn
.
setDisable
(
newI
.
getEntry
().
getErrorType
()
!=
null
);
}
});
cancelBtn
.
setOnAction
(
e
->
stage
.
close
());
loadBtn
.
setOnAction
(
e
->
{
CityGmlZipEntry
entry
=
entryList
.
getSelectionModel
().
getSelectedItem
().
getEntry
();
});
}
public
void
initialize
()
{
setupButtons
();
applyLocalization
();
populateZipEntryList
();
}
private
void
setupButtons
()
{
try
{
try
(
InputStream
inStream
=
MainWindow
.
class
.
getResourceAsStream
(
"icons/decompress_zipEntry.png"
))
{
Image
img
=
new
Image
(
inStream
);
decompressImageView
.
setImage
(
img
);
}
try
(
InputStream
inStream
=
MainWindow
.
class
.
getResourceAsStream
(
"icons/load_zipEntry.png"
))
{
Image
img
=
new
Image
(
inStream
);
loadImageView
.
setImage
(
img
);
}
}
catch
(
IOException
ignored
)
{
//ignore exceptions
}
decompressBtn
.
setOnAction
(
e
->
{
CityGmlZipEntry
entry
=
entryList
.
getSelectionModel
().
getSelectedItem
().
getEntry
();
controller
.
decompressZipEntry
(
entry
);
populateZipEntryList
(
entryList
.
getSelectionModel
().
getSelectedIndex
());
});
loadBtn
.
setOnAction
(
e
->
{
CityGmlZipEntry
entry
=
entryList
.
getSelectionModel
().
getSelectedItem
().
getEntry
();
});
cancelBtn
.
setOnAction
(
e
->
stage
.
close
());
}
private
void
applyLocalization
()
{
entriesPane
.
setText
(
Localization
.
getText
(
"ZipEntryPicker.entryListTitle"
));
metadataPane
.
setText
(
Localization
.
getText
(
"ZipEntryPicker.metadata"
));
...
...
@@ -178,13 +203,17 @@ public class ZipEntryPicker {
}
else
{
filesizeValue
.
setText
(
unknownValueText
);
}
if
(
entry
.
getErrorType
()
!=
null
)
{
erroneousValue
.
setText
(
getErrorText
(
entry
.
getErrorType
()));
validatedValue
.
setText
(
unknownValueText
);
objectCountValue
.
setText
(
unknownValueText
);
loadBtn
.
setDisable
(
true
);
decompressBtn
.
setDisable
(
true
);
}
else
{
erroneousValue
.
setText
(
Localization
.
getText
(
"ZipEntryPicker.no"
));
loadBtn
.
setDisable
(!
entry
.
isDecompressed
());
decompressBtn
.
setDisable
(
entry
.
isDecompressed
());
if
(
entry
.
getModel
()
==
null
)
{
validatedValue
.
setText
(
unknownValueText
);
objectCountValue
.
setText
(
unknownValueText
);
...
...
This diff is collapsed.
Click to expand it.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/tree/ZipEntryListCell.java
+
1
-
0
View file @
54673522
...
...
@@ -9,6 +9,7 @@ public class ZipEntryListCell extends ListCell<ZipEntryNode> {
super
.
updateItem
(
item
,
empty
);
if
(!
empty
||
item
!=
null
)
{
setText
(
item
.
getText
());
updateColor
();
}
else
{
setText
(
null
);
}
...
...
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