return;\r
}\r
\r
- addHistoryItem(new HistoryItem("Delete Sequences", viewport.alignment,\r
- HistoryItem.HIDE));\r
\r
SequenceGroup sg = viewport.getSelectionGroup();\r
- boolean allSequences = false;\r
- if (sg.sequences.size() == viewport.alignment.getHeight())\r
+\r
+\r
+\r
+ //Jalview no longer allows deletion of residues.\r
+ //Check here whether any residues are in selection area\r
+ if( sg.getEndRes()-sg.getStartRes() < viewport.alignment.getWidth()-1)\r
{\r
- allSequences = true;\r
+ for (int i = 0; i < sg.sequences.size(); i++)\r
+ {\r
+ SequenceI seq = sg.getSequenceAt(i);\r
+ int j = sg.getStartRes();\r
+ do\r
+ {\r
+ if (!jalview.util.Comparison.isGap(seq.getCharAt(j)))\r
+ {\r
+ JOptionPane.showInternalMessageDialog(\r
+ Desktop.desktop, "Cannot delete residues from alignment!\n"\r
+ + "Try hiding columns instead.",\r
+ "Deletion of residues not permitted",\r
+ JOptionPane.WARNING_MESSAGE);\r
+\r
+ return;\r
+ }\r
+ j++;\r
+ }while(j<=sg.getEndRes());\r
+ }\r
}\r
\r
+\r
+ addHistoryItem(new HistoryItem("Delete Sequences", viewport.alignment,\r
+ HistoryItem.HIDE));\r
+\r
+\r
for (int i = 0; i < sg.sequences.size(); i++)\r
{\r
SequenceI seq = sg.getSequenceAt(i);\r
int index = viewport.getAlignment().findIndex(seq);\r
+\r
seq.deleteChars(sg.getStartRes(), sg.getEndRes() + 1);\r
\r
// If the cut affects all sequences, remove highlighted columns\r
- if (allSequences)\r
+ if (sg.sequences.size() == viewport.alignment.getHeight())\r
{\r
viewport.getColumnSelection().removeElements(sg.getStartRes(),\r
sg.getEndRes() + 1);\r
JInternalFrame frame = new JInternalFrame();\r
Finder finder = new Finder(viewport, alignPanel, frame);\r
frame.setContentPane(finder);\r
- Desktop.addInternalFrame(frame, "Find", 340, 110);\r
frame.setLayer(JLayeredPane.PALETTE_LAYER);\r
+ Desktop.addInternalFrame(frame, "Find", 340, 110);\r
}\r
\r
/**\r
new SequenceFeatureFetcher(viewport.\r
alignment,\r
alignPanel);\r
- viewport.showSequenceFeatures(true);\r
+ viewport.setShowSequenceFeatures(true);\r
showSeqFeatures.setSelected(true);\r
}\r
}\r
*/\r
public void showSeqFeatures_actionPerformed(ActionEvent evt)\r
{\r
- viewport.showSequenceFeatures(showSeqFeatures.isSelected());\r
+ viewport.setShowSequenceFeatures(showSeqFeatures.isSelected());\r
alignPanel.repaint();\r
+ if (alignPanel.getOverviewPanel() != null)\r
+ {\r
+ alignPanel.getOverviewPanel().updateOverviewImage();\r
+ }\r
}\r
\r
/**\r
}\r
\r
viewport.showSequenceFeatures = true;\r
+ showSeqFeatures.setSelected(true);\r
alignPanel.repaint();\r
return true;\r
}\r