From: amwaterhouse Date: Fri, 24 Feb 2006 11:43:25 +0000 (+0000) Subject: First attempt to install hidden regions X-Git-Tag: Root_VamJalview_2_07b+~97 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=171f3813518871b1e2b1a2255a481866b4e7cd70;p=jalview.git First attempt to install hidden regions --- diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 3209960..b9ba9f3 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -250,6 +250,9 @@ public class SeqPanel extends JPanel res = (x / av.getCharWidth()) + av.getStartRes(); } + if(av.hasHiddenColumns) + res = av.getColumnSelection().adjustForHiddenColumns(res); + return res; } @@ -396,40 +399,48 @@ public class SeqPanel extends JPanel // use aa to see if the mouse pointer is on a if (av.showSequenceFeatures) { - Vector features = sequence.getDatasetSequence().getSequenceFeatures(); + SequenceFeature [] features = sequence.getDatasetSequence().getSequenceFeatures(); if(features!=null) { StringBuffer sbuffer = new StringBuffer(""); - for (int i = 0; i < features.size(); i++) + for (int i = 0; i < features.length; i++) { - SequenceFeature sf = (SequenceFeature) features.elementAt(i); - if ( (sf.getBegin() <= sequence.findPosition(res)) && - (sf.getEnd() >= sequence.findPosition(res))) + if ( (features[i].getBegin() <= sequence.findPosition(res)) && + (features[i].getEnd() >= sequence.findPosition(res))) { - if (sf.getType().equals("disulfide bond")) + if(!av.featuresDisplayed.containsKey(features[i].getType())) + continue; + + + if (features[i].getType().equals("disulfide bond")) { - if (sf.getBegin() == sequence.findPosition(res) - || sf.getEnd() == sequence.findPosition(res)) + if (features[i].getBegin() == sequence.findPosition(res) + || features[i].getEnd() == sequence.findPosition(res)) { if (sbuffer.length() > 6) sbuffer.append("
"); - sbuffer.append("disulfide bond " + sf.getBegin() + ":" + - sf.getEnd()); + sbuffer.append("disulfide bond " + features[i].getBegin() + ":" + + features[i].getEnd()); } } else { if (sbuffer.length() > 6) sbuffer.append("
"); - sbuffer.append(sf.getType()); - if (sf.getDescription() != null) - sbuffer.append(" " + sf.getDescription()); + if(features[i].featureGroup!=null) + sbuffer.append(features[i].featureGroup+";"); - if (sf.getStatus() != null) + sbuffer.append(features[i].getType()); + + if (features[i].getDescription() != null + && !features[i].description.equals(features[i].getType())) + sbuffer.append("; " + features[i].getDescription()); + + if (features[i].getStatus() != null && features[i].getStatus().length()>0) { - sbuffer.append(" (" + sf.getStatus() + ")"); + sbuffer.append("; (" + features[i].getStatus() + ")"); } } } @@ -599,19 +610,6 @@ public class SeqPanel extends JPanel seqCanvas.repaint(); } - /** - * DOCUMENT ME! - * - * @param seqstart DOCUMENT ME! - * @param seqend DOCUMENT ME! - * @param start DOCUMENT ME! - */ - public void drawChars(int seqstart, int seqend, int start) - { - seqCanvas.drawPanel(seqCanvas.gg, start, av.getEndRes(), seqstart, - seqend, av.getStartRes(), av.getStartSeq(), 0); - seqCanvas.repaint(); - } /** * DOCUMENT ME!