*/
public void actionPerformed(ActionEvent evt)
{
- int dif = 0;
AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
if (evt.getActionCommand().equals(ADDNEW))
ap.av.alignment.addAnnotation(newAnnotation);
ap.av.alignment.setAnnotationIndex(newAnnotation, 0);
- if (aa != null)
- {
- dif = aa[aa.length - 1].height;
- }
}
else if (evt.getActionCommand().equals(EDITNAME))
{
{
ap.av.quality = null;
}
-
- dif = aa[selectedRow].height * -1;
}
else if (evt.getActionCommand().equals(DELETE))
{
ap.av.alignment.deleteAnnotation(aa[selectedRow]);
- dif = aa[selectedRow].height * -1;
}
else if (evt.getActionCommand().equals(SHOWALL))
{
{
if (!aa[i].visible && aa[i].annotations!=null)
{
- dif += aa[i].height;
aa[i].visible = true;
}
}
ap,
new AlignmentAnnotation[]
{aa[selectedRow]},
- null
+ null, null
);
}
else if (evt.getActionCommand().equals(COPYCONS_SEQ))
getSelectedRow(evt.getY() - scrollOffset);
+
if (selectedRow > -1
&& ap.av.alignment.getAlignmentAnnotation().length > selectedRow)
{
- String desc = ap.av.alignment.
- getAlignmentAnnotation()[selectedRow].description;
+ AlignmentAnnotation aa = ap.av.alignment.
+ getAlignmentAnnotation()[selectedRow];
+
+ StringBuffer desc = new StringBuffer("<html>");
+
+ if (aa.description != null && !aa.description.equals("New description"))
+ {
+ desc.append(aa.description);
+ if(aa.hasScore)
+ desc.append("<br>");
+ }
+ if(aa.hasScore())
+ {
+ desc.append("Score: "+aa.score);
+ }
- if (desc != null && !desc.equals("New description"))
+ if(desc.length()!=6)
{
- setToolTipText(ap.av.alignment.
- getAlignmentAnnotation()[selectedRow].description);
+ desc.append("</html>");
+ this.setToolTipText(desc.toString());
}
+ else
+ this.setToolTipText(null);
}
}
AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+ JPopupMenu pop = new JPopupMenu("Annotations");
+ JMenuItem item = new JMenuItem(ADDNEW);
+ item.addActionListener(this);
+
if ( (aa == null) || (aa.length == 0))
{
- JPopupMenu pop = new JPopupMenu("Annotations");
- JMenuItem item = new JMenuItem(ADDNEW);
+ item = new JMenuItem(SHOWALL);
item.addActionListener(this);
pop.add(item);
pop.show(this, evt.getX(), evt.getY());
-
return;
}
- JPopupMenu pop = new JPopupMenu("Annotations");
- JMenuItem item = new JMenuItem(ADDNEW);
- item.addActionListener(this);
pop.add(item);
item = new JMenuItem(EDITNAME);
item.addActionListener(this);
item.addActionListener(this);
pop.add(item);
// annotation object should be typed
- if (aa[selectedRow] == ap.av.consensus)
+ if (selectedRow<aa.length && aa[selectedRow] == ap.av.consensus)
{
pop.addSeparator();
final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(