X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureEditor.java;h=880a1b22d9aaac0734cfb6c8aff84840445b522d;hb=e57f77dc13f5a295cf49a403da05770a68a6e22b;hp=ba9da673551cf49a0de84fc1f5d4edfe87ad3cc4;hpb=b364e1e6d199002069dab615d1007799b5bb71e1;p=jalview.git diff --git a/src/jalview/gui/FeatureEditor.java b/src/jalview/gui/FeatureEditor.java index ba9da67..880a1b2 100644 --- a/src/jalview/gui/FeatureEditor.java +++ b/src/jalview/gui/FeatureEditor.java @@ -33,7 +33,6 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.Callable; import javax.swing.JComboBox; import javax.swing.JLabel; @@ -254,7 +253,7 @@ public class FeatureEditor */ final String ft = features.get(featureIndex).getType(); final String type = ft == null ? lastFeatureAdded : ft; - FeatureTypeSettings fcc = new FeatureTypeSettings(fr, type); + FeatureTypeSettings fcc = new FeatureTypeSettings(fr, type, true); fcc.setRequestFocusEnabled(true); fcc.requestFocus(); fcc.addActionListener(new ActionListener() @@ -428,9 +427,8 @@ public class FeatureEditor */ public void showDialog() { - Callable okAction = forCreate ? getCreateAction() - : getAmendAction(); - Callable cancelAction = getCancelAction(); + Runnable okAction = forCreate ? getCreateAction() : getAmendAction(); + Runnable cancelAction = getCancelAction(); /* * set dialog action handlers for OK (create/Amend) and Cancel options @@ -476,12 +474,11 @@ public class FeatureEditor * * @return */ - protected Callable getCancelAction() + protected Runnable getCancelAction() { - Callable okAction = () -> { + Runnable okAction = () -> { ap.highlightSearchResults(null); ap.paintAlignment(false, false); - return null; }; return okAction; } @@ -496,14 +493,14 @@ public class FeatureEditor * * @return */ - protected Callable getCreateAction() + protected Runnable getCreateAction() { - Callable okAction = new Callable() + Runnable okAction = new Runnable() { boolean useLastDefaults = features.get(0).getType() == null; @Override - public Void call() + public void run() { final String enteredType = name.getText().trim(); final String enteredGroup = group.getText().trim(); @@ -543,7 +540,6 @@ public class FeatureEditor repaintPanel(); } - return null; } }; return okAction; @@ -556,15 +552,14 @@ public class FeatureEditor * * @return */ - protected Callable getDeleteAction() + protected Runnable getDeleteAction() { - Callable deleteAction = () -> { + Runnable deleteAction = () -> { SequenceFeature sf = features.get(featureIndex); sequences.get(0).getDatasetSequence().deleteFeature(sf); fr.featuresAdded(); ap.getSeqPanel().seqCanvas.highlightSearchResults(null); ap.paintAlignment(true, true); - return null; }; return deleteAction; } @@ -655,9 +650,9 @@ public class FeatureEditor * * @return */ - protected Callable getAmendAction() + protected Runnable getAmendAction() { - Callable okAction = new Callable() + Runnable okAction = new Runnable() { boolean useLastDefaults = features.get(0).getType() == null; @@ -666,7 +661,7 @@ public class FeatureEditor String featureGroup = group.getText(); @Override - public Void call() + public void run() { final String enteredType = name.getText().trim(); final String enteredGroup = group.getText().trim(); @@ -729,7 +724,6 @@ public class FeatureEditor fr.featuresAdded(); } repaintPanel(); - return null; } }; return okAction;