JAL-1767 unit test for save and restore PCA
[jalview.git] / src / jalview / gui / PCAPanel.java
index f0ba274..5ff0881 100644 (file)
@@ -162,6 +162,7 @@ public class PCAPanel extends GPCAPanel
   @Override
   public void run()
   {
+    working = true;
     long progId = System.currentTimeMillis();
     IProgressIndicator progress = this;
     String message = MessageManager.getString("label.pca_recalculating");
@@ -171,7 +172,6 @@ public class PCAPanel extends GPCAPanel
       message = MessageManager.getString("label.pca_calculating");
     }
     progress.setProgressBar(message, progId);
-    working = true;
     try
     {
       pcaModel.calculate();
@@ -389,7 +389,7 @@ public class PCAPanel extends GPCAPanel
     {
       pg.translate((int) pf.getImageableX(), (int) pf.getImageableY());
 
-      rc.drawBackground(pg, rc.bgColour);
+      rc.drawBackground(pg);
       rc.drawScene(pg);
       if (rc.drawAxes)
       {
@@ -432,20 +432,19 @@ public class PCAPanel extends GPCAPanel
 
     ImageMaker im;
 
-    if (type == ImageMaker.TYPE.PNG)
+    switch (type)
     {
+    case PNG:
       im = new ImageMaker(this, ImageMaker.TYPE.PNG,
               "Make PNG image from PCA", width, height, null, null, null, 0,
               false);
-    }
-    else if (type == jalview.util.ImageMaker.TYPE.EPS)
-    {
+      break;
+    case EPS:
       im = new ImageMaker(this, ImageMaker.TYPE.EPS,
               "Make EPS file from PCA", width, height, null,
               this.getTitle(), null, 0, false);
-    }
-    else
-    {
+      break;
+    default:
       im = new ImageMaker(this, ImageMaker.TYPE.SVG,
               "Make SVG file from PCA", width, height, null,
               this.getTitle(), null, 0, false);
@@ -453,7 +452,7 @@ public class PCAPanel extends GPCAPanel
 
     if (im.getGraphics() != null)
     {
-      rc.drawBackground(im.getGraphics(), Color.black);
+      rc.drawBackground(im.getGraphics());
       rc.drawScene(im.getGraphics());
       if (rc.drawAxes)
       {