From 081d97534307cfc0a6f33e4b517f41a190fd70a2 Mon Sep 17 00:00:00 2001
From: tcarver <tjc>
Date: Thu, 10 Jan 2013 09:51:27 +0000
Subject: [PATCH] use bamClone system property to define multiple BAM windows
 (to be used with bam flag)

---
 .../sanger/artemis/components/EntryEdit.java  | 26 ++++++++++++++++---
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/uk/ac/sanger/artemis/components/EntryEdit.java b/uk/ac/sanger/artemis/components/EntryEdit.java
index bf811123b..8e75559fd 100644
--- a/uk/ac/sanger/artemis/components/EntryEdit.java
+++ b/uk/ac/sanger/artemis/components/EntryEdit.java
@@ -498,11 +498,29 @@ public class EntryEdit extends JFrame
         public Object construct()
         {
           EntryEdit.this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
-          String ngs[] = System.getProperty("bam").split("[\\s,]");
-          FileSelectionDialog fileChooser = new FileSelectionDialog(ngs);
-          List<String> listBams = fileChooser.getFiles(".*\\.(bam|cram)$");
-          List<String> vcfFiles = fileChooser.getFiles(VCFview.VCFFILE_SUFFIX);
+          final String ngs[] = System.getProperty("bam").split("[\\s,]");
+          final FileSelectionDialog fileChooser = new FileSelectionDialog(ngs);
+          final List<String> listBams = fileChooser.getFiles(".*\\.(bam|cram)$");
+          final List<String> vcfFiles = fileChooser.getFiles(VCFview.VCFFILE_SUFFIX);
           loadBamAndVcf(listBams, vcfFiles);
+
+          if(System.getProperty("bamClone") != null)
+          {
+            int nclone = 2;
+            try
+            {
+              nclone = Integer.parseInt(System.getProperty("bamClone"));
+            }
+            catch(NumberFormatException ne){}
+            if(nclone > 10)
+              nclone = 10;
+            logger4j.debug("No. BamView clones = "+nclone+" bamClone = "+
+                           System.getProperty("bamClone"));
+            
+            for(int i=1;i<nclone;i++)
+              bamView.cloneBamView();
+          }
+          
           EntryEdit.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
           return null;
         }
-- 
GitLab