From 21f3e784749a8eb93cd716fca379d50732f08827 Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 9 Sep 2008 10:10:48 +0000 Subject: [PATCH] non-positional features are displayed with additional score/evidence if necessary and url links generated from embedded links --- src/jalview/gui/IdPanel.java | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 222cf8d..a325618 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -20,6 +20,8 @@ package jalview.gui; import java.awt.*; import java.awt.event.*; +import java.util.Vector; + import javax.swing.*; import jalview.datamodel.*; @@ -115,10 +117,19 @@ public class IdPanel extends JPanel implements MouseListener, { if (features[i].begin == 0 && features[i].end == 0) { - tmp = features[i].featureGroup + " " + features[i].getType() - + " " + features[i].description; - tip.append("
" + tmp); - maxWidth = Math.max(maxWidth, tmp.length()); + tip.append("
"); + int sz = -tip.length(); + boolean nl=false; + if (features[i].getFeatureGroup()!=null) { tip.append(features[i].getFeatureGroup()); nl=true;}; + if (features[i].getType()!=null) { tip.append(" "); tip.append(features[i].getType()); nl=true;}; + if (features[i].getDescription()!=null) { tip.append(" "); tip.append(features[i].getDescription()); nl=true;}; + if (features[i].getScore()!=Float.NaN && features[i].getScore()!=0f) { tip.append(" Score = "); tip.append(features[i].getScore()); nl=true;}; + if (features[i].getStatus()!=null && features[i].getStatus().length()>0) { tip.append(" ("); tip.append(features[i].getStatus()); tip.append(")");nl=true;}; + if (nl) { + sz+=tip.length(); + tip.append("
"); + maxWidth = Math.max(maxWidth, sz); + } } } } @@ -302,9 +313,28 @@ public class IdPanel extends JPanel implements MouseListener, if (javax.swing.SwingUtilities.isRightMouseButton(e)) { + Sequence sq = (Sequence) av + .getAlignment().getSequenceAt(seq); + // build a new links menu based on the current links + any non-positional features + Vector nlinks = new Vector(Preferences.sequenceURLLinks); + SequenceFeature sf[] = sq.getDatasetSequence().getSequenceFeatures(); + for (int sl=0;sf!=null && sl0) + { + for (int l=0, lSize=sf[sl].links.size(); l