From: amwaterhouse Date: Thu, 10 Feb 2005 17:54:13 +0000 (+0000) Subject: cut and paste now in main menu X-Git-Tag: Release_2_0~673 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c3c4dc54c7f7667de14e1dc797190a8e5b5699ae;p=jalview.git cut and paste now in main menu --- diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index a1007bb..38c3250 100755 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -11,9 +11,6 @@ import MCview.*; public class PopupMenu extends JPopupMenu { JMenu groupMenu = new JMenu(); - JMenuItem copyGroup = new JMenuItem(); - JMenuItem moveGroup = new JMenuItem(); - JMenuItem deleteSequences = new JMenuItem(); JMenuItem analyze = new JMenuItem(); JMenu defineMenu = new JMenu(); JMenuItem groupName = new JMenuItem(); @@ -119,30 +116,6 @@ public class PopupMenu extends JPopupMenu private void jbInit() throws Exception { groupMenu.setText("Group"); - copyGroup.setText("Copy region to new Alignment"); - copyGroup.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - copyGroup_actionPerformed(e); - } - }); - moveGroup.setText("Move sequences to new Alignment"); - moveGroup.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - moveGroup_actionPerformed(e); - } - }); - deleteSequences.setText("Delete sequences"); - deleteSequences.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - deleteSequences_actionPerformed(e); - } - }); analyze.setText("Analyze"); analyze.addActionListener(new java.awt.event.ActionListener() { @@ -202,10 +175,6 @@ public class PopupMenu extends JPopupMenu groupMenu.add(defineMenu); groupMenu.add(unGroupMenuItem); groupMenu.addSeparator(); - groupMenu.add(copyGroup); - groupMenu.add(moveGroup); - groupMenu.add(deleteSequences); - groupMenu.addSeparator(); groupMenu.add(analyze); defineMenu.add(groupName); defineMenu.add(groupAnnotation); @@ -492,60 +461,6 @@ public class PopupMenu extends JPopupMenu groupName.setText(reply); } - protected void copyGroup_actionPerformed(ActionEvent e) - { - SequenceGroup sg = ap.av.getRubberbandGroup(); - - SequenceI[] s = new Sequence[sg.sequences.size()]; - for (int i=0; i < sg.sequences.size(); i++) - { - s[i] = new Sequence( sg.getSequenceAt(i)); - s[i].setSequence( s[i].getSequence(sg.getStartRes(), sg.getEndRes()+1) ); - } - AlignFrame af = new AlignFrame(new Alignment(s)); - int newHeight = s.length * af.viewport.getCharHeight() + 200; - if (newHeight > 500) - newHeight = 500; - Desktop.addInternalFrame(af, "Copied sequences", 700, newHeight); - } - - protected void moveGroup_actionPerformed(ActionEvent e) - { - SequenceGroup sg = ap.av.getRubberbandGroup(); - - SequenceI[] s = new Sequence[sg.sequences.size()]; - - for (int i=0; i < sg.sequences.size(); i++) - s[i] = new Sequence( sg.getSequenceAt(i)); - - AlignFrame af = new AlignFrame(new Alignment(s)); - int newHeight = s.length * af.viewport.getCharHeight() + 200; - if(newHeight>500) - newHeight=500; - Desktop.addInternalFrame(af, "Copied sequences", 700,newHeight); - - - for (int i=0; i < sg.sequences.size(); i++) - ap.av.alignment.deleteSequence(sg.getSequenceAt(i)); - - - ap.av.resetSeqLimits(ap.seqPanel.seqCanvas.getHeight()); - ap.RefreshPanels(); - - - } - - protected void deleteSequences_actionPerformed(ActionEvent e) - { - SequenceGroup sg = ap.av.getRubberbandGroup(); - for (int i=0;i < sg.sequences.size(); i++) - ap.av.getAlignment().deleteSequence(sg.getSequenceAt(i)); - - ap.av.alignment.deleteGroup(sg); - ap.av.resetSeqLimits(ap.seqPanel.seqCanvas.getHeight()); - ap.RefreshPanels(); - - } protected void analyze_actionPerformed(ActionEvent e) {