From: gmungoc Date: Fri, 29 May 2015 13:56:36 +0000 (+0100) Subject: JAL-1753 declare field with interface type; check for null dereference X-Git-Tag: Release_2_10_0~650^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6746132759f6de25a29c113c724e805d114c9c1d;p=jalview.git JAL-1753 declare field with interface type; check for null dereference --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index c659233..1b228d6 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -870,12 +870,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, updateEditMenuBar(); } - // methods for implementing IProgressIndicator - // need to refactor to a reusable stub class - // Map progressBars; - // - // Map progressBarHandlers; - private ProgressBar progressBar; + private IProgressIndicator progressBar; /* * (non-Javadoc) diff --git a/src/jalview/gui/PCAPanel.java b/src/jalview/gui/PCAPanel.java index cff9104..f4fd70b 100644 --- a/src/jalview/gui/PCAPanel.java +++ b/src/jalview/gui/PCAPanel.java @@ -58,7 +58,7 @@ public class PCAPanel extends GPCAPanel implements Runnable, IProgressIndicator { - private ProgressBar progressBar; + private IProgressIndicator progressBar; RotatableCanvas rc; diff --git a/src/jalview/gui/ProgressBar.java b/src/jalview/gui/ProgressBar.java index 8ebc98d..5307f26 100644 --- a/src/jalview/gui/ProgressBar.java +++ b/src/jalview/gui/ProgressBar.java @@ -1,6 +1,7 @@ package jalview.gui; import java.awt.BorderLayout; +import java.awt.Component; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -148,7 +149,11 @@ public class ProgressBar implements IProgressIndicator /* * lay out progress bar container hierarchy */ - SwingUtilities.getRoot(statusPanel).validate(); + Component root = SwingUtilities.getRoot(statusPanel); + if (root != null) + { + root.validate(); + } } /** diff --git a/src/jalview/gui/WebserviceInfo.java b/src/jalview/gui/WebserviceInfo.java index f530018..8e78b93 100644 --- a/src/jalview/gui/WebserviceInfo.java +++ b/src/jalview/gui/WebserviceInfo.java @@ -92,7 +92,7 @@ public class WebserviceInfo extends GWebserviceInfo implements JInternalFrame frame; - private ProgressBar progressBar; + private IProgressIndicator progressBar; @Override public void setVisible(boolean aFlag)