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
e79395ee
Commit
e79395ee
authored
2 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Feat: Add zipfile handling to GUI controller
parent
8f87e16f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+54
-0
...e/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
with
54 additions
and
0 deletions
+54
-0
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+
54
-
0
View file @
e79395ee
...
...
@@ -12,6 +12,7 @@ import de.hft.stuttgart.citydoctor2.gui.tree.*;
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
javafx.application.Platform
;
import
javafx.scene.chart.XYChart.Data
;
import
javafx.scene.chart.XYChart.Series
;
...
...
@@ -27,6 +28,7 @@ import org.citygml4j.core.model.core.CityModel;
import
org.xml.sax.SAXParseException
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.function.Function
;
...
...
@@ -42,6 +44,7 @@ public class CityDoctorController {
private
CityDoctorModel
model
;
private
ParserConfiguration
currentConfig
;
private
String
sourceFile
;
private
CityGmlZipArchive
zipArchive
;
private
Checker
currentChecker
;
...
...
@@ -82,6 +85,10 @@ public class CityDoctorController {
mainWindow
.
resetSearchBar
();
mainWindow
.
resetFilterComboBox
();
});
if
(
path
.
endsWith
(
".zip"
))
{
loadCityGmlZipFile
(
path
,
numberOfRoundingPlaces
,
l
,
useValidation
,
lowMemory
);
return
;
}
currentChecker
=
null
;
currentConfig
=
new
ParserConfiguration
(
numberOfRoundingPlaces
,
useValidation
,
lowMemory
);
GMLValidationHandler
handler
=
null
;
...
...
@@ -138,6 +145,53 @@ public class CityDoctorController {
}
}
private
void
loadCityGmlZipFile
(
String
path
,
int
numberOfRoundingPlaces
,
ProgressListener
l
,
boolean
useValidation
,
boolean
lowMemory
)
throws
CityGmlParseException
,
InvalidGmlFileException
{
currentChecker
=
null
;
currentConfig
=
new
ParserConfiguration
(
numberOfRoundingPlaces
,
useValidation
,
lowMemory
);
zipArchive
=
CityGmlZipArchive
.
register
(
path
);
Platform
.
runLater
(()
->
{
try
{
ZipEntryPicker
picker
=
new
ZipEntryPicker
(
mainWindow
.
getMainStage
(),
this
);
picker
.
show
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
});
/**
model = CityGmlParser.parseCityGmlFile(path, currentConfig, l, handler, true);
if (!validationIssues.isEmpty()) {
StringJoiner sj = new StringJoiner("\n");
validationIssues.stream().forEach(sj::add);
throw new InvalidGmlFileException(sj.toString());
}
mainWindow.getClickHandler().setConfig(currentConfig);
sourceFile = path;
renderer.reset();
Platform.runLater(() -> {
mainWindow.addFileNameToTitle(path);
mainWindow.getCheckButton().setDisable(false);
mainWindow.getLod1Btn().setDisable(false);
mainWindow.getLod2Btn().setDisable(false);
mainWindow.getLod3Btn().setDisable(false);
mainWindow.getLod4Btn().setDisable(false);
mainWindow.getWorldBtn().setDisable(false);
mainWindow.getSaveBtn().setDisable(false);
mainWindow.getResetCameraBtn().setDisable(false);
mainWindow.getHideRoofBtn().setDisable(false);
mainWindow.getNorthArrow().setVisible(true);
mainWindow.alignNorthArrow();
setupFeatureTabs();
buildTrees();
});
**/
}
public
CityGmlZipArchive
getZipArchive
()
{
return
zipArchive
;
}
private
void
setupFeatureTabs
()
{
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
BUILDING
,
model
.
getBuildings
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
VEGETATION
,
model
.
getVegetation
().
isEmpty
());
...
...
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