From: jprocter Date: Wed, 1 Mar 2006 14:03:52 +0000 (+0000) Subject: propagate SearchResult object use to MCView's highlighted residue renderer. X-Git-Tag: Root_VamJalview_2_07b+~87 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e141c1213b46aa8d98e525f0332a25515161892b;p=jalview.git propagate SearchResult object use to MCView's highlighted residue renderer. --- diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index b2b2c61..dc4cf0b 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -498,8 +498,8 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion tmp.startCol = seqcanvas.getSequenceRenderer(). getResidueBoxColour( sequence, index); - // tmp.startCol = seqcanvas.getFeatureRenderer(). - // findFeatureColour(tmp.startCol, sequence, index); + tmp.startCol = seqcanvas.getFeatureRenderer(). + findFeatureColour(tmp.startCol, sequence, index); } } @@ -509,8 +509,8 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion { tmp.endCol = seqcanvas.getSequenceRenderer(). getResidueBoxColour( sequence, index); - // tmp.endCol = seqcanvas.getFeatureRenderer(). - // findFeatureColour(tmp.endCol, sequence, index); + tmp.endCol = seqcanvas.getFeatureRenderer(). + findFeatureColour(tmp.endCol, sequence, index); } } } @@ -716,35 +716,24 @@ public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotion 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); } 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); }