- " " + MessageManager.getString("label.sequence_name")
- + " ",
- MessageManager.getString("label.sequence_description") + " ",
- MessageManager.getString(
- "label.edit_sequence_name_description"),
- ap.alignFrame);
-
- if (!dialog.accept)
- {
- return;
- }
-
- String name = dialog.getName();
- if (name != null)
- {
- if (name.indexOf(" ") > -1)
- {
- JvOptionPane.showMessageDialog(ap,
- MessageManager
- .getString("label.spaces_converted_to_backslashes"),
- MessageManager
- .getString("label.no_spaces_allowed_sequence_name"),
- JvOptionPane.WARNING_MESSAGE);
- name = name.replace(' ', '_');
- }
-
- sequence.setName(name);
- ap.paintAlignment(false, false);
- }
-
- sequence.setDescription(dialog.getDescription());
-
- ap.av.firePropertyChange("alignment", null,
- ap.av.getAlignment().getSequences());
-
+ MessageManager.getString("label.sequence_name"),
+ MessageManager.getString("label.sequence_description"));
+ dialog.showDialog(ap.alignFrame, MessageManager
+ .getString("label.edit_sequence_name_description"), () -> {
+ if (dialog.getName() != null)
+ {
+ if (dialog.getName().indexOf(" ") > -1)
+ {
+ String ok = MessageManager.getString("action.ok");
+ String cancel = MessageManager.getString("action.cancel");
+ String message = MessageManager.getString(
+ "label.spaces_converted_to_underscores");
+ String title = MessageManager.getString(
+ "label.no_spaces_allowed_sequence_name");
+ Object[] options = new Object[] { ok, cancel };
+
+ JvOptionPane.frameDialog(message, title,
+ JvOptionPane.WARNING_MESSAGE, null, null, null,
+ false);
+ }
+ sequence.setName(dialog.getName().replace(' ', '_'));
+ ap.paintAlignment(false, false);
+ }
+ sequence.setDescription(dialog.getDescription());
+ ap.av.firePropertyChange("alignment", null,
+ ap.av.getAlignment().getSequences());
+ });