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
05215a4c
Commit
05215a4c
authored
Jan 14, 2025
by
Riegel
Browse files
Feat: Implement directoryChooser for ZIP stream check
parent
69a56720
Changes
2
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java
View file @
05215a4c
...
...
@@ -17,6 +17,7 @@ import javafx.scene.control.Alert;
import
javafx.scene.control.CheckBox
;
import
javafx.scene.control.ProgressIndicator
;
import
javafx.scene.control.Tooltip
;
import
javafx.stage.DirectoryChooser
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -293,6 +294,11 @@ public class CheckDialog {
}
});
outputPathBtn
.
setOnAction
(
e
->
{
DirectoryChooser
directoryChooser
=
new
DirectoryChooser
();
outputPathTextField
.
setText
(
directoryChooser
.
showDialog
(
stage
.
getOwner
()).
getAbsolutePath
());
});
streamCheckOption
.
setText
(
Localization
.
getText
(
"CheckDialog.streamCheckOption"
));
streamCheckLabel
.
setTooltip
(
new
Tooltip
(
Localization
.
getText
(
"CheckDialog.streamCheckLabel"
)));
outputPathLabel
.
setText
(
Localization
.
getText
(
"CheckDialog.outputPathLabel"
));
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
View file @
05215a4c
...
...
@@ -25,6 +25,7 @@ import javafx.scene.control.TreeItem;
import
javafx.scene.control.TreeView
;
import
javafx.stage.FileChooser
;
import
javafx.stage.FileChooser.ExtensionFilter
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.citygml4j.core.model.core.CityModel
;
...
...
@@ -971,8 +972,34 @@ public class CityDoctorController {
}
private
void
startZipFileCheckStream
(
ValidationConfiguration
c
onfig
,
Path
outputPath
,
boolean
pdfReports
,
private
void
startZipFileCheckStream
(
ValidationConfiguration
valC
onfig
,
Path
outputPath
,
boolean
pdfReports
,
boolean
xmlReports
)
{
try
{
Path
outputZipDirectory
=
null
;
if
(
outputPath
.
toFile
().
isDirectory
())
{
String
filename
=
FilenameUtils
.
removeExtension
(
zipArchive
.
getArchivePath
().
getFileName
().
toString
());
filename
=
filename
+
"_validated"
;
outputZipDirectory
=
outputPath
.
resolve
(
filename
);
}
else
{
String
filename
=
FilenameUtils
.
removeExtension
(
outputPath
.
toAbsolutePath
().
getFileName
().
toString
());
outputZipDirectory
=
Path
.
of
(
filename
);
}
String
xmlReportsDirectory
=
null
;
String
pdfReportsDirectory
=
null
;
if
(
pdfReports
)
{
pdfReportsDirectory
=
outputZipDirectory
.
resolve
(
"pdf_reports"
).
toAbsolutePath
().
toString
();
}
if
(
xmlReports
)
{
xmlReportsDirectory
=
outputZipDirectory
.
resolve
(
"xml_reports"
).
toAbsolutePath
().
toString
();
}
Checker
.
streamCheck
(
zipArchive
,
xmlReportsDirectory
,
pdfReportsDirectory
,
valConfig
,
outputZipDirectory
.
toString
());
}
catch
(
CityGmlParseException
e
)
{
throw
new
RuntimeException
(
e
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
...
...
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