void setMenusForViewport();
void changeColour(ColourSchemeI cs);
+
+ /**
+ * trigger an update of the UI in response to a model data change, and if
+ * necessary enable the display of sequence feature annotation on the view.
+ *
+ * @param enableIfNecessary
+ */
+ void refreshFeatureUI(boolean enableIfNecessary);
+
+ /**
+ * get the Feature Settings control panel for the alignment view if one exists
+ *
+ * @return
+ */
+ FeatureSettingsControllerI getFeatureSettingsUI();
}
*/
void sortAlignmentByFeatureDensity(String[] typ);
+ /**
+ * add a features file of some kind to the current view
+ *
+ * @param file
+ * @param protocol
+ * @param relaxedIdMatching
+ * if true, try harder to match up IDs with local sequence data
+ * @return true if parsing resulted in something being imported to the view or
+ * dataset
+ */
+ public boolean parseFeaturesFile(String file, String protocol,
+ boolean relaxedIdMatching);
+
}
import jalview.api.AlignViewControllerI;
import jalview.api.AlignViewportI;
import jalview.api.FeatureRenderer;
+import jalview.api.FeatureSettingsControllerI;
import jalview.api.SequenceStructureBinding;
import jalview.bin.JalviewLite;
import jalview.commands.CommandI;
{
this.splitFrame = sf;
}
-
+ // may not need this
@Override
public void setShowSeqFeatures(boolean b)
{
// setMenusFromViewport(viewport);
}
+ @Override
+ public void refreshFeatureUI(boolean enableIfNecessary)
+ {
+ if (enableIfNecessary)
+ {
+ sequenceFeatures.setState(true);
+ alignPanel.av.setShowSequenceFeatures(true);
+ }
+ }
+
+ @Override
+ public FeatureSettingsControllerI getFeatureSettingsUI()
+ {
+ return alignPanel.av.featureSettings;
+ }
+
}
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+import jalview.io.FeaturesFile;
import jalview.util.MessageManager;
import java.awt.Color;
{
sortBy(typ, "Sort by Feature Score", AlignmentSorter.FEATURE_SCORE);
}
+
+ @Override
+ public boolean parseFeaturesFile(String file, String protocol,
+ boolean relaxedIdMatching)
+ {
+ boolean featuresFile = false;
+ try
+ {
+ featuresFile = new FeaturesFile(file, protocol).parse(viewport
+ .getAlignment().getDataset(), alignPanel.getFeatureRenderer()
+ .getFeatureColours(), false, relaxedIdMatching);
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ if (featuresFile)
+ {
+ avcg.refreshFeatureUI(true);
+ if (alignPanel.getFeatureRenderer() != null)
+ {
+ // update the min/max ranges where necessary
+ alignPanel.getFeatureRenderer().findAllFeatures(true);
+ }
+ if (avcg.getFeatureSettingsUI() != null)
+ {
+ avcg.getFeatureSettingsUI().discoverAllFeatureData();
+ }
+ alignPanel.paintAlignment(true);
+ }
+
+ return featuresFile;
+
+ }
}
import jalview.api.AlignViewControllerI;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
-import jalview.api.SplitContainerI;
import jalview.api.ViewStyleI;
import jalview.api.analysis.ScoreModelI;
import jalview.bin.Cache;
import jalview.io.AlignmentProperties;
import jalview.io.AnnotationFile;
import jalview.io.BioJsHTMLOutput;
-import jalview.io.FeaturesFile;
import jalview.io.FileLoader;
import jalview.io.FormatAdapter;
import jalview.io.HtmlSvgOutput;
public FeatureSettings featureSettings;
@Override
+ public FeatureSettingsControllerI getFeatureSettingsUI()
+ {
+ return featureSettings;
+ }
+
+ @Override
public void featureSettings_actionPerformed(ActionEvent e)
{
if (featureSettings != null)
* contents or path to retrieve file
* @param type
* access mode of file (see jalview.io.AlignFile)
- * @return true if features file was parsed corectly.
+ * @return true if features file was parsed correctly.
*/
public boolean parseFeaturesFile(String file, String type)
{
- boolean featuresFile = false;
- try
- {
- featuresFile = new FeaturesFile(file, type).parse(viewport
- .getAlignment().getDataset(), alignPanel.getSeqPanel().seqCanvas
- .getFeatureRenderer().getFeatureColours(), false,
- jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false));
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
+ return avc.parseFeaturesFile(file, type,
+ jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false));
+
+ }
- if (featuresFile)
+ @Override
+ public void refreshFeatureUI(boolean enableIfNecessary)
+ {
+ // note - currently this is only still here rather than in the controller
+ // because of the featureSettings hard reference that is yet to be
+ // abstracted
+ if (enableIfNecessary)
{
viewport.setShowSequenceFeatures(true);
showSeqFeatures.setSelected(true);
- if (alignPanel.getSeqPanel().seqCanvas.fr != null)
- {
- // update the min/max ranges where necessary
- alignPanel.getSeqPanel().seqCanvas.fr.findAllFeatures(true);
- }
- if (featureSettings != null)
- {
- featureSettings.setTableData();
- }
- alignPanel.paintAlignment(true);
}
- return featuresFile;
- }
+ }
@Override
public void dragEnter(DropTargetDragEvent evt)
{
import jalview.api.FeatureSettingsModelI;
-public class FeatureSettingsModel implements FeatureSettingsModelI
+public abstract class FeatureSettingsModel implements FeatureSettingsModelI
{
}