From: amwaterhouse Date: Tue, 6 Dec 2005 17:14:57 +0000 (+0000) Subject: Make ImageMap for features as well as groups X-Git-Tag: Release_2_07~45 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d19a0643d50c405995df23ef9d29f18e0204e87c;p=jalview.git Make ImageMap for features as well as groups --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index ed00d33..e3bc620 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -809,6 +809,11 @@ public class AlignmentPanel extends GAlignmentPanel int height = ( (av.alignment.getHeight() + 1) * av.charHeight) + 30; int width = idPanel.getWidth() + (av.alignment.getWidth() * av.charWidth); + if (idPanel.getWidth() == 0) + { + width += calculateIdWidth().getWidth() + 4; + } + if (av.getWrapAlignment()) { height = getWrappedHeight(); @@ -897,45 +902,102 @@ public class AlignmentPanel extends GAlignmentPanel { try { + int s, sSize = av.alignment.getHeight(), + res, alwidth = av.alignment.getWidth(), g, gSize, f, fSize, sy; + StringBuffer text = new StringBuffer(); PrintWriter out = new PrintWriter(new FileWriter(imgMapFile)); out.println(jalview.io.HTMLOutput.getImageMapHTML()); out.println("" + ""); - for (int s = 0; s < av.alignment.getHeight(); s++) + for (s = 0; s < sSize; s++) { + sy = s * av.charHeight + scaleHeight; + SequenceI seq = av.alignment.getSequenceAt(s); + java.util.Vector features = seq.getDatasetSequence().getSequenceFeatures(); SequenceGroup[] groups = av.alignment.findAllGroups(seq); - for (int i = 0; i < groups.length; i++) + for(res =0; resres) + text.append("
" + groups[g].getName() + ""); + } - out.println( - "" + groups[i].getName() + - "')\"; onMouseOut=\"toolTip()\"; " - + " href=\"#\">"); + + alIndex + " " + triplet ); + } + fSize = features.size(); + for (f = 0; f < fSize; f++) + { + SequenceFeature sf = (SequenceFeature) features.elementAt(f); + + if ( (sf.getBegin() <= seq.findPosition(res)) && + (sf.getEnd() >= seq.findPosition(res))) + { + if (sf.getType().equals("disulfide bond")) + { + if (sf.getBegin() == seq.findPosition(res) + || sf.getEnd() == seq.findPosition(res)) + { + text.append("
disulfide bond " + sf.getBegin() + ":" + + sf.getEnd()); + } + } + else + { + text.append("
"); + text.append(sf.getType()); + if (sf.getDescription() != null && !sf.getType().equals(sf.getDescription())) + text.append(" " + sf.getDescription()); + + if (sf.getStatus() != null && sf.getStatus().length()>0) + { + text.append(" (" + sf.getStatus() + ")"); + } + } + } + + } + } + if(text.length()>1) + { + text.append("')\"; onMouseOut=\"toolTip()\"; href=\"#\">"); + out.println(text.toString()); + } } } - } - out.println("
"); out.close();