X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FIdPanel.java;h=b9366ae7c72012f0b6350b78301d5653ccc52ee5;hb=7000ea3223f2f6a390f56341ba26850d2a137ae0;hp=aa91354fd06de7b57704a27b3832e7bf2ebc6e5a;hpb=76bcc855ad9bda24908a3e3e7393d83a2f1a0eca;p=jalview.git diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index aa91354..b9366ae 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -70,50 +70,61 @@ public class IdPanel public void mouseMoved(MouseEvent e) { int seq = Math.max(0, alignPanel.seqPanel.findSeq(e)); + String tmp; if (seq > -1 && seq < av.alignment.getHeight()) { SequenceI sequence = av.alignment.getSequenceAt(seq); - StringBuffer tip = new StringBuffer(""); - tip.append(sequence.getDisplayId(true)); + StringBuffer tip = new StringBuffer(); + tip.append(""); + + int maxWidth = 0; if (sequence.getDescription() != null) { - tip.append("
"); - tip.append(sequence.getDescription()); + tmp = sequence.getDescription(); + tip.append("
"+tmp); + maxWidth = Math.max(maxWidth, tmp.length()); + } - DBRefEntry[] dbrefs = sequence.getDatasetSequence().getDBRef(); - if (dbrefs != null) + DBRefEntry[] dbrefs = sequence.getDatasetSequence().getDBRef(); + if (dbrefs != null) + { + for (int i = 0; i < dbrefs.length; i++) { - tip.append(""); - for (int i = 0; i < dbrefs.length; i++) - { - tip.append("
"); - tip.append(dbrefs[i].getSource() + " " - + dbrefs[i].getAccessionId()); - } - tip.append("
"); + tip.append("
"); + tmp = dbrefs[i].getSource() + " " + dbrefs[i].getAccessionId(); + tip.append(tmp); + maxWidth = Math.max(maxWidth, tmp.length()); } + } - //ADD NON POSITIONAL SEQUENCE INFO - SequenceFeature[] features = sequence.getDatasetSequence(). - getSequenceFeatures(); - if (features != null) + + //ADD NON POSITIONAL SEQUENCE INFO + SequenceFeature[] features = sequence.getDatasetSequence(). + getSequenceFeatures(); + if (features != null) + { + for (int i = 0; i < features.length; i++) { - for (int i = 0; i < features.length; i++) + if (features[i].begin == 0 && features[i].end == 0) { - if (features[i].begin == 0 && features[i].end == 0) - { - tip.append("
" + features[i].featureGroup - + " " + features[i].getType() + " " + - features[i].description); - } + tmp = features[i].featureGroup + + " " + features[i].getType() + " " + + features[i].description; + tip.append("
" + tmp); + maxWidth = Math.max(maxWidth, tmp.length()); } } - tip.append("
"); } + if(maxWidth > 60) + { + tip.insert(0, "
"); + tip.append("
"); + } tip.append(""); - setToolTipText(tip.toString()); + + setToolTipText(""+sequence.getDisplayId(true)+tip.toString()); } }