import java.awt.*;
import java.awt.event.*;
+import java.util.Vector;
+
import javax.swing.*;
import jalview.datamodel.*;
{
if (features[i].begin == 0 && features[i].end == 0)
{
- tmp = features[i].featureGroup + " " + features[i].getType()
- + " " + features[i].description;
- tip.append("<br>" + tmp);
- maxWidth = Math.max(maxWidth, tmp.length());
+ tip.append("<br>");
+ 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("<br>");
+ maxWidth = Math.max(maxWidth, sz);
+ }
}
}
}
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 && sl<sf.length;sl++)
+ {
+ if (sf[sl].begin==sf[sl].end && sf[sl].begin==0)
+ {
+ if (sf[sl].links!=null && sf[sl].links.size()>0)
+ {
+ for (int l=0, lSize=sf[sl].links.size(); l<lSize; l++)
+ {
+ nlinks.addElement(sf[sl].links.elementAt(l));
+ }
+ }
+ }
+ }
+
jalview.gui.PopupMenu pop = new jalview.gui.PopupMenu(alignPanel,
- (Sequence) av.getAlignment().getSequenceAt(seq),
- Preferences.sequenceURLLinks);
+ sq,
+ nlinks);
pop.show(this, e.getX(), e.getY());
return;