JAL-1691 linked scrollling in split frame (Desktop)
[jalview.git] / src / jalview / gui / AlignmentPanel.java
index 6c80464..851c58b 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
  */
 package jalview.gui;
 
-import jalview.analysis.AnnotationSorter;
-import jalview.api.AlignmentViewPanel;
-import jalview.bin.Cache;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.SearchResults;
-import jalview.datamodel.SequenceFeature;
-import jalview.datamodel.SequenceGroup;
-import jalview.datamodel.SequenceI;
-import jalview.jbgui.GAlignmentPanel;
-import jalview.math.AlignmentDimension;
-import jalview.schemes.ResidueProperties;
-import jalview.structure.StructureSelectionManager;
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Container;
@@ -51,9 +37,25 @@ import java.beans.PropertyChangeListener;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.PrintWriter;
+import java.util.List;
 
 import javax.swing.SwingUtilities;
 
+import jalview.analysis.AnnotationSorter;
+import jalview.api.AlignViewportI;
+import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.jbgui.GAlignmentPanel;
+import jalview.math.AlignmentDimension;
+import jalview.schemes.ResidueProperties;
+import jalview.structure.StructureSelectionManager;
+import jalview.util.MessageManager;
+
 /**
  * DOCUMENT ME!
  * 
@@ -90,13 +92,17 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
   int vextent = 0;
 
+  /*
+   * Flag set while scrolling to follow complementary cDNA/protein scroll. When
+   * true, suppresses invoking the same method recursively.
+   */
+  private boolean followingComplementScroll;
+
   /**
    * Creates a new AlignmentPanel object.
    * 
    * @param af
-   *          DOCUMENT ME!
    * @param av
-   *          DOCUMENT ME!
    */
   public AlignmentPanel(AlignFrame af, final AlignViewport av)
   {
@@ -122,8 +128,6 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     setScrollValues(0, 0);
 
-    setAnnotationVisible(av.getShowAnnotation());
-
     hscroll.addAdjustmentListener(this);
     vscroll.addAdjustmentListener(this);
 
@@ -141,9 +145,14 @@ public class AlignmentPanel extends GAlignmentPanel implements
     });
     fontChanged();
     adjustAnnotationHeight();
-
+    updateLayout();
   }
 
