import jalview.util.MessageManager;
+import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
+import java.awt.GridLayout;
import java.awt.Rectangle;
import java.awt.event.ActionListener;
public static JPanel addtoLayout(JPanel panel, String tooltip,
JComponent label, JComponent valBox)
{
- JPanel laypanel = new JPanel(), labPanel = new JPanel(), valPanel = new JPanel();
+ JPanel laypanel = new JPanel(new GridLayout(1, 2));
+ JPanel labPanel = new JPanel(new BorderLayout());
+ JPanel valPanel = new JPanel();
// laypanel.setSize(panel.getPreferredSize());
// laypanel.setLayout(null);
labPanel.setBounds(new Rectangle(7, 7, 158, 23));
valPanel.setBounds(new Rectangle(172, 7, 270, 23));
// labPanel.setLayout(new GridLayout(1,1));
// valPanel.setLayout(new GridLayout(1,1));
- labPanel.add(label);
+ labPanel.add(label, BorderLayout.WEST);
valPanel.add(valBox);
laypanel.add(labPanel);
laypanel.add(valPanel);
public class Preferences extends GPreferences
{
+ public static final String DEFAULT_COLOUR = "DEFAULT_COLOUR";
+
+ public static final String DEFAULT_COLOUR_PROT = "DEFAULT_COLOUR_PROT";
+
+ public static final String DEFAULT_COLOUR_NUC = "DEFAULT_COLOUR_NUC";
+
public static final String ADD_TEMPFACT_ANN = "ADD_TEMPFACT_ANN";
public static final String ADD_SS_ANN = "ADD_SS_ANN";
*/
for (int i = ColourSchemeProperty.FIRST_COLOUR; i <= ColourSchemeProperty.LAST_COLOUR; i++)
{
- colour.addItem(ColourSchemeProperty.getColourName(i));
+ protColour.addItem(ColourSchemeProperty.getColourName(i));
+ nucColour.addItem(ColourSchemeProperty.getColourName(i));
}
- String string = Cache.getDefault("DEFAULT_COLOUR", "None");
- colour.setSelectedItem(string);
+ String oldProp = Cache.getDefault(DEFAULT_COLOUR, "None");
+ String newProp = Cache.getDefault(DEFAULT_COLOUR_PROT, null);
+ protColour.setSelectedItem(newProp != null ? newProp : oldProp);
+ newProp = Cache.getDefault(DEFAULT_COLOUR_NUC, null);
+ nucColour.setSelectedItem(newProp != null ? newProp : oldProp);
minColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MIN",
Color.orange));
maxColour.setBackground(Cache.getDefaultColour("ANNOTATIONCOLOUR_MAX",
/*
* Save Colours settings
*/
- Cache.applicationProperties.setProperty("DEFAULT_COLOUR", colour
+ Cache.applicationProperties.setProperty(DEFAULT_COLOUR_PROT, protColour
+ .getSelectedItem().toString());
+ Cache.applicationProperties.setProperty(DEFAULT_COLOUR_NUC, nucColour
.getSelectedItem().toString());
Cache.setColourProperty("ANNOTATIONCOLOUR_MIN",
minColour.getBackground());
protected JPanel maxColour = new JPanel();
- protected JComboBox<String> colour = new JComboBox<String>();
+ protected JComboBox<String> protColour = new JComboBox<String>();
+
+ protected JComboBox<String> nucColour = new JComboBox<String>();
/*
* Connections tab components
maxColour_actionPerformed(maxColour);
}
});
- colour.setFont(verdana11);
- colour.setBounds(new Rectangle(172, 225, 155, 21));
- JLabel colourLabel = new JLabel();
- colourLabel.setFont(verdana11);
- colourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
- colourLabel.setText(MessageManager.getString("label.alignment_colour")
+
+ protColour.setFont(verdana11);
+ protColour.setBounds(new Rectangle(172, 225, 155, 21));
+ JLabel protColourLabel = new JLabel();
+ protColourLabel.setFont(verdana11);
+ protColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ protColourLabel.setText(MessageManager
+ .getString("label.prot_alignment_colour") + " ");
+ JvSwingUtils.addtoLayout(coloursTab, MessageManager
+ .getString("label.default_colour_scheme_for_alignment"),
+ protColourLabel, protColour);
+
+ nucColour.setFont(verdana11);
+ nucColour.setBounds(new Rectangle(172, 240, 155, 21));
+ JLabel nucColourLabel = new JLabel();
+ nucColourLabel.setFont(verdana11);
+ nucColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ nucColourLabel.setText(MessageManager
+ .getString("label.nuc_alignment_colour")
+ " ");
JvSwingUtils.addtoLayout(coloursTab, MessageManager
.getString("label.default_colour_scheme_for_alignment"),
- colourLabel, colour);
+ nucColourLabel, nucColour);
+
JPanel annotationShding = new JPanel();
annotationShding.setBorder(new TitledBorder(MessageManager
.getString("label.annotation_shading_default")));