JAL-4392 Code refactoring
authorRenia Correya <rcorreya001@dundee.ac.uk>
Wed, 3 Jul 2024 13:59:11 +0000 (14:59 +0100)
committerRenia Correya <rcorreya001@dundee.ac.uk>
Wed, 3 Jul 2024 13:59:11 +0000 (14:59 +0100)
Replaced the usage of Message.properties in non UI classes

src/jalview/datamodel/SequenceGroup.java
src/jalview/renderer/AnnotationRenderer.java
src/jalview/util/Constants.java

index 29e18a6..7a33baf 100755 (executable)
@@ -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);
       }
      
index 7c360c2..f46019e 100644 (file)
@@ -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
index 59f88ae..27513ab 100644 (file)
@@ -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";
 }