+  @Override
+  public AlignViewportI getAlignViewport()
+  {
+    return av;
+  }
   public void alignmentChanged()
   {
     av.alignmentChanged(this);
@@ -163,9 +172,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
     // to prevent drawing old image
     FontMetrics fm = getFontMetrics(av.getFont());
 
-    scalePanelHolder.setPreferredSize(new Dimension(10, av.charHeight
+    scalePanelHolder.setPreferredSize(new Dimension(10, av.getCharHeight()
             + fm.getDescent()));
-    idSpaceFillerPanel1.setPreferredSize(new Dimension(10, av.charHeight
+    idSpaceFillerPanel1.setPreferredSize(new Dimension(10, av
+            .getCharHeight()
             + fm.getDescent()));
 
     getIdPanel().getIdCanvas().gg = null;
@@ -173,6 +183,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     getAnnotationPanel().adjustPanelHeight();
 
     Dimension d = calculateIdWidth();
+
     d.setSize(d.width + 4, d.height);
     getIdPanel().getIdCanvas().setPreferredSize(d);
     hscrollFillerPanel.setPreferredSize(d);
@@ -181,6 +192,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
     {
       overviewPanel.setBoxPosition();
     }
+    if (this.alignFrame.getSplitViewContainer() != null)
+    {
+      ((SplitFrame) this.alignFrame.getSplitViewContainer()).adjustLayout();
+    }
 
     repaint();
   }
@@ -195,11 +210,21 @@ public class AlignmentPanel extends GAlignmentPanel implements
   public Dimension calculateIdWidth()
   {
     // calculate sensible default width when no preference is available
-
-    int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
-    int maxwidth = Math.max(20,
-            Math.min(afwidth - 200, 2 * afwidth / 3));
-    return calculateIdWidth(maxwidth);
+    Dimension r = null;
+    if (av.getIdWidth() < 0)
+    {
+      int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
+      int maxwidth = Math.max(20, Math.min(afwidth - 200, 2 * afwidth / 3));
+      r = calculateIdWidth(maxwidth);
+      av.setIdWidth(r.width);
+    }
+    else
+    {
+      r = new Dimension();
+      r.width = av.getIdWidth();
+      r.height = 0;
+    }
+    return r;
   }
 
   /**
@@ -272,29 +297,44 @@ public class AlignmentPanel extends GAlignmentPanel implements
   }
 
   /**
-   * scroll the view to show the position of the highlighted region in results
+   * Scroll the view to show the position of the highlighted region in results
    * (if any) and redraw the overview
    * 
    * @param results
    */
   public boolean scrollToPosition(SearchResults results)
   {
-    return scrollToPosition(results, true);
+    return scrollToPosition(results, true, false);
   }
 
   /**
-   * scroll the view to show the position of the highlighted region in results
+   * Scroll the view to show the position of the highlighted region in results
+   * (if any)
+   * 
+   * @param searchResults
+   * @param redrawOverview
+   * @return
+   */
+  public boolean scrollToPosition(SearchResults searchResults, boolean redrawOverview)
+  {
+    return scrollToPosition(searchResults, redrawOverview, false);
+  }
+
+  /**
+   * Scroll the view to show the position of the highlighted region in results
    * (if any)
    * 
    * @param results
    * @param redrawOverview
    *          - when set, the overview will be recalculated (takes longer)
+   * @param centre
+   *          if true, try to centre the search results horizontally in the view
    * @return false if results were not found
    */
   public boolean scrollToPosition(SearchResults results,
-          boolean redrawOverview)
+          boolean redrawOverview, boolean centre)
   {
-    int startv, endv, starts, ends, width;
+    int startv, endv, starts, ends;
     // TODO: properly locate search results in view when large numbers of hidden
     // columns exist before highlighted region
     // do we need to scroll the panel?
@@ -318,6 +358,17 @@ public class AlignmentPanel extends GAlignmentPanel implements
       int end = r[1];
       // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); //
       // DEBUG
+
+      /*
+       * To centre results, scroll to positions half the visible width
+       * left/right of the start/end positions
+       */
+      if (centre)
+      {
+        int offset = (av.getEndRes() - av.getStartRes() + 1) / 2 - 1;
+        start = Math.max(start - offset, 0);
+        end = Math.min(end + offset, seq.getEnd() - 1);
+      }
       if (start < 0)
       {
         return false;
@@ -339,24 +390,39 @@ public class AlignmentPanel extends GAlignmentPanel implements
           }
         }
       }
-      if (!av.wrapAlignment)
+      if (!av.getWrapAlignment())
       {
         if ((startv = av.getStartRes()) >= start)
         {
+          /*
+           * Scroll left to make start of search results visible
+           */
           setScrollValues(start - 1, seqIndex);
         }
         else if ((endv = av.getEndRes()) <= end)
         {
+          /*
+           * Scroll right to make end of search results visible
+           */
           setScrollValues(startv + 1 + end - endv, seqIndex);
         }
         else if ((starts = av.getStartSeq()) > seqIndex)
         {
+          /*
+           * Scroll up to make start of search results visible
+           */
           setScrollValues(av.getStartRes(), seqIndex);
         }
         else if ((ends = av.getEndSeq()) <= seqIndex)
         {
+          /*
+           * Scroll down to make end of search results visible
+           */
           setScrollValues(av.getStartRes(), starts + seqIndex - ends + 1);
         }
+        /*
+         * Else results are already visible - no need to scroll
+         */
       }
       else
       {
@@ -412,7 +478,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    */
   public void setAnnotationVisible(boolean b)
   {
-    if (!av.wrapAlignment)
+    if (!av.getWrapAlignment())
     {
       annotationSpaceFillerHolder.setVisible(b);
       annotationScroller.setVisible(b);
@@ -488,13 +554,16 @@ public class AlignmentPanel extends GAlignmentPanel implements
   }
 
   /**
-   * DOCUMENT ME!
+   * update alignment layout for viewport settings
    * 
    * @param wrap
    *          DOCUMENT ME!
    */
-  public void setWrapAlignment(boolean wrap)
+  public void updateLayout()
   {
+    fontChanged();
+    setAnnotationVisible(av.isShowAnnotation());
+    boolean wrap = av.getWrapAlignment();
     av.startSeq = 0;
     scalePanelHolder.setVisible(!wrap);
     hscroll.setVisible(!wrap);
@@ -605,10 +674,11 @@ public class AlignmentPanel extends GAlignmentPanel implements
       width = av.getColumnSelection().findColumnPosition(width);
     }
 
-    av.setEndRes((x + (getSeqPanel().seqCanvas.getWidth() / av.charWidth)) - 1);
+    av.setEndRes((x + (getSeqPanel().seqCanvas.getWidth() / av
+            .getCharWidth())) - 1);
 
-    hextent = getSeqPanel().seqCanvas.getWidth() / av.charWidth;
-    vextent = getSeqPanel().seqCanvas.getHeight() / av.charHeight;
+    hextent = getSeqPanel().seqCanvas.getWidth() / av.getCharWidth();
+    vextent = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight();
 
     if (hextent > width)
     {
@@ -652,7 +722,6 @@ public class AlignmentPanel extends GAlignmentPanel implements
    */
   public void adjustmentValueChanged(AdjustmentEvent evt)
   {
-
     int oldX = av.getStartRes();
     int oldY = av.getStartSeq();
 
@@ -729,12 +798,24 @@ public class AlignmentPanel extends GAlignmentPanel implements
         getSeqPanel().seqCanvas.fastPaint(scrollX, scrollY);
         getScalePanel().repaint();
 
-        if (av.getShowAnnotation() && scrollX != 0)
+        if (av.isShowAnnotation() && scrollX != 0)
         {
           getAnnotationPanel().fastPaint(scrollX);
         }
       }
     }
+    /*
+     * If there is one, scroll the (Protein/cDNA) complementary alignment to
+     * match, unless we are ourselves doing that.
+     */
+    if (isFollowingComplementScroll())
+    {
+      setFollowingComplementScroll(false);
+    }
+    else
+    {
+      av.scrollComplementaryAlignment(evt.getSource() == hscroll);
+    }
   }
 
   /**
@@ -859,7 +940,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   {
     int idWidth = getVisibleIdWidth(false);
     FontMetrics fm = getFontMetrics(av.getFont());
-    int scaleHeight = av.charHeight + fm.getDescent();
+    int scaleHeight = av.getCharHeight() + fm.getDescent();
 
     pg.setColor(Color.white);
     pg.fillRect(0, 0, pwidth, pheight);
@@ -949,7 +1030,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       }
 
       pg.setColor(currentColor);
-      pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth,
+      pg.fillRect(0, (i - startSeq) * av.getCharHeight(), idWidth,
               av.getCharHeight());
 
       pg.setColor(currentTextColor);
@@ -966,7 +1047,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       pg.drawString(
               seq.getDisplayId(av.getShowJVSuffix()),
               xPos,
-              (((i - startSeq) * av.charHeight) + av.getCharHeight())
+              (((i - startSeq) * av.getCharHeight()) + av.getCharHeight())
                       - (av.getCharHeight() / 5));
     }
 
@@ -981,7 +1062,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
       // draw annotation - need to offset for current scroll position
       int offset = -getAlabels().getScrollOffset();
       pg.translate(0, offset);
-      pg.translate(-idWidth - 3, (endSeq - startSeq) * av.charHeight + 3);
+      pg.translate(-idWidth - 3, (endSeq - startSeq) * av.getCharHeight()
+              + 3);
       getAlabels().drawComponent(pg, idWidth);
       pg.translate(idWidth + 3, 0);
       getAnnotationPanel().renderer.drawComponent(getAnnotationPanel(), av,
@@ -1012,7 +1094,6 @@ public class AlignmentPanel extends GAlignmentPanel implements
   public int printWrappedAlignment(Graphics pg, int pwidth, int pheight,
           int pi) throws PrinterException
   {
-
     int annotationHeight = 0;
     AnnotationLabels labels = null;
     if (av.isShowAnnotation())
@@ -1021,13 +1102,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
       labels = new AnnotationLabels(av);
     }
 
-    int hgap = av.charHeight;
-    if (av.scaleAboveWrapped)
+    int hgap = av.getCharHeight();
+    if (av.getScaleAboveWrapped())
     {
-      hgap += av.charHeight;
+      hgap += av.getCharHeight();
     }
 
-    int cHeight = av.getAlignment().getHeight() * av.charHeight + hgap
+    int cHeight = av.getAlignment().getHeight() * av.getCharHeight() + hgap
             + annotationHeight;
 
     int idWidth = getVisibleIdWidth(false);
@@ -1071,18 +1152,19 @@ public class AlignmentPanel extends GAlignmentPanel implements
           xPos = idWidth - fm.stringWidth(string) - 4;
         }
         pg.drawString(string, xPos,
-                ((i * av.charHeight) + ypos + av.charHeight)
-                        - (av.charHeight / 5));
+                ((i * av.getCharHeight()) + ypos + av.getCharHeight())
+                        - (av.getCharHeight() / 5));
       }
       if (labels != null)
       {
         pg.translate(-3, ypos
-                + (av.getAlignment().getHeight() * av.charHeight));
+ + (av.getAlignment().getHeight() * av.getCharHeight()));
 
         pg.setFont(av.getFont());
         labels.drawComponent(pg, idWidth);
         pg.translate(+3, -ypos
-                - (av.getAlignment().getHeight() * av.charHeight));
+                        - (av.getAlignment().getHeight() * av
+                                .getCharHeight()));
       }
 
       ypos += cHeight;
@@ -1149,8 +1231,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     if (alignFrame != null && !headless)
     {
       alignFrame.setProgressBar(MessageManager.formatMessage(
-              "status.saving_file",
-              new String[]
+              "status.saving_file", new Object[]
               { type.getLabel() }), progress);
     }
     try
@@ -1225,9 +1306,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth);
     }
 
-    int height = ((av.getAlignment().getHeight() + 1) * av.charHeight)
+    int height = ((av.getAlignment().getHeight() + 1) * av.getCharHeight())
             + getScalePanel().getHeight();
-    int width = getVisibleIdWidth(false) + (maxwidth * av.charWidth);
+    int width = getVisibleIdWidth(false) + (maxwidth * av.getCharWidth());
 
     if (av.getWrapAlignment())
     {
@@ -1249,7 +1330,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       }
 
     }
-    else if (av.getShowAnnotation())
+    else if (av.isShowAnnotation())
     {
       height += getAnnotationPanel().adjustPanelHeight() + 3;
     }
@@ -1283,7 +1364,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     // ////////////////////////////////////////////
     int idWidth = getVisibleIdWidth(false);
     FontMetrics fm = getFontMetrics(av.getFont());
-    int scaleHeight = av.charHeight + fm.getDescent();
+    int scaleHeight = av.getCharHeight() + fm.getDescent();
 
     // Gen image map
     // ////////////////////////////////
@@ -1302,33 +1383,32 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
         for (s = 0; s < sSize; s++)
         {
-          sy = s * av.charHeight + scaleHeight;
+          sy = s * av.getCharHeight() + scaleHeight;
 
           SequenceI seq = av.getAlignment().getSequenceAt(s);
-          SequenceFeature[] features = seq.getDatasetSequence()
-                  .getSequenceFeatures();
+          SequenceFeature[] features = seq.getSequenceFeatures();
           SequenceGroup[] groups = av.getAlignment().findAllGroups(seq);
           for (res = 0; res < alwidth; res++)
           {
             text = new StringBuffer();
-            Object obj = null;
+            String triplet = null;
             if (av.getAlignment().isNucleotide())
             {
-              obj = ResidueProperties.nucleotideName.get(seq.getCharAt(res)
+              triplet = ResidueProperties.nucleotideName.get(seq
+                      .getCharAt(res)
                       + "");
             }
             else
             {
-              obj = ResidueProperties.aa2Triplet.get(seq.getCharAt(res)
+              triplet = ResidueProperties.aa2Triplet.get(seq.getCharAt(res)
                       + "");
             }
 
-            if (obj == null)
+            if (triplet == null)
             {
               continue;
             }
 
-            String triplet = obj.toString();
             int alIndex = seq.findPosition(res);
             gSize = groups.length;
             for (g = 0; g < gSize; g++)
@@ -1336,9 +1416,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
               if (text.length() < 1)
               {
                 text.append("<area shape=\"rect\" coords=\""
-                        + (idWidth + res * av.charWidth) + "," + sy + ","
-                        + (idWidth + (res + 1) * av.charWidth) + ","
-                        + (av.charHeight + sy) + "\""
+                        + (idWidth + res * av.getCharWidth()) + "," + sy
+                        + "," + (idWidth + (res + 1) * av.getCharWidth())
+                        + ","
+                        + (av.getCharHeight() + sy) + "\""
                         + " onMouseOver=\"toolTip('" + alIndex + " "
                         + triplet);
               }
@@ -1355,9 +1436,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
               if (text.length() < 1)
               {
                 text.append("<area shape=\"rect\" coords=\""
-                        + (idWidth + res * av.charWidth) + "," + sy + ","
-                        + (idWidth + (res + 1) * av.charWidth) + ","
-                        + (av.charHeight + sy) + "\""
+                        + (idWidth + res * av.getCharWidth()) + "," + sy
+                        + "," + (idWidth + (res + 1) * av.getCharWidth())
+                        + ","
+                        + (av.getCharHeight() + sy) + "\""
                         + " onMouseOver=\"toolTip('" + alIndex + " "
                         + triplet);
               }
@@ -1433,10 +1515,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
     int chunkWidth = getSeqPanel().seqCanvas
             .getWrappedCanvasWidth(seqPanelWidth);
 
-    int hgap = av.charHeight;
-    if (av.scaleAboveWrapped)
+    int hgap = av.getCharHeight();
+    if (av.getScaleAboveWrapped())
     {
-      hgap += av.charHeight;
+      hgap += av.getCharHeight();
     }
 
     int annotationHeight = 0;
@@ -1445,7 +1527,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       annotationHeight = getAnnotationPanel().adjustPanelHeight();
     }
 
-    int cHeight = av.getAlignment().getHeight() * av.charHeight + hgap
+    int cHeight = av.getAlignment().getHeight() * av.getCharHeight() + hgap
             + annotationHeight;
 
     int maxwidth = av.getAlignment().getWidth();
@@ -1474,6 +1556,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
               .getStructureSelectionManager();
       ssm.removeStructureViewerListener(getSeqPanel(), null);
       ssm.removeSelectionListener(getSeqPanel());
+      ssm.removeCommandListener(av);
+      ssm.removeStructureViewerListener(getSeqPanel(), null);
+      ssm.removeSelectionListener(getSeqPanel());
       av.setAlignment(null);
       av = null;
     }
@@ -1553,18 +1638,23 @@ public class AlignmentPanel extends GAlignmentPanel implements
     new OOMWarning(string, error, this);
   }
 
-  public FeatureRenderer cloneFeatureRenderer()
+  @Override
+  public jalview.api.FeatureRenderer cloneFeatureRenderer()
   {
 
     return new FeatureRenderer(this);
   }
-
-  public void updateFeatureRenderer(FeatureRenderer fr)
+  @Override 
+  public jalview.api.FeatureRenderer getFeatureRenderer()
+  {
+    return seqPanel.seqCanvas.getFeatureRenderer();
+  }
+  public void updateFeatureRenderer(jalview.renderer.seqfeatures.FeatureRenderer fr)
   {
     fr.transferSettings(getSeqPanel().seqCanvas.getFeatureRenderer());
   }
 
-  public void updateFeatureRendererFrom(FeatureRenderer fr)
+  public void updateFeatureRendererFrom(jalview.api.FeatureRenderer fr)
   {
     if (getSeqPanel().seqCanvas.getFeatureRenderer() != null)
     {
@@ -1621,4 +1711,73 @@ public class AlignmentPanel extends GAlignmentPanel implements
   {
     this.idPanel = idPanel;
   }
+
+  /**
+   * Follow a scrolling change in the (cDNA/Protein) complementary alignment.
+   * The aim is to keep the two alignments 'lined up' on their centre columns.
+   * 
+   * @param sr
+   *          holds mapped region(s) of this alignment that we are scrolling
+   *          'to'; may be modified for sequence offset by this method
+   * @param seqOffset
+   *          the number of visible sequences to show above the mapped region
+   * @param horizontal
+   *          if true, horizontal scrolling, else vertical
+   */
+  public void scrollAsComplement(SearchResults sr, int seqOffset,
+          boolean horizontal)
+  {
+    /*
+     * To avoid jumpy vertical scrolling (if some sequences are gapped or not
+     * mapped), we can make the scroll-to location a sequence above the one
+     * actually mapped.
+     */
+    SequenceI mappedTo = sr.getResultSequence(0);
+    List<SequenceI> seqs = av.getAlignment().getSequences();
+
+    /*
+     * This is like AlignmentI.findIndex(seq) but here we are matching the
+     * dataset sequence not the aligned sequence
+     */
+    int sequenceIndex = 0;
+    boolean matched = false;
+    for (SequenceI seq : seqs)
+    {
+      if (mappedTo == seq.getDatasetSequence())
+      {
+        matched = true;
+        break;
+      }
+      sequenceIndex++;
+    }
+    if (!matched)
+    {
+      return; // failsafe, shouldn't happen
+    }
+    sequenceIndex = Math.max(0, sequenceIndex - seqOffset);
+    sr.getResults().get(0)
+            .setSequence(av.getAlignment().getSequenceAt(sequenceIndex));
+
+    /*
+     * Scroll to position but centring the target residue. Also set a state flag
+     * to prevent adjustmentValueChanged performing this recursively.
+     */
+    setFollowingComplementScroll(true);
+    scrollToPosition(sr, true, true);
+  }
+
+  /**
+   * Set a flag to say we are scrolling to follow a (cDNA/protein) complement.
+   * 
+   * @param b
+   */
+  protected void setFollowingComplementScroll(boolean b)
+  {
+    this.followingComplementScroll = b;
+  }
+
+  protected boolean isFollowingComplementScroll()
+  {
+    return this.followingComplementScroll;
+  }
 }