focus is explicitly handed back to caller (JAL-566)
Font font = new Font("Arial", Font.PLAIN, 11);
Font font = new Font("Arial", Font.PLAIN, 11);
+ private boolean hasHiddenRows;
+
/**
* Creates a new AnnotationLabels object.
*
/**
* Creates a new AnnotationLabels object.
*
+ /**
+ * sets selectedRow to -2 if no annotation preset, -1 if no visible row is at
+ * y
+ *
+ * @param y
+ * coordinate position to search for a row
+ */
void getSelectedRow(int y)
{
int height = 0;
AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
void getSelectedRow(int y)
{
int height = 0;
AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
if (aa != null)
{
for (int i = 0; i < aa.length; i++)
{
if (aa != null)
{
for (int i = 0; i < aa.length; i++)
{
if (!aa[i].visible)
{
continue;
if (!aa[i].visible)
{
continue;
- } else {
- selectedRow = -1;
{
EditNameDialog dialog = new EditNameDialog(annotation.label,
annotation.description, " Annotation Name ",
{
EditNameDialog dialog = new EditNameDialog(annotation.label,
annotation.description, " Annotation Name ",
- "Annotation Description ", "Edit Annotation Name/Description");
+ "Annotation Description ", "Edit Annotation Name/Description",
+ ap.alignFrame);
// Swap these annotations
AlignmentAnnotation startAA = ap.av.alignment
.getAlignmentAnnotation()[start];
// Swap these annotations
AlignmentAnnotation startAA = ap.av.alignment
.getAlignmentAnnotation()[start];
+ if (end == -1)
+ {
+ end = ap.av.alignment.getAlignmentAnnotation().length - 1;
+ }
AlignmentAnnotation endAA = ap.av.alignment.getAlignmentAnnotation()[end];
ap.av.alignment.getAlignmentAnnotation()[end] = startAA;
AlignmentAnnotation endAA = ap.av.alignment.getAlignmentAnnotation()[end];
ap.av.alignment.getAlignmentAnnotation()[end] = startAA;
AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
if (SwingUtilities.isLeftMouseButton(evt))
{
AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
if (SwingUtilities.isLeftMouseButton(evt))
{
- if (aa!=null && selectedRow < aa.length)
+ if (selectedRow > -1 && selectedRow < aa.length)
{
if (aa[selectedRow].groupRef != null)
{
{
if (aa[selectedRow].groupRef != null)
{
JPopupMenu pop = new JPopupMenu("Annotations");
JMenuItem item = new JMenuItem(ADDNEW);
item.addActionListener(this);
JPopupMenu pop = new JPopupMenu("Annotations");
JMenuItem item = new JMenuItem(ADDNEW);
item.addActionListener(this);
-
- if ((aa == null) || (aa.length == 0))
+ pop.add(item);
+ if (selectedRow < 0)
- item = new JMenuItem(SHOWALL);
- item.addActionListener(this);
- pop.add(item);
+ if (hasHiddenRows)
+ { // let the user make everything visible again
+ item = new JMenuItem(SHOWALL);
+ item.addActionListener(this);
+ pop.add(item);
+ }
pop.show(this, evt.getX(), evt.getY());
return;
}
pop.show(this, evt.getX(), evt.getY());
return;
}
item = new JMenuItem(EDITNAME);
item.addActionListener(this);
pop.add(item);
item = new JMenuItem(EDITNAME);
item.addActionListener(this);
pop.add(item);
item = new JMenuItem(DELETE);
item.addActionListener(this);
pop.add(item);
item = new JMenuItem(DELETE);
item.addActionListener(this);
pop.add(item);
- item = new JMenuItem(SHOWALL);
- item.addActionListener(this);
- pop.add(item);
+ if (hasHiddenRows)
+ {
+ item = new JMenuItem(SHOWALL);
+ item.addActionListener(this);
+ pop.add(item);
+ }
item = new JMenuItem(OUTPUT_TEXT);
item.addActionListener(this);
pop.add(item);
item = new JMenuItem(OUTPUT_TEXT);
item.addActionListener(this);
pop.add(item);
for (int i = 0; i < aa.length; i++)
{
g.setColor(Color.black);
if (!aa[i].visible)
{
for (int i = 0; i < aa.length; i++)
{
g.setColor(Color.black);
if (!aa[i].visible)
{