graduated feature schemes (with visual indication of thresholding)
[jalview.git] / src / jalview / gui / FeatureRenderer.java
index a583d1d..6abe899 100755 (executable)
@@ -30,7 +30,6 @@ import javax.swing.*;
 
 import jalview.datamodel.*;
 import jalview.schemes.GraduatedColor;
-import jalview.util.FeatureColourI;
 
 /**
  * DOCUMENT ME!
@@ -891,7 +890,10 @@ public class FeatureRenderer
     } else { return true; }
   }
 
-
+  //// /////////////
+  //// Feature Editing Dialog
+  //// Will be refactored in next release.
+  
   static String lastFeatureAdded;
 
   static String lastFeatureGroupAdded;
@@ -1031,7 +1033,12 @@ public class FeatureRenderer
     tmp.add(new JLabel("Colour: ", JLabel.RIGHT));
     tmp.add(colour);
     colour.setPreferredSize(new Dimension(150, 15));
-
+    colour.setFont(new java.awt.Font("Verdana", Font.PLAIN, 9));
+    colour.setForeground(Color.black);
+    colour.setHorizontalAlignment(SwingConstants.CENTER);
+    colour.setVerticalAlignment(SwingConstants.CENTER);
+    colour.setHorizontalTextPosition(SwingConstants.CENTER);
+    colour.setVerticalTextPosition(SwingConstants.CENTER);
     bigPanel.add(panel, BorderLayout.NORTH);
 
     panel = new JPanel();
@@ -1124,7 +1131,7 @@ public class FeatureRenderer
       lastFeatureAdded = name.getText().trim();
       lastFeatureGroupAdded = source.getText().trim();
       lastDescriptionAdded = description.getText().replaceAll("\n", " ");
-
+      // TODO: determine if the null feature group is valid
       if (lastFeatureGroupAdded.length() < 1)
         lastFeatureGroupAdded = null;
     }
@@ -1215,11 +1222,12 @@ public class FeatureRenderer
     colour.setIcon(null);
     colour.setToolTipText(null);
     colour.setText("");
+    
     if (col2 instanceof Color) {
       colour.setBackground((Color)col2);
     } else {
       colour.setBackground(bigPanel.getBackground());
-      colour.setForeground(bigPanel.getForeground());
+      colour.setForeground(Color.black);
       FeatureSettings.renderGraduatedColor(colour, (GraduatedColor) col2);
       //colour.setForeground(colour.getBackground());
     }