Small error handling

This commit is contained in:
Douglas Gillespie 2023-12-17 12:52:06 +00:00
parent 2e29e9cd95
commit c3edae516b
4 changed files with 19 additions and 13 deletions

View File

@ -603,7 +603,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
fileMenu.add(menuItem); fileMenu.add(menuItem);
} }
if (SMRUEnable.isEnable()) { // if (SMRUEnable.isEnable()) {
menuItem = new JMenuItem("Import PAMGuard Modules"); menuItem = new JMenuItem("Import PAMGuard Modules");
menuItem.setToolTipText("Import module settings from a different PAMGuard configuration (psfx files only"); menuItem.setToolTipText("Import module settings from a different PAMGuard configuration (psfx files only");
menuItem.addActionListener(new ActionListener() { menuItem.addActionListener(new ActionListener() {
@ -613,7 +613,7 @@ public class PamGui extends PamView implements WindowListener, PamSettings {
} }
}); });
fileMenu.add(menuItem); fileMenu.add(menuItem);
} // }
fileMenu.addSeparator(); fileMenu.addSeparator();

View File

@ -92,11 +92,17 @@ public class PamguardMetaData implements Serializable {
* @return the deploymentWrapper * @return the deploymentWrapper
*/ */
public NilusSettingsWrapper<Deployment> getDeploymentWrapper() { public NilusSettingsWrapper<Deployment> getDeploymentWrapper() {
if (deploymentWrapper == null) {
deploymentWrapper = new NilusSettingsWrapper<>();
}
return deploymentWrapper; return deploymentWrapper;
} }
public void checkSerialisation() { public void checkSerialisation() {
// check that all wrappers have their xml up to date. // check that all wrappers have their xml up to date.
if (deploymentWrapper == null) {
deploymentWrapper = new NilusSettingsWrapper<>();
}
deploymentWrapper.reSerialise(); deploymentWrapper.reSerialise();
} }

View File

@ -206,7 +206,7 @@ public class DBXMLQueries {
result = queries.QueryTethys(xQuery); result = queries.QueryTethys(xQuery);
} }
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} }
if (result == null) { if (result == null) {
return null; return null;

View File

@ -74,7 +74,7 @@ public class NilusSettingsWrapper<T extends Object> implements Serializable, Clo
} }
/** /**
* Set the nilus object. This marshals the nilus object * Set the nilus object. This marshals the nilus object
* into xml and saves the data as an intetnal xml string which * into xml and saves the data as an internal xml string which
* can be safely serialized. * can be safely serialized.
* @param nilusObject nilus object. * @param nilusObject nilus object.
* @return true if it was marshalled OK. * @return true if it was marshalled OK.