From 30f13b065f7738c72be40b27d34d7004c4cf912a Mon Sep 17 00:00:00 2001 From: Riegel <alexander.riegel@hft-stuttgart.de> Date: Mon, 17 Feb 2025 10:44:38 +0100 Subject: [PATCH] Docs: Add Javadoc --- .../hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java | 4 ++-- .../citydoctor2/zip/MalformedZipFileException.java | 3 +++ .../java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java | 5 +++++ .../de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java | 7 +++---- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java index e8c8aac..3bf82fe 100644 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java +++ b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/CityGmlZipEntryFile.java @@ -42,7 +42,7 @@ public class CityGmlZipEntryFile implements AutoCloseable { */ public InputStream getInputStream() throws IOException { if (closed){ - throw new IOException("Stream closed"); + throw new IOException("CityGmlZipEntryFile closed"); } return zip.getInputStream(zipEntry); } @@ -54,7 +54,7 @@ public class CityGmlZipEntryFile implements AutoCloseable { */ public long getFileSize() throws IOException { if (closed){ - throw new IOException("Stream closed"); + throw new IOException("CityGmlZipEntryFile closed"); } if (cgmlZipEntry.getFileSize() == -1L) { if (zipEntry.getSize() == -1) { diff --git a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/MalformedZipFileException.java b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/MalformedZipFileException.java index c02f6c0..759fbe6 100644 --- a/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/MalformedZipFileException.java +++ b/CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/zip/MalformedZipFileException.java @@ -2,6 +2,9 @@ package de.hft.stuttgart.citydoctor2.zip; import java.util.zip.ZipException; +/** + * Signals that a ZIP-file is corrupted and couldn't be parsed. + */ public class MalformedZipFileException extends ZipException { public MalformedZipFileException() { diff --git a/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java b/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java index 576b782..23ae627 100644 --- a/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java +++ b/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CheckDialog.java @@ -316,6 +316,11 @@ public class CheckDialog { showZipArchiveOptions(false); } + /** + * Shows the option panel for ZIP-Archive checking and enables the ZIP-Archive checking mode for this dialog. + * + * @param enabled + */ public void showZipArchiveOptions(boolean enabled) { zipArchiveOptionsVBox.setDisable(!enabled); zipArchiveOptionsVBox.setVisible(enabled); diff --git a/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java b/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java index fd8abee..2429a5f 100644 --- a/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java +++ b/CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/ZipEntryManager.java @@ -34,6 +34,9 @@ import java.io.IOException; import java.io.InputStream; import java.util.function.Predicate; +/** + * This class implements a GUI for managing a loaded {@link CityGmlZipArchive} in CityDoctor. + */ public class ZipEntryManager { private static final Logger logger = LogManager.getLogger(ZipEntryManager.class); @@ -217,10 +220,6 @@ public class ZipEntryManager { } CityGmlZipEntry entry = entryList.getSelectionModel().getSelectedItem().getEntry(); if (entry.getErrorType() != null) { - /** - * Button should be 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"); populateZipEntryList(selectedIndex); return; -- GitLab