From 4574a3aae556ae70c514d5deb9dc93b48b0fc28b Mon Sep 17 00:00:00 2001
From: tcarver <tjc>
Date: Tue, 10 Apr 2012 14:45:57 +0100
Subject: [PATCH] use ReadCountDialog

---
 .../artemis/components/alignment/BamView.java    | 16 ++++++++++++----
 .../components/alignment/MappedReads.java        |  2 +-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/uk/ac/sanger/artemis/components/alignment/BamView.java b/uk/ac/sanger/artemis/components/alignment/BamView.java
index b489c8b09..6f11ad392 100644
--- a/uk/ac/sanger/artemis/components/alignment/BamView.java
+++ b/uk/ac/sanger/artemis/components/alignment/BamView.java
@@ -2181,7 +2181,12 @@ public class BamView extends JPanel
         Box yBox = Box.createVerticalBox();
         yBox.add(overlap);
         yBox.add(spliced);
-        JOptionPane.showMessageDialog(null, yBox, "Read Count Option", JOptionPane.INFORMATION_MESSAGE);
+        
+        final ReadCountDialog opts = new ReadCountDialog(new JFrame(),
+            "Read Count Options", feature_display, yBox);
+        if(opts.getStatus() == -1)
+          return;
+        //JOptionPane.showMessageDialog(null, yBox, "Read Count Option", JOptionPane.INFORMATION_MESSAGE);
         
         new MappedReads(features, (String)combo.getSelectedItem(), samFileReaderHash, bamList,
             seqNames, offsetLengths, concatSequences, seqLengths, 
@@ -2211,9 +2216,12 @@ public class BamView extends JPanel
         
         if(seqLengths.size() > 1)
           yBox.add(allRefSeqs);
-        
-        JOptionPane.showMessageDialog(null, yBox, "Read Count Option", JOptionPane.INFORMATION_MESSAGE);
-        
+     
+        final ReadCountDialog opts = new ReadCountDialog(new JFrame(),
+            "RPKM Options", feature_display, yBox);
+        if(opts.getStatus() == -1)
+          return;
+
         int seqlen = 0;
         if(feature_display != null)
           seqlen = feature_display.getSequenceLength();
diff --git a/uk/ac/sanger/artemis/components/alignment/MappedReads.java b/uk/ac/sanger/artemis/components/alignment/MappedReads.java
index 4ff56d521..577a64d9d 100644
--- a/uk/ac/sanger/artemis/components/alignment/MappedReads.java
+++ b/uk/ac/sanger/artemis/components/alignment/MappedReads.java
@@ -220,7 +220,7 @@ public class MappedReads
 
           sampleCounts.add(cnt);
         }
-        featureReadCount.put(f.getSystematicName(), sampleCounts);
+        featureReadCount.put(ReadCountDialog.getFeatureName(f), sampleCounts);
       }
       return null;
     }
-- 
GitLab