* Set whether view should scroll to show the highlighted region of a sequence
*/
void setFollowHighlight(boolean b);
+
+ public void applyFeaturesStyle(FeatureSettingsModelI featureSettings);
}
import jalview.analysis.NJTree;
import jalview.api.AlignViewportI;
+import jalview.api.FeatureSettingsModelI;
import jalview.bin.JalviewLite;
import jalview.commands.CommandI;
import jalview.datamodel.AlignmentI;
private AnnotationColumnChooser annotationColumnSelectionState;
+ @Override
public void finalize()
{
applet = null;
return followSelection;
}
+ @Override
public void sendSelection()
{
getStructureSelectionManager().sendSelection(
}
}
+ @Override
public boolean isNormaliseSequenceLogo()
{
return normaliseSequenceLogo;
*
* @return true if alignment characters should be displayed
*/
+ @Override
public boolean isValidCharWidth()
{
return validCharWidth;
}
}
+ /**
+ * Applies the supplied feature settings descriptor to currently known
+ * features. This supports an 'initial configuration' of feature colouring
+ * based on a preset or user favourite. This may then be modified in the usual
+ * way using the Feature Settings dialogue.
+ *
+ * @param featureSettings
+ */
+ @Override
+ public void applyFeaturesStyle(FeatureSettingsModelI featureSettings)
+ {
+ // TODO implement for applet
+ }
+
}
private final static String DEFAULT_FAIL_SAFE_PID_THRESHOLD = "30";
- private final static String DEFAULT_STRUCTURE_FOMART = DBRefSource.MMCIF;
+ private final static String DEFAULT_STRUCTURE_FORMAT = DBRefSource.MMCIF;
/**
* Initialises the Jalview Application Log
.println("Jalview Version: " + codeVersion + codeInstallation);
Pdb.setCurrentDefaultFomart(jalview.bin.Cache.getDefault(
- "DEFAULT_STRUCTURE_FOMART", DEFAULT_STRUCTURE_FOMART));
+ "DEFAULT_STRUCTURE_FORMAT", DEFAULT_STRUCTURE_FORMAT));
// jnlpVersion will be null if we're using InstallAnywhere
// Dont do this check if running in headless mode
if (jnlpVersion == null
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import jalview.api.ComplexAlignFile;
+import jalview.api.FeatureSettingsModelI;
import jalview.api.FeaturesDisplayedI;
import jalview.api.FeaturesSourceI;
import jalview.bin.Jalview;
{
String title = MessageManager.formatMessage(
"label.input_cut_paste_params", new String[] { format });
+ FeatureSettingsModelI proxyColourScheme = source
+ .getFeatureColourScheme();
+
/*
* if the view panel was closed its alignment is nulled
* and this is an orphaned cut and paste window
*/
if (viewport != null && viewport.getAlignment() != null)
{
+ if (proxyColourScheme != null)
+ {
+ viewport.applyFeaturesStyle(proxyColourScheme);
+ }
((AlignViewport) viewport).addAlignment(al, title);
}
else
af.getViewport().setShowSequenceFeatures(true);
}
}
-
+ if (proxyColourScheme != null)
+ {
+ af.getViewport().applyFeaturesStyle(proxyColourScheme);
+ }
af.currentFileFormat = format;
Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
{
new FileLoader().LoadFile(viewport, choice, FormatAdapter.FILE,
format);
- // viewport.setShowSequenceFeatures(JSONFile.isSeqFeaturesEnabled());
- // AlignFrame af = viewport.getAlignPanel().alignFrame;
- // if (af != null)
- // {
- // af.changeColour(JSONFile.getColourScheme());
- // af.setMenusForViewport();
- // }
}
else
{
package jalview.io;
import jalview.api.ComplexAlignFile;
+import jalview.api.FeatureSettingsModelI;
import jalview.api.FeaturesDisplayedI;
import jalview.api.FeaturesSourceI;
import jalview.bin.Jalview;
}
}
+ FeatureSettingsModelI proxyColourScheme = source
+ .getFeatureColourScheme();
if (viewport != null)
{
+ if (proxyColourScheme != null)
+ {
+ viewport.applyFeaturesStyle(proxyColourScheme);
+ }
// append to existing alignment
viewport.addAlignment(al, title);
}
{
alignFrame.setFileName(file, format);
}
-
+ if (proxyColourScheme != null)
+ {
+ alignFrame.getViewport()
+ .applyFeaturesStyle(proxyColourScheme);
+ }
alignFrame.statusBar.setText(MessageManager.formatMessage(
"label.successfully_loaded_file",
new String[] { title }));
import jalview.api.AlignExportSettingI;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
+import jalview.api.FeatureSettingsModelI;
import jalview.util.MessageManager;
import java.io.BufferedReader;
}
// could also set export/import settings
}
+
+ /**
+ * Returns the preferred feature colour configuration if there is one, else
+ * null
+ *
+ * @return
+ */
+ public FeatureSettingsModelI getFeatureColourScheme()
+ {
+ return null;
+ }
}
package jalview.io;
import jalview.api.ComplexAlignFile;
+import jalview.api.FeatureSettingsModelI;
import jalview.api.FeaturesDisplayedI;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.SequenceI;
"Print method of HtmlFile is not supported!");
}
+ @Override
public boolean isShowSeqFeatures()
{
return showSeqFeatures;
this.showSeqFeatures = showSeqFeatures;
}
+ @Override
public String getGlobalColourScheme()
{
return globalColourScheme;
this.globalColourScheme = globalColourScheme;
}
+ @Override
public ColumnSelection getColumnSelection()
{
return columnSelection;
this.columnSelection = columnSelection;
}
+ @Override
public SequenceI[] getHiddenSequences()
{
return hiddenSequences;
return displayedFeatures;
}
+ /**
+ * Returns a descriptor for suitable feature display settings with
+ * <ul>
+ * <li>ResNums or insertions features visible</li>
+ * <li>insertions features coloured red</li>
+ * <li>ResNum features coloured by label</li>
+ * <li>Insertions displayed above (on top of) ResNums</li>
+ * </ul>
+ */
+ @Override
+ public FeatureSettingsModelI getFeatureColourScheme()
+ {
+ return new PDBFeatureSettings();
+ }
+
}
import jalview.api.AlignmentViewPanel;
import jalview.api.ComplexAlignFile;
import jalview.api.FeatureRenderer;
+import jalview.api.FeatureSettingsModelI;
import jalview.api.FeaturesDisplayedI;
import jalview.bin.BuildDetails;
import jalview.datamodel.AlignmentAnnotation;
}
}
+ @Override
public String getGlobalColourScheme()
{
return globalColourScheme;
this.displayedFeatures = displayedFeatures;
}
+ @Override
public void configureForView(AlignmentViewPanel avpanel)
{
super.configureForView(avpanel);
}
+ @Override
public boolean isShowSeqFeatures()
{
return showSeqFeatures;
return hiddenColumns;
}
+ @Override
public ColumnSelection getColumnSelection()
{
return columnSelection;
this.columnSelection = columnSelection;
}
+ @Override
public SequenceI[] getHiddenSequences()
{
if (hiddenSequences == null || hiddenSequences.isEmpty())
this.exportJalviewSettings = exportJalviewSettings;
}
}
+
+ /**
+ * Returns a descriptor for suitable feature display settings with
+ * <ul>
+ * <li>ResNums or insertions features visible</li>
+ * <li>insertions features coloured red</li>
+ * <li>ResNum features coloured by label</li>
+ * <li>Insertions displayed above (on top of) ResNums</li>
+ * </ul>
+ */
+ @Override
+ public FeatureSettingsModelI getFeatureColourScheme()
+ {
+ return new PDBFeatureSettings();
+ }
}
--- /dev/null
+package jalview.io;
+
+import jalview.api.FeatureColourI;
+import jalview.schemes.FeatureColourAdapter;
+import jalview.schemes.FeatureSettingsAdapter;
+import jalview.ws.dbsources.Pdb;
+
+import java.awt.Color;
+
+public class PDBFeatureSettings extends FeatureSettingsAdapter
+{
+
+ @Override
+ public boolean isFeatureDisplayed(String type)
+ {
+ return type.equalsIgnoreCase(Pdb.FEATURE_INSERTION)
+ || type.equalsIgnoreCase(Pdb.FEATURE_RES_NUM);
+ }
+
+ @Override
+ public FeatureColourI getFeatureColour(String type)
+ {
+ if (type.equalsIgnoreCase(Pdb.FEATURE_INSERTION))
+ {
+ return new FeatureColourAdapter()
+ {
+
+ @Override
+ public Color getColour()
+ {
+ return Color.RED;
+ }
+ };
+ }
+ return null;
+ }
+
+ /**
+ * Order to render insertion after ResNum
+ */
+ @Override
+ public int compare(String feature1, String feature2)
+ {
+ if (feature1.equalsIgnoreCase(Pdb.FEATURE_INSERTION))
+ {
+ return +1;
+ }
+ if (feature2.equalsIgnoreCase(Pdb.FEATURE_INSERTION))
+ {
+ return -1;
+ }
+ if (feature1.equalsIgnoreCase(Pdb.FEATURE_RES_NUM))
+ {
+ return +1;
+ }
+ if (feature2.equalsIgnoreCase(Pdb.FEATURE_RES_NUM))
+ {
+ return -1;
+ }
+ return 0;
+ }
+}
+
package jalview.io;
import jalview.analysis.AlignSeq;
+import jalview.api.FeatureSettingsModelI;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
{
this.dbRefType = dbRefType;
}
+
+ /**
+ * Returns a descriptor for suitable feature display settings with
+ * <ul>
+ * <li>ResNums or insertions features visible</li>
+ * <li>insertions features coloured red</li>
+ * <li>ResNum features coloured by label</li>
+ * <li>Insertions displayed above (on top of) ResNums</li>
+ * </ul>
+ */
+ @Override
+ public FeatureSettingsModelI getFeatureColourScheme()
+ {
+ return new PDBFeatureSettings();
+ }
}
*/
package jalview.ws.dbsources;
+import jalview.api.FeatureSettingsModelI;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.io.FormatAdapter;
+import jalview.io.PDBFeatureSettings;
import jalview.util.MessageManager;
import jalview.ws.ebi.EBIFetchClient;
super();
}
+ public static final String FEATURE_INSERTION = "INSERTION";
+
+ public static final String FEATURE_RES_NUM = "RESNUM";
+
private static String currentDefaultFomart = DBRefSource.MMCIF;
/*
{
Pdb.currentDefaultFomart = currentDefaultFomart;
}
+
+ /**
+ * Returns a descriptor for suitable feature display settings with
+ * <ul>
+ * <li>ResNums or insertions features visible</li>
+ * <li>insertions features coloured red</li>
+ * <li>ResNum features coloured by label</li>
+ * <li>Insertions displayed above (on top of) ResNums</li>
+ * </ul>
+ */
+ @Override
+ public FeatureSettingsModelI getFeatureColourScheme()
+ {
+ return new PDBFeatureSettings();
+ }
}