JAL-2527 Started adding overview preferences
[jalview.git] / src / jalview / gui / Preferences.java
index c3c9239..6fdaa0d 100755 (executable)
@@ -54,6 +54,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import javax.help.HelpSetException;
+import javax.swing.JButton;
 import javax.swing.JColorChooser;
 import javax.swing.JFileChooser;
 import javax.swing.JInternalFrame;
@@ -155,7 +156,7 @@ public class Preferences extends GPreferences
      * .properties file as '|' separated strings
      */
 
-    groupURLLinks = new ArrayList<String>();
+    groupURLLinks = new ArrayList<>();
   }
 
   JInternalFrame frame;
@@ -307,6 +308,10 @@ public class Preferences extends GPreferences
             Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN", Color.orange));
     maxColour.setBackground(
             Cache.getDefaultColour("ANNOTATIONCOLOUR_MAX", Color.red));
+    gapColour.setBackground(
+            Cache.getDefaultColour("GAP_COLOUR", Color.lightGray));
+    hiddenColour.setBackground(
+            Cache.getDefaultColour("HIDDEN_COLOUR", Color.darkGray));
 
     /*
      * Set Structure tab defaults.
@@ -1035,6 +1040,32 @@ public class Preferences extends GPreferences
   }
 
   @Override
+  public void gapColour_actionPerformed(JButton btn)
+  {
+    Color col = JColorChooser.showDialog(this,
+            MessageManager.getString("label.select_gap_colour"),
+            gapColour.getForeground());
+    if (col != null)
+    {
+      btn.setForeground(col);
+    }
+    btn.repaint();
+  }
+
+  @Override
+  public void hiddenColour_actionPerformed(JButton btn)
+  {
+    Color col = JColorChooser.showDialog(this,
+            MessageManager.getString("label.select_hidden_colour"),
+            hiddenColour.getForeground());
+    if (col != null)
+    {
+      btn.setForeground(col);
+    }
+    btn.repaint();
+  }
+
+  @Override
   protected void userIdWidth_actionPerformed()
   {
     try