AlignmentAnnotation[] aa = ap.av.getAlignment()
.getAlignmentAnnotation();
+ boolean fullRepaint = false;
if (evt.getActionCommand().equals(ADDNEW))
{
AlignmentAnnotation newAnnotation = new AlignmentAnnotation(null,
ap.av.getAlignment().addAnnotation(newAnnotation);
ap.av.getAlignment().setAnnotationIndex(newAnnotation, 0);
+ fullRepaint = true;
}
else if (evt.getActionCommand().equals(EDITNAME))
{
+ String name = aa[selectedRow].label;
editLabelDescription(aa[selectedRow]);
- repaint();
+ if (!name.equalsIgnoreCase(aa[selectedRow].label))
+ {
+ fullRepaint = true;
+ }
}
else if (evt.getActionCommand().equals(HIDE))
{
{
ap.av.getAlignment().deleteAnnotation(aa[selectedRow]);
ap.av.getCalcManager().removeWorkerForAnnotation(aa[selectedRow]);
+ fullRepaint = true;
}
else if (evt.getActionCommand().equals(SHOWALL))
{
aa[i].visible = true;
}
}
+ fullRepaint = true;
}
else if (evt.getActionCommand().equals(OUTPUT_TEXT))
{
aa[selectedRow].scaleColLabel = !aa[selectedRow].scaleColLabel;
}
- refresh();
+ refresh(fullRepaint);
}
/**
* Redraw sensibly.
+ *
+ * @adjustHeight if true, try to recalculate panel height for visible
+ * annotations
*/
- protected void refresh()
+ protected void refresh(boolean adjustHeight)
{
- ap.validateAnnotationDimensions(false);
+ ap.validateAnnotationDimensions(adjustHeight);
ap.addNotify();
- ap.repaint();
+ if (adjustHeight)
+ {
+ // sort, repaint, update overview
+ ap.paintAlignment(true);
+ }
+ else
+ {
+ // lightweight repaint
+ ap.repaint();
+ }
}
/**
*/
boolean editLabelDescription(AlignmentAnnotation annotation)
{
+ // TODO i18n
EditNameDialog dialog = new EditNameDialog(annotation.label,
annotation.description, " Annotation Name ",
"Annotation Description ", "Edit Annotation Name/Description",
// ann.visible = false;
// }
// }
- refresh();
+ refresh(true);
}
});
pop.add(hideType);