JAL-2808 JAL-2069 FeatureTypeSettings (with new Filters tab) replaces FeatureColourCh...
[jalview.git] / src / jalview / appletgui / FeatureSettings.java
index 20d4d74..39a2747 100755 (executable)
  */
 package jalview.appletgui;
 
+import static jalview.viewmodel.seqfeatures.FeatureRendererModel.COLOUR_COLUMN;
+import static jalview.viewmodel.seqfeatures.FeatureRendererModel.SHOW_COLUMN;
+import static jalview.viewmodel.seqfeatures.FeatureRendererModel.TYPE_COLUMN;
+
 import jalview.api.FeatureColourI;
 import jalview.api.FeatureSettingsControllerI;
 import jalview.datamodel.AlignmentI;
@@ -377,8 +381,8 @@ public class FeatureSettings extends Panel
   // Group selection states
   void resetTable(boolean groupsChanged)
   {
-    List<String> displayableTypes = new ArrayList<String>();
-    Set<String> foundGroups = new HashSet<String>();
+    List<String> displayableTypes = new ArrayList<>();
+    Set<String> foundGroups = new HashSet<>();
 
     AlignmentI alignment = av.getAlignment();
 
@@ -391,7 +395,7 @@ public class FeatureSettings extends Panel
        * and keep track of which groups are visible
        */
       Set<String> groups = seq.getFeatures().getFeatureGroups(true);
-      Set<String> visibleGroups = new HashSet<String>();
+      Set<String> visibleGroups = new HashSet<>();
       for (String group : groups)
       {
         // if (group == null || fr.checkGroupVisibility(group, true))
@@ -584,23 +588,28 @@ public class FeatureSettings extends Panel
     Component[] comps = featurePanel.getComponents();
     int cSize = comps.length;
 
-    Object[][] tmp = new Object[cSize][3];
+    /*
+     * temporary! leave column[2] empty - used for Filter in
+     * gui.FeatureSettings
+     */
+    int columnCount = 4;
+    Object[][] tmp = new Object[cSize][columnCount];
     int tmpSize = 0;
     for (int i = 0; i < cSize; i++)
     {
       MyCheckbox check = (MyCheckbox) comps[i];
-      tmp[tmpSize][0] = check.type;
-      tmp[tmpSize][1] = fr.getFeatureStyle(check.type);
-      tmp[tmpSize][2] = new Boolean(check.getState());
+      tmp[tmpSize][TYPE_COLUMN /* 0 */] = check.type;
+      tmp[tmpSize][COLOUR_COLUMN /* 1 */] = fr.getFeatureStyle(check.type);
+      tmp[tmpSize][SHOW_COLUMN /* 3 */] = new Boolean(check.getState());
       tmpSize++;
     }
 
-    Object[][] data = new Object[tmpSize][3];
+    Object[][] data = new Object[tmpSize][columnCount];
     System.arraycopy(tmp, 0, data, 0, tmpSize);
 
     fr.setFeaturePriority(data);
 
-    ap.paintAlignment(updateOverview);
+    ap.paintAlignment(updateOverview, updateOverview);
   }
 
   MyCheckbox selectedCheck;
@@ -680,7 +689,7 @@ public class FeatureSettings extends Panel
   {
     featurePanel.removeAll();
     resetTable(false);
-    ap.paintAlignment(true);
+    ap.paintAlignment(true, true);
   }
 
   @Override
@@ -732,7 +741,7 @@ public class FeatureSettings extends Panel
   public void adjustmentValueChanged(AdjustmentEvent evt)
   {
     fr.setTransparency((100 - transparency.getValue()) / 100f);
-    ap.paintAlignment(true);
+    ap.paintAlignment(true, true);
   }
 
   class MyCheckbox extends Checkbox