import jalview.schemes.HydrophobicColourScheme;
import jalview.schemes.NucleotideColourScheme;
import jalview.schemes.PIDColourScheme;
+import jalview.schemes.PurinePyrimidineColourScheme;
import jalview.schemes.StrandColourScheme;
import jalview.schemes.TaylorColourScheme;
import jalview.schemes.TurnColourScheme;
MenuItem nucleotideMenuItem = new MenuItem();
+ MenuItem purinePyrimidineMenuItem = new MenuItem();
+
Menu colourMenu = new Menu();
CheckboxMenuItem showBoxes = new CheckboxMenuItem();
{
nucleotideMenuItem_actionPerformed();
}
+ else if (source == purinePyrimidineMenuItem)
+ {
+ purinePyrimidineColour_actionPerformed();
+ }
else if (source == userDefinedColour)
{
nucleotideMenuItem.setLabel(MessageManager
.getString("label.nucleotide"));
nucleotideMenuItem.addActionListener(this);
+ purinePyrimidineMenuItem.setLabel(MessageManager
+ .getString("label.purine_pyrimidine"));
+ purinePyrimidineMenuItem.addActionListener(this);
conservationMenuItem.addItemListener(this);
abovePIDColour.addItemListener(this);
colourMenu.setLabel(MessageManager.getString("label.group_colour"));
sequenceDetails.addActionListener(this);
selSeqDetails.addActionListener(this);
displayNonconserved.setLabel(MessageManager
- .getString("label.show_non_conversed"));
+ .getString("label.show_non_conserved"));
displayNonconserved.setState(false);
displayNonconserved.addItemListener(this);
showText.setLabel(MessageManager.getString("action.text"));
colourMenu.add(turnColour);
colourMenu.add(buriedColour);
colourMenu.add(nucleotideMenuItem);
+ colourMenu.add(purinePyrimidineMenuItem);
colourMenu.add(userDefinedColour);
colourMenu.addSeparator();
colourMenu.add(abovePIDColour);
buriedColour.setLabel(MessageManager.getString("label.buried_index"));
buriedColour.addActionListener(this);
abovePIDColour.setLabel(MessageManager
- .getString("label.above_identity_percentage"));
+ .getString("label.above_identity_threshold"));
userDefinedColour.setLabel(MessageManager
.getString("action.user_defined"));
PIDColour.setLabel(MessageManager
.getString("label.percentage_identity"));
PIDColour.addActionListener(this);
- BLOSUM62Colour.setLabel("BLOSUM62");
+ BLOSUM62Colour.setLabel(MessageManager
+ .getString("label.blosum62_score"));
BLOSUM62Colour.addActionListener(this);
conservationMenuItem.setLabel(MessageManager
.getString("label.conservation"));
refresh();
}
+ public void purinePyrimidineColour_actionPerformed()
+ {
+ getGroup().cs = new PurinePyrimidineColourScheme();
+ refresh();
+ }
+
protected void abovePIDColour_itemStateChanged()
{
SequenceGroup sg = getGroup();
import jalview.schemes.PIDColourScheme;
import jalview.schemes.PurinePyrimidineColourScheme;
import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TCoffeeColourScheme;
import jalview.schemes.TaylorColourScheme;
import jalview.schemes.TurnColourScheme;
import jalview.schemes.UserColourScheme;
protected JRadioButtonMenuItem BLOSUM62Colour = new JRadioButtonMenuItem();
+ JRadioButtonMenuItem nucleotideColour = new JRadioButtonMenuItem();
+
protected JRadioButtonMenuItem purinePyrimidineColour = new JRadioButtonMenuItem();
- protected JRadioButtonMenuItem RNAInteractionColour = new JRadioButtonMenuItem();
+ protected JRadioButtonMenuItem tcoffeeColour = new JRadioButtonMenuItem();
+
+ // protected JRadioButtonMenuItem RNAInteractionColour;
JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
JMenuItem outline = new JMenuItem();
- JRadioButtonMenuItem nucleotideMenuItem = new JRadioButtonMenuItem();
-
JMenu colourMenu = new JMenu();
JCheckBoxMenuItem showBoxes = new JCheckBoxMenuItem();
this.ap = ap;
sequence = seq;
- ButtonGroup colours = new ButtonGroup();
- colours.add(noColourmenuItem);
- colours.add(clustalColour);
- colours.add(zappoColour);
- colours.add(taylorColour);
- colours.add(hydrophobicityColour);
- colours.add(helixColour);
- colours.add(strandColour);
- colours.add(turnColour);
- colours.add(buriedColour);
- colours.add(abovePIDColour);
- colours.add(userDefinedColour);
- colours.add(PIDColour);
- colours.add(BLOSUM62Colour);
- colours.add(purinePyrimidineColour);
- colours.add(RNAInteractionColour);
-
for (String ff : FileFormat.getWritableFormats(true))
{
JMenuItem item = new JMenuItem(ff);
{
purinePyrimidineColour.setSelected(true);
}
+ else if (sg.cs instanceof NucleotideColourScheme)
+ {
+ nucleotideColour.setSelected(true);
+ }
/*
* else if (sg.cs instanceof CovariationColourScheme) {
outline_actionPerformed();
}
});
- nucleotideMenuItem
+ nucleotideColour
.setText(MessageManager.getString("label.nucleotide"));
- nucleotideMenuItem.addActionListener(new ActionListener()
+ nucleotideColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
}
});
displayNonconserved.setText(MessageManager
- .getString("label.show_non_conversed"));
+ .getString("label.show_non_conserved"));
displayNonconserved.setState(true);
displayNonconserved.addActionListener(new ActionListener()
{
sequenceMenu.add(sequenceName);
sequenceMenu.add(sequenceDetails);
sequenceMenu.add(makeReferenceSeq);
- colourMenu.add(textColour);
- colourMenu.add(noColourmenuItem);
- colourMenu.add(clustalColour);
- colourMenu.add(BLOSUM62Colour);
- colourMenu.add(PIDColour);
- colourMenu.add(zappoColour);
- colourMenu.add(taylorColour);
- colourMenu.add(hydrophobicityColour);
- colourMenu.add(helixColour);
- colourMenu.add(strandColour);
- colourMenu.add(turnColour);
- colourMenu.add(buriedColour);
- colourMenu.add(nucleotideMenuItem);
- if (ap.getAlignment().isNucleotide())
- {
- colourMenu.add(purinePyrimidineColour);
- }
- SortedMap<String, UserColourScheme> userColourSchemes = UserDefinedColours
- .getUserColourSchemes();
- if (userColourSchemes != null)
- {
- for (String userColour : userColourSchemes.keySet())
- {
- JMenuItem item = new JMenuItem(userColour);
- item.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent evt)
- {
- userDefinedColour_actionPerformed(evt);
- }
- });
- colourMenu.add(item);
- }
- }
- colourMenu.add(userDefinedColour);
+ buildColourMenu();
- colourMenu.addSeparator();
- colourMenu.add(abovePIDColour);
- colourMenu.add(conservationMenuItem);
editMenu.add(copy);
editMenu.add(cut);
editMenu.add(editSequence);
}
});
abovePIDColour.setText(MessageManager
- .getString("label.above_identity_percentage"));
+ .getString("label.above_identity_threshold"));
abovePIDColour.addActionListener(new java.awt.event.ActionListener()
{
@Override
}
});
+ tcoffeeColour.setText(MessageManager.getString("label.tcoffee_scores"));
+ tcoffeeColour.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ tcoffeeColorScheme_actionPerformed();
+ }
+ });
+
/*
* covariationColour.addActionListener(new java.awt.event.ActionListener() {
* public void actionPerformed(ActionEvent e) {
*/
conservationMenuItem.setText(MessageManager
- .getString("label.conservation"));
- conservationMenuItem
- .addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- conservationMenuItem_actionPerformed();
+ .getString("action.by_conservation"));
+ conservationMenuItem.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ conservationMenuItem_actionPerformed();
}
});
}
/**
+ * Adds items to the group colour sub-menu
+ */
+ protected void buildColourMenu()
+ {
+ colourMenu.removeAll();
+ colourMenu.add(textColour);
+ colourMenu.add(noColourmenuItem);
+ colourMenu.add(clustalColour);
+ colourMenu.add(BLOSUM62Colour);
+ colourMenu.add(PIDColour);
+ colourMenu.add(zappoColour);
+ colourMenu.add(taylorColour);
+ colourMenu.add(hydrophobicityColour);
+ colourMenu.add(helixColour);
+ colourMenu.add(strandColour);
+ colourMenu.add(turnColour);
+ colourMenu.add(buriedColour);
+ colourMenu.add(nucleotideColour);
+ colourMenu.add(purinePyrimidineColour);
+ colourMenu.add(tcoffeeColour);
+
+ SortedMap<String, UserColourScheme> userColourSchemes = UserDefinedColours
+ .getUserColourSchemes();
+ if (userColourSchemes != null)
+ {
+ for (String userColour : userColourSchemes.keySet())
+ {
+ JMenuItem item = new JMenuItem(userColour);
+ item.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent evt)
+ {
+ userDefinedColour_actionPerformed(evt);
+ }
+ });
+ colourMenu.add(item);
+ }
+ }
+ colourMenu.add(userDefinedColour);
+
+ colourMenu.addSeparator();
+ colourMenu.add(abovePIDColour);
+ colourMenu.add(conservationMenuItem);
+
+ /*
+ * add some of these items to a ButtonGroup so their
+ * selection is mutually exclusive
+ */
+ ButtonGroup colours = new ButtonGroup();
+ colours.add(noColourmenuItem);
+ colours.add(clustalColour);
+ colours.add(BLOSUM62Colour);
+ colours.add(PIDColour);
+ colours.add(zappoColour);
+ colours.add(taylorColour);
+ colours.add(hydrophobicityColour);
+ colours.add(helixColour);
+ colours.add(strandColour);
+ colours.add(turnColour);
+ colours.add(buriedColour);
+ colours.add(purinePyrimidineColour);
+ colours.add(tcoffeeColour);
+ colours.add(nucleotideColour);
+ colours.add(userDefinedColour);
+ colours.add(abovePIDColour);
+ // colours.add(RNAInteractionColour);
+
+ }
+
+ /**
* Check for any annotations on the underlying dataset sequences (for the
* current selection group) which are not 'on the alignment'.If any are found,
* enable the option to add them to the alignment. The criteria for 'on the
refresh();
}
+ protected void tcoffeeColorScheme_actionPerformed()
+ {
+ getGroup().cs = new TCoffeeColourScheme(getGroup());
+ refresh();
+ }
+
/*
* protected void covariationColour_actionPerformed() { getGroup().cs = new
* CovariationColourScheme(sequence.getAnnotation()[0]); refresh(); }