From: Renia Correya Date: Wed, 3 Jul 2024 13:59:11 +0000 (+0100) Subject: JAL-4392 Code refactoring X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1267f8bcd68912036647fa1f9804f1b942e5d1c6;p=jalview.git JAL-4392 Code refactoring Replaced the usage of Message.properties in non UI classes --- diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 29e18a6..7a33baf 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -772,8 +772,8 @@ public class SequenceGroup implements AnnotatedCollectionI continue; } - aa.label = MessageManager.getString("label.ssconsensus_label") + " " + ssSource + " " + getName(); - aa.description = ssSource + MessageManager.getString("label.ssconsensus_label") +" for " + getName(); + aa.label = Constants.SECONDARY_STRUCTURE_CONSENSUS_LABEL + " " + ssSource + " " + getName(); + aa.description = ssSource + Constants.SECONDARY_STRUCTURE_CONSENSUS_LABEL +" for " + getName(); ssConsensusData = profile; // preserve width if already set int aWidth = (aa.annotations != null) @@ -1269,8 +1269,8 @@ public class SequenceGroup implements AnnotatedCollectionI aa.autoCalculated = true; aa.groupRef = this; - aa.label = MessageManager.getString("label.ssconsensus_label") + " " + ssSource + " " + getName(); - aa.description = ssSource + MessageManager.getString("label.ssconsensus_label") +" for " + getName(); + aa.label = Constants.SECONDARY_STRUCTURE_CONSENSUS_LABEL + " " + ssSource + " " + getName(); + aa.description = ssSource + Constants.SECONDARY_STRUCTURE_CONSENSUS_LABEL +" for " + getName(); ssConsensus.add(aa); } diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 7c360c2..f46019e 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -58,7 +58,7 @@ import jalview.schemes.ColourSchemeI; import jalview.schemes.NucleotideColourScheme; import jalview.schemes.ResidueProperties; import jalview.schemes.ZappoColourScheme; -import jalview.util.MessageManager; +import jalview.util.Constants; import jalview.util.Platform; public class AnnotationRenderer @@ -434,7 +434,7 @@ public class AnnotationRenderer } } - if(aa.autoCalculated && aa.label.startsWith(MessageManager.getString("label.ssconsensus_label"))) + if(aa.autoCalculated && aa.label.startsWith(Constants.SECONDARY_STRUCTURE_CONSENSUS_LABEL)) { if(aa.groupRef != null && aa.groupRef.hSSConsensusProfileMap != null @@ -1640,7 +1640,7 @@ public class AnnotationRenderer colour = profcolour.findColour(codonTranslation.charAt(0), column, null); } - if(_aa.label.startsWith(MessageManager.getString("label.ssconsensus_label"))) { + if(_aa.label.startsWith(Constants.SECONDARY_STRUCTURE_CONSENSUS_LABEL)) { colour = AlignmentUtils.getSecondaryStructureAnnotationColour(dc[0]); } else diff --git a/src/jalview/util/Constants.java b/src/jalview/util/Constants.java index 59f88ae..27513ab 100644 --- a/src/jalview/util/Constants.java +++ b/src/jalview/util/Constants.java @@ -52,4 +52,7 @@ public class Constants //generic secondary structure provider options public static final String SS_ALL_PROVIDERS = "All"; public static final String SS_NONE_PROVIDER = "None"; + + //Secondary structure consensus label + public static final String SECONDARY_STRUCTURE_CONSENSUS_LABEL = "Secondary Structure Consensus"; }