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
946bd130
Commit
946bd130
authored
2 months ago
by
Riegel
Browse files
Options
Download
Email Patches
Plain Diff
Feat: Added loading of ZipEntry into MainWindow
parent
9a2130be
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+44
-28
...e/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryPicker.java
+10
-0
...java/de/hft/stuttgart/citydoctor2/gui/ZipEntryPicker.java
with
54 additions
and
28 deletions
+54
-28
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
+
44
-
28
View file @
946bd130
...
...
@@ -148,7 +148,7 @@ 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
);
...
...
@@ -160,33 +160,6 @@ public class CityDoctorController {
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
void
decompressZipEntry
(
CityGmlZipEntry
entry
,
ProgressListener
l
)
{
...
...
@@ -197,6 +170,49 @@ public class CityDoctorController {
return
zipArchive
;
}
public
void
loadZipEntry
(
CityGmlZipEntry
entry
)
{
if
(!
entry
.
isDecompressed
())
{
entry
.
loadEntry
(
currentConfig
);
}
if
(
entry
.
getErrorType
()
!=
null
)
{
throw
new
IllegalArgumentException
(
"Attempted to load erroneous zip entry"
);
}
try
{
Platform
.
runLater
(()
->
{
mainWindow
.
getOpenBtn
().
setDisable
(
true
);
mainWindow
.
getWriteReportButton
().
setDisable
(
true
);
mainWindow
.
getMeshGroup
().
getChildren
().
clear
();
clearTrees
();
mainWindow
.
resetSearchBar
();
mainWindow
.
resetFilterComboBox
();
});
currentChecker
=
null
;
model
=
entry
.
getModel
();
mainWindow
.
getClickHandler
().
setConfig
(
currentConfig
);
sourceFile
=
entry
.
getArchive
().
getArchivePath
().
toString
();
renderer
.
reset
();
Platform
.
runLater
(()
->
{
mainWindow
.
addFileNameToTitle
(
entry
.
getArchive
().
getArchivePath
().
toString
());
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
();
});
}
finally
{
Platform
.
runLater
(()
->
mainWindow
.
getOpenBtn
().
setDisable
(
false
));
}
}
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.
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryPicker.java
+
10
-
0
View file @
946bd130
...
...
@@ -170,6 +170,16 @@ public class ZipEntryPicker {
loadBtn
.
setOnAction
(
e
->
{
disableTaskButtons
();
CityGmlZipEntry
entry
=
entryList
.
getSelectionModel
().
getSelectedItem
().
getEntry
();
if
(
entry
.
getErrorType
()
!=
null
)
{
/**
* Button is disabled when an erroneous entry gets selected.
* Silently fail in case an erroneous entry is somehow selected on Action.
*/
logger
.
debug
(
"IllegalState: loadBtn was pressed while an erroneous entry was selected"
);
return
;
}
controller
.
loadZipEntry
(
entry
);
stage
.
hide
();
});
...
...
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