X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationColourChooser.java;fp=src%2Fjalview%2Fgui%2FAnnotationColourChooser.java;h=69b54eac5a044f09e95628624b43edc49b9567f3;hb=2f4f1d8fb6878271b64f327bc58c895f458137af;hp=7c9a118bc20f6f54222a99f402a39bcb566e5653;hpb=4cf0508ac56ebb01fbd51b547ea9f4a682ca97fb;p=jalview.git diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java old mode 100755 new mode 100644 index 7c9a118..69b54ea --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -31,6 +31,8 @@ import net.miginfocom.swing.MigLayout; import jalview.bin.Cache; import jalview.datamodel.*; import jalview.schemes.*; +import jalview.util.MessageManager; + import java.awt.Dimension; public class AnnotationColourChooser extends JPanel @@ -119,18 +121,19 @@ public class AnnotationColourChooser extends JPanel // Always get default shading from preferences. setDefaultMinMax(); + adjusting = true; if (oldcs instanceof AnnotationColourGradient) { AnnotationColourGradient acg = (AnnotationColourGradient) oldcs; - currentColours.setSelected(acg.predefinedColours); - if (!acg.predefinedColours) + currentColours.setSelected(acg.isPredefinedColours() || acg.getBaseColour()!=null); + if (!acg.isPredefinedColours() && acg.getBaseColour()==null) { minColour.setBackground(acg.getMinColour()); maxColour.setBackground(acg.getMaxColour()); } seqAssociated.setSelected(acg.isSeqAssociated()); + } - adjusting = true; annotations = new JComboBox( getAnnotationItems(seqAssociated.isSelected())); @@ -266,7 +269,7 @@ public class AnnotationColourChooser extends JPanel } }); ok.setOpaque(false); - ok.setText("OK"); + ok.setText(MessageManager.getString("action.ok")); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -275,7 +278,7 @@ public class AnnotationColourChooser extends JPanel } }); cancel.setOpaque(false); - cancel.setText("Cancel"); + cancel.setText(MessageManager.getString("action.cancel")); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -284,7 +287,7 @@ public class AnnotationColourChooser extends JPanel } }); defColours.setOpaque(false); - defColours.setText("Defaults"); + defColours.setText(MessageManager.getString("action.set_defaults")); defColours .setToolTipText("Reset min and max colours to defaults from user preferences."); defColours.addActionListener(new ActionListener() @@ -328,7 +331,7 @@ public class AnnotationColourChooser extends JPanel thresholdValue.setColumns(7); currentColours.setFont(JvSwingUtils.getLabelFont()); currentColours.setOpaque(false); - currentColours.setText("Use Original Colours"); + currentColours.setText(MessageManager.getString("label.use_original_colours")); currentColours.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -338,7 +341,7 @@ public class AnnotationColourChooser extends JPanel }); thresholdIsMin.setBackground(Color.white); thresholdIsMin.setFont(JvSwingUtils.getLabelFont()); - thresholdIsMin.setText("Threshold is Min/Max"); + thresholdIsMin.setText(MessageManager.getString("label.threshold_minmax")); thresholdIsMin.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) @@ -348,7 +351,7 @@ public class AnnotationColourChooser extends JPanel }); seqAssociated.setBackground(Color.white); seqAssociated.setFont(JvSwingUtils.getLabelFont()); - seqAssociated.setText("Per-sequence only"); + seqAssociated.setText(MessageManager.getString("label.per_sequence_only")); seqAssociated.addActionListener(new ActionListener() { @@ -549,7 +552,7 @@ public class AnnotationColourChooser extends JPanel if (currentAnnotation.graphMin == 0f && currentAnnotation.graphMax == 0f) { - acg.predefinedColours = true; + acg.setPredefinedColours(true); } acg.thresholdIsMinMax = thresholdIsMin.isSelected();