JAL-1355 get dialog title from message bundle
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Sat, 23 Jan 2016 06:15:20 +0000 (06:15 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Sat, 23 Jan 2016 06:15:20 +0000 (06:15 +0000)
src/jalview/gui/FeatureColourChooser.java

index 625cccc..4f5e7ea 100644 (file)
@@ -93,25 +93,28 @@ public class FeatureColourChooser extends JalviewDialog
     this.fr = frender;
     this.type = type;
     ap = fr.ap;
-    initDialogFrame(this, true, block, "Graduated Feature Colour for "
-            + type, 480, 185);
+    String title = MessageManager.formatMessage(
+            "label.graduated_color_for_params", new String[] { type });
+    initDialogFrame(this, true, block, title, 480, 185);
     // frame.setLayer(JLayeredPane.PALETTE_LAYER);
     // Desktop.addInternalFrame(frame, "Graduated Feature Colour for "+type,
     // 480, 145);
 
     slider.addChangeListener(new ChangeListener()
     {
+      @Override
       public void stateChanged(ChangeEvent evt)
       {
         if (!adjusting)
         {
-          thresholdValue.setText(((float) slider.getValue() / 1000f) + "");
+          thresholdValue.setText((slider.getValue() / 1000f) + "");
           valueChanged();
         }
       }
     });
     slider.addMouseListener(new MouseAdapter()
     {
+      @Override
       public void mouseReleased(MouseEvent evt)
       {
         if (ap != null)
@@ -202,6 +205,7 @@ public class FeatureColourChooser extends JalviewDialog
     minColour.setToolTipText(MessageManager.getString("label.min_colour"));
     minColour.addMouseListener(new MouseAdapter()
     {
+      @Override
       public void mousePressed(MouseEvent e)
       {
         if (minColour.isEnabled())
@@ -216,6 +220,7 @@ public class FeatureColourChooser extends JalviewDialog
     maxColour.setToolTipText(MessageManager.getString("label.max_colour"));
     maxColour.addMouseListener(new MouseAdapter()
     {
+      @Override
       public void mousePressed(MouseEvent e)
       {
         if (maxColour.isEnabled())
@@ -235,6 +240,7 @@ public class FeatureColourChooser extends JalviewDialog
     jPanel2.setBackground(Color.white);
     threshold.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         threshold_actionPerformed(e);
@@ -251,6 +257,7 @@ public class FeatureColourChooser extends JalviewDialog
     jPanel3.setLayout(flowLayout2);
     thresholdValue.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         thresholdValue_actionPerformed(e);
@@ -274,6 +281,7 @@ public class FeatureColourChooser extends JalviewDialog
             .getString("label.toggle_absolute_relative_display_threshold"));
     thresholdIsMin.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent actionEvent)
       {
         thresholdIsMin_actionPerformed(actionEvent);
@@ -287,6 +295,7 @@ public class FeatureColourChooser extends JalviewDialog
                     .getString("label.display_features_same_type_different_label_using_different_colour"));
     colourByLabel.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent actionEvent)
       {
         colourByLabel_actionPerformed(actionEvent);
@@ -488,6 +497,7 @@ public class FeatureColourChooser extends JalviewDialog
     ap.paintAlignment(false);
   }
 
+  @Override
   protected void raiseClosed()
   {
     if (this.colourEditor != null)
@@ -496,11 +506,13 @@ public class FeatureColourChooser extends JalviewDialog
     }
   }
 
+  @Override
   public void okPressed()
   {
     changeColour();
   }
 
+  @Override
   public void cancelPressed()
   {
     reset();
@@ -542,7 +554,7 @@ public class FeatureColourChooser extends JalviewDialog
 
   public void valueChanged()
   {
-    threshline.value = (float) slider.getValue() / 1000f;
+    threshline.value = slider.getValue() / 1000f;
     cs.setThresh(threshline.value);
     changeColour();
     ap.paintAlignment(false);