Uploaded image for project: 'Jalview'
  1. Jalview
  2. JAL-2172

ColumnSelection.getSelected returns an unordered list, used as if ordered

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.10.0
    • Component/s: None
    • Labels:

      Description

      ColumnSelection.getSelection() returns the selected columns in the order added rather than left-to-right order.

      Looking at callers:
      - mostly they just do 'something' to everything in the returned list, which is ok regardless of ordering

      AlignViewController.makeGroupsFromSelection() is affected:
        - drag right-to-left to make a selection - the subsequence generated is in reverse order

      Default for 'Label' when editing an annotation row is affected:
      - create some annotation with labels: A,B
      - drag right-to-left to select these
      - right-click 'Label' - the default is BA rather than AB
      [though questionable why the code then writes the default value into _each_ annotation position rather than across the selected range]

      You can also see this by making sparse column selections, from right to left in the alignment.
      NB this is not currently possible in develop - see http://issues.jalview.org/browse/JAL-2077?focusedCommentId=15834&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15834

      Suggestion: recode ColumnSelection.getSelected() to return an ordered list, or perhaps remove it in favour of getSelectedRanges().

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gmungoc Mungo Carstairs
              Reporter:
              gmungoc Mungo Carstairs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: