import java.util.List;
+import jalview.api.FeatureColourI;
+import jalview.datamodel.features.FeatureMatcherSetI;
import jalview.gui.AlignFrame;
import jalview.gui.AlignmentPanel;
import jalview.gui.IProgressIndicator;
import jalview.gui.IProgressIndicatorHandler;
+import jalview.schemes.FeatureSettingsAdapter;
import jalview.ws2.actions.annotation.AnnotationAction;
import jalview.ws2.actions.annotation.AnnotationResult;
import jalview.ws2.actions.api.JobI;
}
@Override
- public void taskCompleted(TaskI<AnnotationResult> source, AnnotationResult result)
+ public void taskCompleted(TaskI<AnnotationResult> source, final AnnotationResult result)
{
if (result == null)
return;
- if (result.getTransferFeatures() && alignFrame.alignPanel == alignPanel)
+ if (result.getTransferFeatures())
{
- alignFrame.getViewport().setShowSequenceFeatures(true);
- alignFrame.setMenusForViewport();
+ alignFrame.getViewport().applyFeaturesStyle(new FeatureSettingsAdapter()
+ {
+ @Override
+ public FeatureColourI getFeatureColour(String type)
+ {
+ return result.getFeatureColours().get(type);
+ }
+
+ @Override
+ public FeatureMatcherSetI getFeatureFilters(String type)
+ {
+ return result.getFeatureFilters().get(type);
+ }
+
+ @Override
+ public boolean isFeatureDisplayed(String type)
+ {
+ return result.getFeatureColours().containsKey(type);
+ }
+ });
+ if (alignFrame.alignPanel == alignPanel)
+ {
+ alignFrame.getViewport().setShowSequenceFeatures(true);
+ alignFrame.setMenusForViewport();
+ }
}
alignPanel.adjustAnnotationHeight();
}