X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=39ded7f633049aab1db2b626494a44db237815c9;hb=1903e771d3dae79e9a57fcc1147efd37e8a51421;hp=7e77becc3f2c9e32cd2a17a5ebf271db13a613f2;hpb=39267ff67b3f5cabdf20ea468b9e86739223adf5;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 7e77bec..39ded7f 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -92,6 +92,12 @@ public class AlignViewport extends AlignmentViewport private AnnotationColumnChooser annotationColumnSelectionState; + boolean validCharWidth; + + public boolean followSelection = true; + + private Hashtable calcIdParams = new Hashtable<>(); + /** * Creates a new AlignViewport object. * @@ -254,14 +260,18 @@ public class AlignViewport extends AlignmentViewport setFont(new Font(fontName, style, Integer.parseInt(fontSize)), true); - alignment - .setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0)); + AlignmentI al = getAlignment(); + + if (Cache.getDefault("NORMALISE_GAPS", true)) + { + al.setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0)); + } // We must set conservation and consensus before setting colour, // as Blosum and Clustal require this to be done - if (hconsensus == null && !isDataset) + if (consensusProfiles == null && !isDataset) { - if (!alignment.isNucleotide()) + if (!al.isNucleotide()) { showConservation = Cache.getDefault("SHOW_CONSERVATION", true); showQuality = Cache.getDefault("SHOW_QUALITY", true); @@ -273,13 +283,19 @@ public class AlignViewport extends AlignmentViewport showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", false); normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO", false); + // for now, use consensus options for Information till it gets its own + setShowHMMSequenceLogo(showSequenceLogo); + setNormaliseHMMSequenceLogo(normaliseSequenceLogo); + setShowInformationHistogram(showConsensusHistogram); showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false); showConsensus = Cache.getDefault("SHOW_IDENTITY", true); showOccupancy = Cache.getDefault(Preferences.SHOW_OCCUPANCY, true); } initAutoAnnotation(); - String colourProperty = alignment.isNucleotide() + // initInformation(); + + String colourProperty = al.isNucleotide() ? Preferences.DEFAULT_COLOUR_NUC : Preferences.DEFAULT_COLOUR_PROT; String schemeName = Cache.getProperty(colourProperty); @@ -290,7 +306,7 @@ public class AlignViewport extends AlignmentViewport ResidueColourScheme.NONE); } ColourSchemeI colourScheme = ColourSchemeProperty - .getColourScheme(alignment, schemeName); + .getColourScheme(al, schemeName); residueShading = new ResidueShader(colourScheme); if (colourScheme instanceof UserColourScheme) @@ -302,12 +318,10 @@ public class AlignViewport extends AlignmentViewport if (residueShading != null) { - residueShading.setConsensus(hconsensus); + residueShading.setConsensus(consensusProfiles); } } - boolean validCharWidth; - /** * {@inheritDoc} */ @@ -390,9 +404,9 @@ public class AlignViewport extends AlignmentViewport /* * replace mappings on our alignment */ - if (alignment != null && align != null) + if (getAlignment() != null && align != null) { - alignment.setCodonFrames(align.getCodonFrames()); + getAlignment().setCodonFrames(align.getCodonFrames()); } } @@ -443,7 +457,7 @@ public class AlignViewport extends AlignmentViewport } /** - * returns the visible column regions of the alignment + * Returns an iterator over the visible column regions of the alignment * * @param selectedRegionOnly * true to just return the contigs intersecting with the selected @@ -461,10 +475,11 @@ public class AlignViewport extends AlignmentViewport } else { - end = alignment.getWidth(); + end = getAlignment().getWidth(); } - return (alignment.getHiddenColumns().getVisContigsIterator(start, end, - false)); + + return getAlignment().getHiddenColumns().getVisContigsIterator(start, + end, false); } /** @@ -513,8 +528,6 @@ public class AlignViewport extends AlignmentViewport return false; } - public boolean followSelection = true; - /** * @return true if view selection should always follow the selections * broadcast by other selection sources @@ -580,17 +593,6 @@ public class AlignViewport extends AlignmentViewport .getStructureSelectionManager(Desktop.instance); } - @Override - public boolean isNormaliseSequenceLogo() - { - return normaliseSequenceLogo; - } - - public void setNormaliseSequenceLogo(boolean state) - { - normaliseSequenceLogo = state; - } - /** * * @return true if alignment characters should be displayed @@ -601,8 +603,6 @@ public class AlignViewport extends AlignmentViewport return validCharWidth; } - private Hashtable calcIdParams = new Hashtable<>(); - public AutoCalcSetting getCalcIdSettingsFor(String calcId) { return calcIdParams.get(calcId); @@ -1032,4 +1032,5 @@ public class AlignViewport extends AlignmentViewport } fr.setTransparency(featureSettings.getTransparency()); } + }