From d7aec3514299dcd8633cc420bf62cbafd3f247de Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 30 Mar 2018 15:40:18 +0100 Subject: [PATCH] JAL-2939 field/method naming more consistent --- src/jalview/datamodel/SequenceGroup.java | 14 ++++++-------- src/jalview/gui/AlignViewport.java | 4 ++++ src/jalview/gui/AnnotationLabels.java | 10 +++++++--- src/jalview/viewmodel/AlignmentViewport.java | 25 ++++++++++++------------- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 2f524c6..aebcbb3 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -134,7 +134,7 @@ public class SequenceGroup implements AnnotatedCollectionI private boolean hmmUseInfoLetterHeight; - private boolean showHMMSequenceLogo; + private boolean hmmShowSequenceLogo; private boolean hmmNormaliseSequenceLogo; @@ -228,7 +228,7 @@ public class SequenceGroup implements AnnotatedCollectionI showSequenceLogo = seqsel.showSequenceLogo; normaliseSequenceLogo = seqsel.normaliseSequenceLogo; showConsensusHistogram = seqsel.showConsensusHistogram; - showHMMSequenceLogo = seqsel.showHMMSequenceLogo; + hmmShowSequenceLogo = seqsel.hmmShowSequenceLogo; hmmNormaliseSequenceLogo = seqsel.hmmNormaliseSequenceLogo; hmmShowHistogram = seqsel.hmmShowHistogram; idColour = seqsel.idColour; @@ -1578,18 +1578,16 @@ public class SequenceGroup implements AnnotatedCollectionI // recalcConservation(); TODO don't know what to do here next } this.hmmShowHistogram = state; - } public boolean isShowHMMSequenceLogo() { - return showHMMSequenceLogo; + return hmmShowSequenceLogo; } - public void setshowHMMSequenceLogo(boolean state) + public void setShowHMMSequenceLogo(boolean state) { - showHMMSequenceLogo = state; - + hmmShowSequenceLogo = state; } public boolean isNormaliseHMMSequenceLogo() @@ -1599,7 +1597,7 @@ public class SequenceGroup implements AnnotatedCollectionI public void setNormaliseHMMSequenceLogo(boolean state) { - normaliseSequenceLogo = state; + hmmNormaliseSequenceLogo = state; } @Override diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 63cbfbd..862c4fb 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -279,6 +279,10 @@ 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); diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 2e70ca1..b1a8aff 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -457,13 +457,15 @@ public class AnnotationLabels extends JPanel if (!ann.groupRef.isUseInfoLetterHeight()) { ann.groupRef.setIgnoreBelowBackground(cbmi.getState()); + // todo and recompute group annotation } } else if (!ap.av.isInfoLetterHeight()) { ap.av.setIgnoreBelowBackground(cbmi.getState(), ap); + // todo and recompute annotation } - ap.alignmentChanged(); + ap.alignmentChanged(); // todo not like this } }); pop.add(cbmi); @@ -480,11 +482,13 @@ public class AnnotationLabels extends JPanel { ann.groupRef.setInfoLetterHeight((letterHeight.getState())); ann.groupRef.setIgnoreBelowBackground(true); + // todo and recompute group annotation } else { ap.av.setInfoLetterHeight(letterHeight.getState(), ap); ap.av.setIgnoreBelowBackground(true, ap); + // todo and recompute annotation } ap.alignmentChanged(); } @@ -513,7 +517,7 @@ public class AnnotationLabels extends JPanel @Override public void actionPerformed(ActionEvent e) { - ann.groupRef.setshowHMMSequenceLogo(cprofl.getState()); + ann.groupRef.setShowHMMSequenceLogo(cprofl.getState()); ap.repaint(); } }); @@ -529,7 +533,7 @@ public class AnnotationLabels extends JPanel ann.groupRef .setNormaliseHMMSequenceLogo(cproflnorm.getState()); // automatically enable logo display if we're clicked - ann.groupRef.setshowHMMSequenceLogo(true); + ann.groupRef.setShowHMMSequenceLogo(true); ap.repaint(); } }); diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 7c0c045..18c2aed 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1028,17 +1028,17 @@ public abstract class AlignmentViewport /** * should hmm profile be rendered by default */ - protected boolean showHMMSequenceLogo = false; + protected boolean hmmShowSequenceLogo = false; /** * should hmm profile be rendered normalised to row height */ - protected boolean normaliseHMMSequenceLogo = false; + protected boolean hmmNormaliseSequenceLogo = false; /** * should information histograms be rendered by default */ - protected boolean showInformationHistogram = true; + protected boolean hmmShowHistogram = true; /** * @return the showConsensusProfile @@ -1055,7 +1055,7 @@ public abstract class AlignmentViewport @Override public boolean isShowHMMSequenceLogo() { - return showHMMSequenceLogo; + return hmmShowSequenceLogo; } /** @@ -1078,14 +1078,14 @@ public abstract class AlignmentViewport public void setShowHMMSequenceLogo(boolean showHMMSequenceLogo) { - if (showHMMSequenceLogo != this.showHMMSequenceLogo) + if (showHMMSequenceLogo != this.hmmShowSequenceLogo) { - this.showHMMSequenceLogo = showHMMSequenceLogo; + this.hmmShowSequenceLogo = showHMMSequenceLogo; // TODO: updateAnnotation if description (tooltip) will show // profile in place of information content? // calculator.updateAnnotationFor(InformationThread.class); } - this.showHMMSequenceLogo = showHMMSequenceLogo; + this.hmmShowSequenceLogo = showHMMSequenceLogo; } /** @@ -1099,11 +1099,10 @@ public abstract class AlignmentViewport /** * @param showInformationHistogram - * the showInformationHistogram to set */ public void setShowInformationHistogram(boolean showInformationHistogram) { - this.showInformationHistogram = showInformationHistogram; + this.hmmShowHistogram = showInformationHistogram; } /** @@ -1159,7 +1158,7 @@ public abstract class AlignmentViewport @Override public boolean isShowInformationHistogram() { - return this.showInformationHistogram; + return this.hmmShowHistogram; } /** @@ -2275,7 +2274,7 @@ public abstract class AlignmentViewport sg.setshowSequenceLogo(showprf); sg.setShowConsensusHistogram(showConsHist); sg.setNormaliseSequenceLogo(normLogo); - sg.setshowHMMSequenceLogo(showHMMPrf); + sg.setShowHMMSequenceLogo(showHMMPrf); sg.setShowInformationHistogram(showInfoHist); sg.setNormaliseHMMSequenceLogo(normHMMLogo); } @@ -3077,11 +3076,11 @@ public abstract class AlignmentViewport @Override public boolean isNormaliseHMMSequenceLogo() { - return normaliseHMMSequenceLogo; + return hmmNormaliseSequenceLogo; } public void setNormaliseHMMSequenceLogo(boolean state) { - normaliseHMMSequenceLogo = state; + hmmNormaliseSequenceLogo = state; } } -- 1.7.10.2