Merge commit 'alpha/update_2_12_for_2_11_2_series_merge^2' into HEAD
[jalview.git] / src / jalview / gui / PCAPanel.java
index 6c76c3e..3823301 100644 (file)
@@ -36,6 +36,7 @@ import jalview.jbgui.GPCAPanel;
 import jalview.math.RotatableMatrix.Axis;
 import jalview.util.ImageMaker;
 import jalview.util.MessageManager;
+import jalview.util.Platform;
 import jalview.viewmodel.AlignmentViewport;
 import jalview.viewmodel.PCAModel;
 
@@ -206,10 +207,7 @@ public class PCAPanel extends GPCAPanel
     repaint();
     if (getParent() == null)
     {
-      Desktop.addInternalFrame(this,
-              MessageManager.formatMessage("label.calc_title", "PCA",
-                      getPcaModel().getScoreModelName()),
-              475, 450);
+      addToDesktop(this, getPcaModel().getScoreModelName());
       this.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
     }
     working = false;
@@ -615,6 +613,12 @@ public class PCAPanel extends GPCAPanel
     // // setMenusForViewport();
     // validate();
   }
+  
+  @Override
+  public void removeProgressBar(long id)
+  {
+    progressBar.removeProgressBar(id);
+  }
 
   @Override
   public void registerHandler(final long id,
@@ -768,4 +772,12 @@ public class PCAPanel extends GPCAPanel
     getRotatableCanvas().ap = panel;
     PaintRefresher.Register(PCAPanel.this, panel.av.getSequenceSetId());
   }
+
+  public static void addToDesktop(PCAPanel panel, String modelName)
+  {
+    Dimension dim = Platform.getDimIfEmbedded(panel, 475, 450);
+    Desktop.addInternalFrame(panel, MessageManager.formatMessage(
+            "label.calc_title", "PCA", modelName), dim.width,
+            dim.height);
+  }
 }