+++ /dev/null
-package jalview.api;
-
-import java.util.Comparator;
-
-/**
- * An interface that describes the settings configurable in the Feature Settings
- * dialog.
- *
- * @author gmcarstairs
- *
- */
-public interface FeatureSettingsI extends Comparator<String>
-{
- // note Java 8 will allow default implementations of these methods in the
- // interface, simplifying instantiating classes
-
- /**
- * Answers true if the specified feature type is displayed
- *
- * @param type
- * @return
- */
- boolean isFeatureDisplayed(String type);
-
- /**
- * Answers true if the specified feature group is displayed
- *
- * @param group
- * @return
- */
- boolean isGroupDisplayed(String group);
-
- /**
- * Returns the colour (or graduated colour) for the feature type, or null if
- * not known
- *
- * @param type
- * @return
- */
- FeatureColourI getFeatureColour(String type);
-
- /**
- * Returns the transparency value, from 0 (fully transparent) to 1 (fully
- * opaque)
- *
- * @return
- */
- float getTransparency();
-
- /**
- * Returns -1 if feature1 'precedes' (is displayed on top of) feature 2, +1 if
- * feature2 is on top of feature1, or 0 if we don't care
- *
- * @param feature1
- * @param feature2
- * @return
- */
- @Override
- int compare(String feature1, String feature2);
-
- /**
- * Answers true if features should be initially sorted so that features with a
- * shorter average length are displayed on top of those with a longer average
- * length
- *
- * @return
- */
- boolean optimiseOrder();
-}
*/
package jalview.api;
-public interface FeatureSettingsModelI
+import java.util.Comparator;
+
+/**
+ * An interface that describes the settings configurable in the Feature Settings
+ * dialog.
+ *
+ * @author gmcarstairs
+ */
+public interface FeatureSettingsModelI extends Comparator<String>
{
+ // note Java 8 will allow default implementations of these methods in the
+ // interface, simplifying instantiating classes
+
+ /**
+ * Answers true if the specified feature type is displayed
+ *
+ * @param type
+ * @return
+ */
+ boolean isFeatureDisplayed(String type);
+
+ /**
+ * Answers true if the specified feature group is displayed
+ *
+ * @param group
+ * @return
+ */
+ boolean isGroupDisplayed(String group);
+
+ /**
+ * Returns the colour (or graduated colour) for the feature type, or null if
+ * not known
+ *
+ * @param type
+ * @return
+ */
+ FeatureColourI getFeatureColour(String type);
+
+ /**
+ * Returns the transparency value, from 0 (fully transparent) to 1 (fully
+ * opaque)
+ *
+ * @return
+ */
+ float getTransparency();
+
+ /**
+ * Returns -1 if feature1 'precedes' (is displayed on top of) feature 2, +1 if
+ * feature2 is on top of feature1, or 0 if we don't care
+ *
+ * @param feature1
+ * @param feature2
+ * @return
+ */
+ @Override
+ int compare(String feature1, String feature2);
+
+ /**
+ * Answers true if features should be initially sorted so that features with a
+ * shorter average length are displayed on top of those with a longer average
+ * length
+ *
+ * @return
+ */
+ boolean optimiseOrder();
+
}
package jalview.ext.ensembl;
import jalview.api.FeatureColourI;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceFeature;
return ACCESSION_REGEX;
}
+ /**
+ * Returns a descriptor for suitable feature display settings with
+ * <ul>
+ * <li>only exon or sequence_variant features (or their subtypes in the
+ * Sequence Ontology) visible</li>
+ * <li>variant features coloured red</li>
+ * <li>exon features coloured by label (exon name)</li>
+ * <li>variants displayed above (on top of) exons</li>
+ * </ul>
+ */
@Override
- public FeatureSettingsI getFeatureColourScheme()
+ public FeatureSettingsModelI getFeatureColourScheme()
{
return new FeatureSettingsAdapter()
{
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureSettingsControllerI;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
import jalview.api.SplitContainerI;
import jalview.api.ViewStyleI;
import jalview.api.analysis.ScoreModelI;
*/
ASequenceFetcher sftch = new SequenceFetcher();
List<DbSourceProxy> proxies = sftch.getSourceProxy(source);
- FeatureSettingsI featureColourScheme = null;
+ FeatureSettingsModelI featureColourScheme = null;
for (DbSourceProxy proxy : proxies)
{
- FeatureSettingsI preferredColours = proxy
+ FeatureSettingsModelI preferredColours = proxy
.getFeatureColourScheme();
if (preferredColours != null)
{
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureColourI;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
import jalview.api.FeaturesDisplayedI;
import jalview.api.ViewStyleI;
import jalview.bin.Cache;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
-import java.util.Map;
import java.util.Vector;
import javax.swing.JInternalFrame;
*
* @param featureSettings
*/
- public void applyFeaturesStyle(FeatureSettingsI featureSettings)
+ public void applyFeaturesStyle(FeatureSettingsModelI featureSettings)
{
if (featureSettings == null)
{
FeatureRenderer fr = getAlignPanel().getSeqPanel().seqCanvas
.getFeatureRenderer();
- Map<String, Object> featureColours = fr.getFeatureColours();
fr.findAllFeatures(true);
List<String> renderOrder = fr.getRenderOrder();
FeaturesDisplayedI displayed = fr.getFeaturesDisplayed();
*/
package jalview.gui;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceFeature;
Iterator<String> en = Arrays.asList(new String[0]).iterator();
int nqueries = qries.length;
- FeatureSettingsI preferredFeatureColours = null;
+ FeatureSettingsModelI preferredFeatureColours = null;
while (proxies.hasNext() && (en.hasNext() || nextfetch.size() > 0))
{
if (!en.hasNext() && nextfetch.size() > 0)
// Stack results ready for opening in alignment windows
if (aresult != null && aresult.size() > 0)
{
- FeatureSettingsI proxyColourScheme = proxy.getFeatureColourScheme();
+ FeatureSettingsModelI proxyColourScheme = proxy
+ .getFeatureColourScheme();
if (proxyColourScheme != null)
{
preferredFeatureColours = proxyColourScheme;
}
AlignmentI parseResult(AlignmentI al, String title,
- String currentFileFormat, FeatureSettingsI preferredFeatureColours)
+ String currentFileFormat,
+ FeatureSettingsModelI preferredFeatureColours)
{
if (al != null && al.getHeight() > 0)
package jalview.schemes;
import jalview.api.FeatureColourI;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
/**
* An adapter class that may be extended to instantiate feature colour schemes
*/
-public class FeatureSettingsAdapter implements FeatureSettingsI
+public class FeatureSettingsAdapter implements FeatureSettingsModelI
{
@Override
*/
package jalview.ws.seqfetcher;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
import jalview.datamodel.AlignmentI;
import com.stevesoft.pat.Regex;
*
* @return
*/
- FeatureSettingsI getFeatureColourScheme();
+ FeatureSettingsModelI getFeatureColourScheme();
}
\ No newline at end of file
*/
package jalview.ws.seqfetcher;
-import jalview.api.FeatureSettingsI;
+import jalview.api.FeatureSettingsModelI;
import jalview.datamodel.AlignmentI;
import jalview.io.FormatAdapter;
import jalview.io.IdentifyFile;
}
@Override
- public FeatureSettingsI getFeatureColourScheme()
+ public FeatureSettingsModelI getFeatureColourScheme()
{
return null;
}