import java.util.StringTokenizer;
import java.util.Vector;
+import javax.swing.JOptionPane;
+
import org.jmol.viewer.Viewer;
public class AlignFrame extends EmbmenuFrame implements ActionListener,
seqs.addElement(seq);
}
- // If the cut affects all sequences, remove highlighted columns
- if (sg.getSize() == viewport.getAlignment().getHeight())
+ /*
+ * If the cut affects all sequences, warn, remove highlighted columns
+ */if (sg.getSize() == viewport.getAlignment().getHeight())
{
+ boolean isEntireAlignWidth = (((sg.getEndRes() - sg.getStartRes()) + 1) == viewport
+ .getAlignment().getWidth()) ? true : false;
+ if (isEntireAlignWidth)
+ {
+ int confirm = JOptionPane.showConfirmDialog(this,
+ MessageManager.getString("warn.delete_all"), // $NON-NLS-1$
+ MessageManager.getString("label.delete_all"), // $NON-NLS-1$
+ JOptionPane.OK_CANCEL_OPTION);
+
+ if (confirm == JOptionPane.CANCEL_OPTION
+ || confirm == JOptionPane.CLOSED_OPTION)
+ {
+ return;
+ }
+ }
viewport.getColumnSelection().removeElements(sg.getStartRes(),
sg.getEndRes() + 1);
}
/*
* If the cut affects all sequences, warn, remove highlighted columns
*/
-
- boolean isEntireAlignWidth = (((sg.getEndRes() - sg.getStartRes()) + 1) == viewport
- .getAlignment().getWidth()) ? true : false;
- if (sg.getSize() == viewport.getAlignment().getHeight()
- && isEntireAlignWidth)
+ if (sg.getSize() == viewport.getAlignment().getHeight())
{
- int confirm = JOptionPane.showConfirmDialog(this,
- MessageManager.getString("warn.delete_all"), // $NON-NLS-1$
- MessageManager.getString("label.delete_all"), // $NON-NLS-1$
- JOptionPane.OK_CANCEL_OPTION);
-
- if (confirm == JOptionPane.CANCEL_OPTION
- || confirm == JOptionPane.CLOSED_OPTION)
+ boolean isEntireAlignWidth = (((sg.getEndRes() - sg.getStartRes()) + 1) == viewport
+ .getAlignment().getWidth()) ? true : false;
+ if (isEntireAlignWidth)
{
- return;
+ int confirm = JOptionPane.showConfirmDialog(this,
+ MessageManager.getString("warn.delete_all"), // $NON-NLS-1$
+ MessageManager.getString("label.delete_all"), // $NON-NLS-1$
+ JOptionPane.OK_CANCEL_OPTION);
+
+ if (confirm == JOptionPane.CANCEL_OPTION
+ || confirm == JOptionPane.CLOSED_OPTION)
+ {
+ return;
+ }
}
+ viewport.getColumnSelection().removeElements(sg.getStartRes(),
+ sg.getEndRes() + 1);
}
-
- viewport.getColumnSelection().removeElements(sg.getStartRes(),
- sg.getEndRes() + 1);
SequenceI[] cut = sg.getSequences()
.toArray(new SequenceI[sg.getSize()]);