From eb735a1925bb9387a532f3f89b6eba3eab695e85 Mon Sep 17 00:00:00 2001 From: tva Date: Wed, 5 Jun 2019 13:24:28 +0100 Subject: [PATCH] JAL-3285 add unmerged features to AlignViewport --- src/jalview/gui/AlignViewport.java | 50 +++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 847084d..0b40abd 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -92,12 +92,6 @@ public class AlignViewport extends AlignmentViewport private AnnotationColumnChooser annotationColumnSelectionState; - boolean validCharWidth; - - public boolean followSelection = true; - - private Hashtable calcIdParams = new Hashtable<>(); - /** * Creates a new AlignViewport object. * @@ -260,18 +254,13 @@ public class AlignViewport extends AlignmentViewport setFont(new Font(fontName, style, Integer.parseInt(fontSize)), true); - AlignmentI al = getAlignment(); - - if (Cache.getDefault("NORMALISE_GAPS", true)) - { - al.setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0)); - } + alignment.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 (consensusProfiles == null && !isDataset) + if (hconsensus == null && !isDataset) { - if (!al.isNucleotide()) + if (!alignment.isNucleotide()) { showConservation = Cache.getDefault("SHOW_CONSERVATION", true); showQuality = Cache.getDefault("SHOW_QUALITY", true); @@ -295,7 +284,7 @@ public class AlignViewport extends AlignmentViewport initAutoAnnotation(); // initInformation(); - String colourProperty = al.isNucleotide() + String colourProperty = alignment.isNucleotide() ? Preferences.DEFAULT_COLOUR_NUC : Preferences.DEFAULT_COLOUR_PROT; String schemeName = Cache.getProperty(colourProperty); @@ -318,10 +307,12 @@ public class AlignViewport extends AlignmentViewport if (residueShading != null) { - residueShading.setConsensus(consensusProfiles); + residueShading.setConsensus(hconsensus); } setColourAppliesToAllGroups(true); } + + boolean validCharWidth; /** * {@inheritDoc} @@ -405,9 +396,9 @@ public class AlignViewport extends AlignmentViewport /* * replace mappings on our alignment */ - if (getAlignment() != null && align != null) + if (alignment != null && align != null) { - getAlignment().setCodonFrames(align.getCodonFrames()); + alignment.setCodonFrames(align.getCodonFrames()); } } @@ -476,11 +467,11 @@ public class AlignViewport extends AlignmentViewport } else { - end = getAlignment().getWidth(); + end = alignment.getWidth(); } - return getAlignment().getHiddenColumns().getVisContigsIterator(start, - end, false); + return (alignment.getHiddenColumns().getVisContigsIterator(start, + end, false)); } /** @@ -529,6 +520,8 @@ 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 @@ -593,6 +586,19 @@ public class AlignViewport extends AlignmentViewport return StructureSelectionManager .getStructureSelectionManager(Desktop.instance); } + + @Override + public boolean isNormaliseSequenceLogo() + { + return normaliseSequenceLogo; + } + + @Override +public void setNormaliseSequenceLogo(boolean state) + { + normaliseSequenceLogo = state; + } + /** * @@ -603,6 +609,8 @@ public class AlignViewport extends AlignmentViewport { return validCharWidth; } + + private Hashtable calcIdParams = new Hashtable<>(); public AutoCalcSetting getCalcIdSettingsFor(String calcId) { -- 1.7.10.2