From: amwaterhouse Date: Wed, 15 Feb 2006 15:23:03 +0000 (+0000) Subject: No more supergroup, set Sequence name / Description X-Git-Tag: Root_VamJalview_2_07b+~135 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0201d2b630e06a75fd9522f24863e9cecf8810fd;p=jalview.git No more supergroup, set Sequence name / Description --- diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index 07b9fec..3114211 100755 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -263,7 +263,7 @@ public class PopupMenu extends JPopupMenu } }); sequenceMenu.setText("Sequence"); - sequenceName.setText("Edit name"); + sequenceName.setText("Edit Name/Desciption"); sequenceName.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -495,16 +495,6 @@ public class PopupMenu extends JPopupMenu */ void refresh() { - SequenceGroup sg = getGroup(); - if(sg!=null) - { - SuperGroup superG = ap.av.alignment.getSuperGroup(sg); - - if (superG != null) - { - superG.setSuperGroupProperties(sg); - } - } if (ap.overviewPanel != null) ap.overviewPanel.updateOverviewImage(); @@ -806,11 +796,34 @@ public class PopupMenu extends JPopupMenu */ void sequenceName_actionPerformed(ActionEvent e) { - String id = sequence.getName(); - String s = (String) JOptionPane.showInternalInputDialog(ap, - "Edit sequence name", - "Edit sequence name (" + sequence.getName() + ")", - JOptionPane.PLAIN_MESSAGE, null, null, id); + JLabel idlabel = new JLabel( " Sequence Name "); + JLabel desclabel = new JLabel("Sequence Description "); + idlabel.setFont(new Font("Courier", Font.PLAIN, 12)); + desclabel.setFont(new Font("Courier", Font.PLAIN, 12)); + JTextField id = new JTextField(sequence.getName(), 40); + JTextField description = new JTextField(sequence.getDescription(), 40); + JPanel panel = new JPanel(new BorderLayout()); + JPanel panel2 = new JPanel(new BorderLayout()); + panel2.add(idlabel, BorderLayout.WEST); + panel2.add(id, BorderLayout.CENTER); + panel.add(panel2, BorderLayout.NORTH); + panel2 = new JPanel(new BorderLayout()); + panel2.add(desclabel, BorderLayout.WEST); + panel2.add(description, BorderLayout.CENTER); + panel.add(panel2, BorderLayout.SOUTH); + + + int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop, + panel, "Edit Sequence Name/Description", + JOptionPane.OK_CANCEL_OPTION ); + + + if (reply != JOptionPane.OK_OPTION ) + { + return; + } + + String s = id.getText(); if (s != null) { @@ -827,6 +840,9 @@ public class PopupMenu extends JPopupMenu sequence.setName(s); ap.repaint(); } + + sequence.getDatasetSequence().setDescription(description.getText()); + sequence.setDescription(description.getText()); } /**