JAL-2171 matching bracket default character for rna SS entry
[jalview.git] / src / jalview / appletgui / AnnotationPanel.java
index 823bbfd..ee8c9ca 100755 (executable)
@@ -27,6 +27,7 @@ import jalview.renderer.AnnotationRenderer;
 import jalview.renderer.AwtRenderPanelI;
 import jalview.util.Comparison;
 import jalview.util.MessageManager;
+import jalview.util.Platform;
 
 import java.awt.Color;
 import java.awt.Dimension;
@@ -100,7 +101,8 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI,
 
   public AnnotationPanel(AlignmentPanel ap)
   {
-    MAC = new jalview.util.Platform().isAMac();
+    new jalview.util.Platform();
+    MAC = Platform.isAMac();
     this.ap = ap;
     av = ap.av;
     setLayout(null);
@@ -241,11 +243,10 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI,
       else if (evt.getActionCommand().equals(STEM))
       {
         type = 'S';
-        symbol = "(";// "\u03C3"; sigma
+        int column = av.getColumnSelection().getSelectedRanges().get(0)[0];
+        symbol = aa[activeRow].getDefaultRnaHelixSymbol(column);
       }
 
-      symbol = getCurrentAnnotationCharacter(anot, symbol);
-
       if (!aa[activeRow].hasIcons)
       {
         aa[activeRow].hasIcons = true;
@@ -725,38 +726,4 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI,
       return null;
     }
   }
-
-  /**
-   * Returns the current annotation symbol (if any) within the visible selected
-   * columns (first symbol found left to right in selection). If none is found,
-   * the supplied default value is returned.
-   * 
-   * @param annotations
-   * @param defaultValue
-   * @return
-   */
-  String getCurrentAnnotationCharacter(Annotation[] annotations,
-          String defaultValue)
-  {
-    String result = defaultValue;
-    for (int index : av.getColumnSelection().getSelected())
-    {
-      if (!av.getColumnSelection().isVisible(index))
-      {
-        continue;
-      }
-  
-      Annotation annotation = annotations[index];
-      if (annotation != null)
-      {
-        String displayed = annotation.displayCharacter;
-        if (displayed != null && displayed.length() > 0)
-        {
-          result = displayed.substring(0, 1);
-          break;
-        }
-      }
-    }
-    return result;
-  }
 }