From eac9329a58147a3a0acf6869fd1b337a3060538b Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Wed, 10 Jun 2020 12:54:53 -0600 Subject: [PATCH] Modify visibility for several classes, add some missing javadoc Signed-off-by: Taylor Smock --- .../ReplacementPreferenceTable.java | 7 ++++--- .../mapwithai/AddMapWithAIDialog.java | 2 +- .../mapwithai/AddMapWithAIPanel.java | 2 +- .../MapWithAIDefaultLayerTableModel.java | 2 +- .../mapwithai/MapWithAILayerTableModel.java | 2 +- .../mapwithai/MapWithAIParametersPanel.java | 18 ++++++++++++++++-- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/ReplacementPreferenceTable.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/ReplacementPreferenceTable.java index b47492f..062bbe2 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/ReplacementPreferenceTable.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/ReplacementPreferenceTable.java @@ -22,9 +22,10 @@ import org.openstreetmap.josm.tools.GBC; /** * @author Taylor Smock */ -public class ReplacementPreferenceTable extends PreferencesTable { - private static final long serialVersionUID = 8057277761625324262L; - +class ReplacementPreferenceTable extends PreferencesTable { + /** + * @param displayData The initial preference entries to display + */ public ReplacementPreferenceTable(List displayData) { super(displayData); } diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIDialog.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIDialog.java index 8dfd9c4..994aa09 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIDialog.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIDialog.java @@ -15,7 +15,7 @@ import org.openstreetmap.josm.gui.util.WindowGeometry; * Dialog shown to add a new source from preferences. * */ -public class AddMapWithAIDialog extends ExtendedDialog implements ContentValidationListener { +class AddMapWithAIDialog extends ExtendedDialog implements ContentValidationListener { private static final long serialVersionUID = 7513676077181970148L; /** diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIPanel.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIPanel.java index 857782e..f577a38 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIPanel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/AddMapWithAIPanel.java @@ -44,7 +44,7 @@ import org.openstreetmap.josm.tools.Pair; /** * An panel used to add MapWithAI sources. */ -public class AddMapWithAIPanel extends JPanel { +class AddMapWithAIPanel extends JPanel { private static final long serialVersionUID = -2838267045934203122L; private final transient JPanel layerPanel = new JPanel(new GridBagLayout()); diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIDefaultLayerTableModel.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIDefaultLayerTableModel.java index 506a65d..42ef032 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIDefaultLayerTableModel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIDefaultLayerTableModel.java @@ -21,7 +21,7 @@ import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAILayerInf /** * The table model for the default imagery layer list */ -public class MapWithAIDefaultLayerTableModel extends DefaultTableModel { +class MapWithAIDefaultLayerTableModel extends DefaultTableModel { private static final long serialVersionUID = -2966437364160797385L; private final List> columnTypes; private final transient List> columnDataRetrieval; diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAILayerTableModel.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAILayerTableModel.java index 4eaf52b..8c26e7d 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAILayerTableModel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAILayerTableModel.java @@ -11,7 +11,7 @@ import org.openstreetmap.josm.plugins.mapwithai.data.mapwithai.MapWithAILayerInf /** * The table model for source layer list */ -public class MapWithAILayerTableModel extends DefaultTableModel { +class MapWithAILayerTableModel extends DefaultTableModel { private static final long serialVersionUID = 60378230494588007L; /** diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIParametersPanel.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIParametersPanel.java index 9fab7fa..7d9247a 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIParametersPanel.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/preferences/mapwithai/MapWithAIParametersPanel.java @@ -24,7 +24,13 @@ import javax.swing.table.TableModel; import org.openstreetmap.josm.tools.GBC; import org.openstreetmap.josm.tools.Pair; -public class MapWithAIParametersPanel extends JPanel { +/** + * Parameters panel for adding MapWithAI URLs + * + * @author Taylor Smock + * + */ +class MapWithAIParametersPanel extends JPanel { private final class ParametersTableModel extends AbstractTableModel { private final Set disabledRows = new HashSet<>(); @@ -149,6 +155,9 @@ public class MapWithAIParametersPanel extends JPanel { .collect(Collectors.toMap(x -> (String) x[0], x -> new Pair<>((String) x[1], (Boolean) x[2]))); } + /** + * @param parameters The initial parameters to show in the dialog + */ public void setParameters(JsonArray parameters) { int i = 0; for (JsonObject obj : parameters.stream().filter(JsonObject.class::isInstance).map(JsonObject.class::cast) @@ -165,12 +174,17 @@ public class MapWithAIParametersPanel extends JPanel { model.fireTableDataChanged(); } + /** + * @param l A TableModelListener for the backing model + */ public void addListener(TableModelListener l) { model.addTableModelListener(l); } + /** + * @return The table model used to display parameters + */ public TableModel getModel() { return model; } - }