X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2FMCview%2FPDBCanvas.java;h=80b65ae9bf5ec682e73bdda4602ad52c1932d19e;hb=e141c1213b46aa8d98e525f0332a25515161892b;hp=6014455efd09eedd0a1e4345318ffb7506a415e7;hpb=c44b1974aea543db46790f6cb88f5ac0aae10a94;p=jalview.git diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index 6014455..80b65ae 100755 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -666,7 +666,7 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe if (highlightRes == null) highlightRes = new Vector(); - if (highlightRes.contains(fatom.alignmentMapping+"" + "")) + if (highlightRes.contains(fatom.alignmentMapping+"")) highlightRes.remove(fatom.alignmentMapping + ""); else highlightRes.add(fatom.alignmentMapping + ""); @@ -718,35 +718,24 @@ public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListe void highlightSeqcanvas(int pos) { - int index = seqcanvas.getViewport().getAlignment().findIndex(sequence); - - int size = pos==-1?0:3; - - if(highlightRes!=null) - size += highlightRes.size()*3; - - int [] array = new int[size]; - int i=0; + SearchResults searchResults = new SearchResults(); if(highlightRes!=null) { - for (i = 0; i < highlightRes.size(); i++) + for (int i = 0; i < highlightRes.size(); i++) { int a = Integer.parseInt(highlightRes.elementAt( i).toString())+1; - array[i * 3] = index; - array[ (i * 3) + 1] = a; - array[ (i * 3) + 2] = a; + + searchResults.addResult(sequence, a, a); } } if(pos!=-1) { - array[i * 3] = index; - array[i * 3 + 1] = pos+1; - array[i * 3 + 2] = pos+1; + searchResults.addResult(sequence, pos+1, pos+1); } - seqcanvas.highlightSearchResults(array); + seqcanvas.highlightSearchResults(searchResults); }