Merge branch 'bug/JAL-3003epsWithSelection' into trialMerge
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 31 Aug 2018 08:49:55 +0000 (09:49 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 31 Aug 2018 08:49:55 +0000 (09:49 +0100)
Conflicts:
src/jalview/gui/SeqCanvas.java

1  2 
.settings/org.eclipse.jdt.ui.prefs
src/jalview/gui/SeqCanvas.java

@@@ -5,4 -6,61 +6,62 @@@ org.eclipse.jdt.ui.ignorelowercasenames
  org.eclipse.jdt.ui.importorder=jalview;java;javax;org;com;
  org.eclipse.jdt.ui.ondemandthreshold=99
  org.eclipse.jdt.ui.staticondemandthreshold=99
+ sp_cleanup.add_default_serial_version_id=true
+ sp_cleanup.add_generated_serial_version_id=false
+ sp_cleanup.add_missing_annotations=true
+ sp_cleanup.add_missing_deprecated_annotations=true
+ sp_cleanup.add_missing_methods=false
+ sp_cleanup.add_missing_nls_tags=false
+ sp_cleanup.add_missing_override_annotations=true
+ sp_cleanup.add_missing_override_annotations_interface_methods=true
+ sp_cleanup.add_serial_version_id=false
+ sp_cleanup.always_use_blocks=true
+ sp_cleanup.always_use_parentheses_in_expressions=false
+ sp_cleanup.always_use_this_for_non_static_field_access=false
+ sp_cleanup.always_use_this_for_non_static_method_access=false
+ sp_cleanup.convert_functional_interfaces=false
+ sp_cleanup.convert_to_enhanced_for_loop=false
+ sp_cleanup.correct_indentation=false
+ sp_cleanup.format_source_code=true
+ sp_cleanup.format_source_code_changes_only=true
+ sp_cleanup.insert_inferred_type_arguments=false
+ sp_cleanup.make_local_variable_final=true
+ sp_cleanup.make_parameters_final=false
+ sp_cleanup.make_private_fields_final=true
+ sp_cleanup.make_type_abstract_if_missing_method=false
+ sp_cleanup.make_variable_declarations_final=false
+ sp_cleanup.never_use_blocks=false
+ sp_cleanup.never_use_parentheses_in_expressions=true
 -sp_cleanup.on_save_use_additional_actions=true
++sp_cleanup.on_save_use_additional_actions=false
+ sp_cleanup.organize_imports=true
+ sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+ sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+ sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+ sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+ sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+ sp_cleanup.remove_private_constructors=true
 -sp_cleanup.remove_redundant_type_arguments=true
++sp_cleanup.remove_redundant_modifiers=false
++sp_cleanup.remove_redundant_type_arguments=false
+ sp_cleanup.remove_trailing_whitespaces=false
+ sp_cleanup.remove_trailing_whitespaces_all=true
+ sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+ sp_cleanup.remove_unnecessary_casts=true
+ sp_cleanup.remove_unnecessary_nls_tags=false
 -sp_cleanup.remove_unused_imports=true
++sp_cleanup.remove_unused_imports=false
+ sp_cleanup.remove_unused_local_variables=false
+ sp_cleanup.remove_unused_private_fields=true
+ sp_cleanup.remove_unused_private_members=false
+ sp_cleanup.remove_unused_private_methods=true
+ sp_cleanup.remove_unused_private_types=true
+ sp_cleanup.sort_members=false
+ sp_cleanup.sort_members_all=false
+ sp_cleanup.use_anonymous_class_creation=false
 -sp_cleanup.use_blocks=true
++sp_cleanup.use_blocks=false
+ sp_cleanup.use_blocks_only_for_return_and_throw=false
+ sp_cleanup.use_lambda=true
+ sp_cleanup.use_parentheses_in_expressions=false
+ sp_cleanup.use_this_for_non_static_field_access=false
+ sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+ sp_cleanup.use_this_for_non_static_method_access=false
+ sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
  sp_cleanup.use_type_arguments=false
@@@ -357,23 -351,23 +356,19 @@@ public class SeqCanvas extends JPanel i
    @Override
    public void paintComponent(Graphics g)
    {
 -    super.paintComponent(g);    
 -    
 +    super.paintComponent(g);
 +
      int charHeight = av.getCharHeight();
      int charWidth = av.getCharWidth();
 -    
 +
      ViewportRanges ranges = av.getRanges();
 -    
 +
      int width = getWidth();
      int height = getHeight();
 -    
 +
      width -= (width % charWidth);
      height -= (height % charHeight);
 -    
 -    drawSelectionGroup((Graphics2D) g,
 -            ranges.getStartRes(), ranges.getEndRes(),
 -            ranges.getStartSeq(), ranges.getEndSeq());
 -    
 +
-     // selectImage is the selection group outline image
-     BufferedImage selectImage = drawSelectionGroup(ranges.getStartRes(),
-             ranges.getEndRes(), ranges.getStartSeq(), ranges.getEndSeq());
      if ((img != null) && (fastPaint
              || (getVisibleRect().width != g.getClipBounds().width)
              || (getVisibleRect().height != g.getClipBounds().height)))
        if (img == null || width != img.getWidth()
                || height != img.getHeight())
        {
-         img = setupImage();
-         if (img == null)
-         {
-           return;
-         }
+         img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
 -        gg = (Graphics2D) img.getGraphics();
 -        gg.setFont(av.getFont());
        }
 -    
 +      
 +      Graphics2D gg = (Graphics2D) img.getGraphics();
 +      gg.setFont(av.getFont());
 +
        if (av.antiAlias)
        {
          gg.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                  endSeq, offset);
  
          groupIndex++;
--
-         g.setStroke(new BasicStroke());
          if (groupIndex >= av.getAlignment().getGroups().size())
          {
            break;
          }
--
          group = av.getAlignment().getGroups().get(groupIndex);
--
        } while (groupIndex < av.getAlignment().getGroups().size());
--
      }
--
    }
  
-   /*
-    * Draw the selection group as a separate image and overlay
+   /**
+    * Draws the outline of the current selection group (if any)
+    * 
+    * @param g
+    * @param startRes
+    * @param endRes
+    * @param startSeq
+    * @param endSeq
     */
-   private BufferedImage drawSelectionGroup(int startRes, int endRes,
+   private void drawSelectionGroup(Graphics2D g, int startRes, int endRes,
            int startSeq, int endSeq)
    {
-     // get a new image of the correct size
-     BufferedImage selectionImage = setupImage();
-     if (selectionImage == null)
-     {
-       return null;
-     }
      SequenceGroup group = av.getSelectionGroup();
      if (group == null)
      {