import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.api.SplitContainerI;
import jalview.bin.Cache;
-import jalview.gui.Desktop;
-import jalview.gui.JvOptionPane;
import jalview.gui.JvSwingUtils;
import jalview.gui.Preferences;
-import jalview.gui.UserDefinedColours;
import jalview.io.FileFormat;
-import jalview.schemes.JalviewColourScheme;
-import jalview.schemes.ResidueColourScheme;
-import jalview.schemes.UserColourScheme;
import jalview.util.MessageManager;
import jalview.util.Platform;
protected JRadioButtonMenuItem textColour;
- protected JRadioButtonMenuItem clustalColour;
-
- protected JRadioButtonMenuItem zappoColour;
-
- protected JRadioButtonMenuItem taylorColour;
-
- protected JRadioButtonMenuItem hydrophobicityColour;
-
- protected JRadioButtonMenuItem helixColour;
-
- protected JRadioButtonMenuItem strandColour;
-
- protected JRadioButtonMenuItem turnColour;
-
- protected JRadioButtonMenuItem buriedColour;
-
protected JRadioButtonMenuItem userDefinedColour;
- protected JRadioButtonMenuItem PIDColour;
-
- protected JRadioButtonMenuItem BLOSUM62Colour;
-
- protected JRadioButtonMenuItem nucleotideColour;
-
- protected JRadioButtonMenuItem purinePyrimidineColour;
-
- protected JRadioButtonMenuItem RNAInteractionColour;
-
- // protected JRadioButtonMenuItem covariationColour;
-
- protected JRadioButtonMenuItem tcoffeeColour;
-
protected JCheckBoxMenuItem annotationPanelMenuItem = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem colourTextMenuItem = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem conservationMenuItem;
- JRadioButtonMenuItem noColourmenuItem;
+ protected JRadioButtonMenuItem noColourmenuItem;
protected JCheckBoxMenuItem wrapMenuItem = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem();
- protected ButtonGroup colours = new ButtonGroup();
-
protected JMenuItem showTranslation = new JMenuItem();
protected JMenuItem showReverse = new JMenuItem();
protected JMenuItem runGroovy = new JMenuItem();
- protected JMenuItem rnahelicesColour;
-
protected JCheckBoxMenuItem autoCalculate = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem sortByTree = new JCheckBoxMenuItem();
private void jbInit() throws Exception
{
initColourMenu();
- buildColourMenu();
JMenuItem saveAs = new JMenuItem(
MessageManager.getString("action.save_as"));
JMenuItem avDistanceTreeBlosumMenuItem = new JMenuItem(
- MessageManager.getString("label.average_distance_bloslum62"));
+ MessageManager.getString("label.average_distance_blosum62"));
avDistanceTreeBlosumMenuItem.addActionListener(new ActionListener()
{
@Override
}
/**
- * Rebuilds the Colour menu, including any user-defined colours which have
- * been loaded either on startup or during the session
- */
- public void buildColourMenu()
- {
- colourMenu.removeAll();
- colours = new ButtonGroup();
-
- colourMenu.add(applyToAllGroups);
- colourMenu.add(textColour);
- colourMenu.addSeparator();
- 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(RNAInteractionColour);
- // colourMenu.add(covariationColour);
- colourMenu.add(tcoffeeColour);
-
- /*
- * add any user-defined colours
- */
- Map<String, UserColourScheme> userColourSchemes = UserDefinedColours
- .getUserColourSchemes();
- if (userColourSchemes != null)
- {
- for (String userColour : userColourSchemes.keySet())
- {
- final JRadioButtonMenuItem radioItem = new JRadioButtonMenuItem(
- userColour);
- radioItem.setName(userColour);
- radioItem.addMouseListener(new MouseAdapter()
- {
- @Override
- public void mousePressed(MouseEvent evt)
- {
- if (evt.isPopupTrigger()) // Mac
- {
- offerRemoval();
- }
- }
-
- @Override
- public void mouseReleased(MouseEvent evt)
- {
- if (evt.isPopupTrigger()) // Windows
- {
- offerRemoval();
- }
- }
-
- void offerRemoval()
- {
- radioItem.removeActionListener(radioItem.getActionListeners()[0]);
-
- int option = JvOptionPane.showInternalConfirmDialog(
- Desktop.desktop, MessageManager
- .getString("label.remove_from_default_list"),
- MessageManager
- .getString("label.remove_user_defined_colour"),
- JvOptionPane.YES_NO_OPTION);
- if (option == JvOptionPane.YES_OPTION)
- {
- UserDefinedColours.removeColourFromDefaults(radioItem
- .getText());
- colourMenu.remove(radioItem);
- }
- else
- {
- radioItem.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent evt)
- {
- userDefinedColour_actionPerformed(evt);
- }
- });
- }
- }
- });
- radioItem.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent evt)
- {
- userDefinedColour_actionPerformed(evt);
- }
- });
- colourMenu.add(radioItem);
- colours.add(radioItem);
- }
- }
-
- colourMenu.add(userDefinedColour);
- colourMenu.addSeparator();
- colourMenu.add(conservationMenuItem);
- colourMenu.add(modifyConservation);
- colourMenu.add(abovePIDThreshold);
- colourMenu.add(modifyPID);
- colourMenu.add(annotationColour);
- colourMenu.add(rnahelicesColour);
-
- /*
- * add colours to a ButtonGroup to make their
- * selection mutually exclusive
- */
- 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(userDefinedColour);
- colours.add(PIDColour);
- colours.add(BLOSUM62Colour);
- colours.add(nucleotideColour);
- colours.add(purinePyrimidineColour);
- // colours.add(covariationColour);
- colours.add(tcoffeeColour);
- // colours.add(RNAInteractionColour);
- setColourSelected(Cache.getDefault(Preferences.DEFAULT_COLOUR,
- ResidueColourScheme.NONE));
-
- }
-
- /**
* Constructs the entries on the Colour menu (but does not add them to the
* menu). The 'name' property of each item is set to the canonical name of the
* corresponding colour scheme (may not match the display name), to allow
textColour_actionPerformed();
}
});
- clustalColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.clustalx"));
- clustalColour.setName(JalviewColourScheme.Clustal.toString());
- clustalColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- clustalColour_actionPerformed();
- }
- });
- zappoColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.zappo"));
- zappoColour.setName(JalviewColourScheme.Zappo.toString());
- zappoColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- zappoColour_actionPerformed();
- }
- });
- taylorColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.taylor"));
- taylorColour.setName(JalviewColourScheme.Taylor.toString());
- taylorColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- taylorColour_actionPerformed();
- }
- });
- hydrophobicityColour = new JRadioButtonMenuItem(
- MessageManager
- .getString("label.hydrophobicity"));
- hydrophobicityColour
- .setName(JalviewColourScheme.Hydrophobic.toString());
- hydrophobicityColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- hydrophobicityColour_actionPerformed();
- }
- });
- helixColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.helix_propensity"));
- helixColour.setName(JalviewColourScheme.Helix.toString());
- helixColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- helixColour_actionPerformed();
- }
- });
- strandColour = new JRadioButtonMenuItem(
- MessageManager
- .getString("label.strand_propensity"));
- strandColour.setName(JalviewColourScheme.Strand.toString());
- strandColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- strandColour_actionPerformed();
- }
- });
- turnColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.turn_propensity"));
- turnColour.setName(JalviewColourScheme.Turn.toString());
- turnColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- turnColour_actionPerformed();
- }
- });
- buriedColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.buried_index"));
- buriedColour.setName(JalviewColourScheme.Buried.toString());
- buriedColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- buriedColour_actionPerformed();
- }
- });
+
userDefinedColour = new JRadioButtonMenuItem(
MessageManager
.getString("action.user_defined"));
- userDefinedColour.setName(JalviewColourScheme.UserDefined.toString());
userDefinedColour.addActionListener(new ActionListener()
{
@Override
userDefinedColour_actionPerformed(e);
}
});
- PIDColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.percentage_identity"));
- PIDColour.setName(JalviewColourScheme.PID.toString());
- PIDColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- PIDColour_actionPerformed();
- }
- });
- BLOSUM62Colour = new JRadioButtonMenuItem(
- MessageManager.getString("label.blosum62_score"));
- BLOSUM62Colour.setName(JalviewColourScheme.Blosum62.toString());
- BLOSUM62Colour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- BLOSUM62Colour_actionPerformed();
- }
- });
- nucleotideColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.nucleotide"));
- nucleotideColour.setName(JalviewColourScheme.Nucleotide.toString());
- nucleotideColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- nucleotideColour_actionPerformed();
- }
- });
- purinePyrimidineColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.purine_pyrimidine"));
- purinePyrimidineColour.setName(JalviewColourScheme.PurinePyrimidine.toString());
- purinePyrimidineColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- purinePyrimidineColour_actionPerformed();
- }
- });
-
- tcoffeeColour = new JRadioButtonMenuItem(
- MessageManager.getString("label.tcoffee_scores"));
- tcoffeeColour.setName(JalviewColourScheme.TCoffee.toString());
- tcoffeeColour.setEnabled(false);
- tcoffeeColour.addActionListener(new ActionListener()
- {
-
- @Override
- public void actionPerformed(ActionEvent e)
- {
- tcoffeeColorScheme_actionPerformed();
- }
- });
-
- // RNAInteractionColour = new JRadioButtonMenuItem("RNA Interaction type");
- // RNAInteractionColour.setName("RNA Interaction");
- // RNAInteractionColour.addActionListener(new ActionListener()
- // {
- // @Override
- // public void actionPerformed(ActionEvent e)
- // {
- // RNAInteractionColour_actionPerformed();
- // }
- // });
- /*
- * covariationColour = new JRadioButtonMenuItem("Covariation");
- * covariationColour.addActionListener(new ActionListener() { public void
- * actionPerformed(ActionEvent e) { covariationColour_actionPerformed(); }
- * });
- */
conservationMenuItem = new JCheckBoxMenuItem(
MessageManager.getString("action.by_conservation"));
annotationColour_actionPerformed();
}
});
-
- rnahelicesColour = new JMenuItem(
- MessageManager.getString("action.by_rna_helixes"));
- rnahelicesColour.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- rnahelicesColour_actionPerformed();
- }
- });
}
protected void selectHighlightedColumns_actionPerformed(
{
}
- protected void clustalColour_actionPerformed()
- {
- }
-
- protected void zappoColour_actionPerformed()
- {
- }
-
- protected void taylorColour_actionPerformed()
- {
- }
-
- protected void hydrophobicityColour_actionPerformed()
- {
- }
-
- protected void helixColour_actionPerformed()
- {
- }
-
- protected void strandColour_actionPerformed()
- {
- }
-
- protected void turnColour_actionPerformed()
- {
- }
-
- protected void buriedColour_actionPerformed()
- {
- }
-
protected void userDefinedColour_actionPerformed(ActionEvent e)
{
}
- protected void PIDColour_actionPerformed()
- {
- }
-
- protected void BLOSUM62Colour_actionPerformed()
- {
- }
-
- protected void purinePyrimidineColour_actionPerformed()
- {
- }
-
- protected void RNAInteractionColour_actionPerformed()
- {
- }
+
/*
* protected void covariationColour_actionPerformed() { }
{
}
- protected void nucleotideColour_actionPerformed()
- {
- }
-
protected void deleteGroups_actionPerformed(ActionEvent e)
{
}
}
- /**
- * Template method to handle the 'Color T-Coffee scores' menu event.
- * <p>
- * Subclasses override this method to provide a custom action.
- */
- protected void tcoffeeColorScheme_actionPerformed()
- {
-
- }
-
protected void jpred_actionPerformed(ActionEvent e)
{
}
{
}
- public void rnahelicesColour_actionPerformed()
- {
-
- }
-
public void associatedData_actionPerformed(ActionEvent e)
{