action.boxes = Boxes\r
action.text = Text\r
action.by_pairwise_id = by Pairwise Identity\r
-action.by_id = by Id\r
action.by_length = by Length\r
+action.by_id = by Id\r
action.by_group = by Group\r
action.remove = Remove\r
action.remove_redundancy = Remove Redundancy...\r
label.all_sequences = All Sequences\r
label.selected_columns = Selected Columns \r
label.selected_sequences = Selected Sequences\r
+label.except_selected_sequences = All except selected sequences\r
label.all_but_selected_region = All but Selected Region (Shift+Ctrl+H)\r
label.selected_region = Selected Region\r
label.all_sequences_columns = All Sequences and Columns\r
label.toggle_case = Toggle Case\r
label.edit_name_description = Edit Name/Description ...\r
label.create_sequence_feature = Create Sequence Feature ...\r
-label.edit_sequence = Edit Sequence\r
label.edit_sequences = Edit Sequences\r
label.sequence_details = Sequence Details\r
+label.choose_annotations = Show/Hide Sequence Annotations\r
label.jmol_help = Jmol Help\r
label.all = All\r
label.sort_by = Sort by\r
label.select_columns_not_containing = Select columns that do not contain\r
option.trim_retrieved_seqs = Trim retrieved sequences\r
label.trim_retrieved_sequences = When the reference sequence is longer than the sequence that you are working with, only keep the relevant subsequences.\r
+label.choose_annotations = Choose annotations to show or hide\r
+label.show_selected_annotations = Show selected annotation types\r
+label.hide_selected_annotations = Hide selected annotation types\r
*/
package jalview.datamodel;
-import java.util.*;
+import jalview.analysis.AAFrequency;
+import jalview.analysis.Conservation;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
import java.util.List;
-
-import java.awt.*;
-
-import jalview.analysis.*;
-import jalview.schemes.*;
+import java.util.Map;
+import java.util.Vector;
/**
* Collects a set contiguous ranges on a set of sequences
return eres;
}
+ @Override
public List<SequenceI> getSequences()
{
return sequences;
}
+ @Override
public List<SequenceI> getSequences(
Map<SequenceI, SequenceCollectionI> hiddenReps)
{
SequenceI seq;
for (int i = 0; i < sequences.size(); i++)
{
- seq = (SequenceI) sequences.elementAt(i);
+ seq = sequences.elementAt(i);
allSequences.addElement(seq);
if (hiddenReps.containsKey(seq))
{
*
* @return the first column selected by this group. Runs from 0<=i<N_cols
*/
+ @Override
public int getStartRes()
{
return startRes;
*
* @return the groups last selected column. Runs from 0<=i<N_cols
*/
+ @Override
public int getEndRes()
{
return endRes;
*/
public SequenceI getSequenceAt(int i)
{
- return (SequenceI) sequences.elementAt(i);
+ return sequences.elementAt(i);
}
/**
*
* @return DOCUMENT ME!
*/
+ @Override
public int getWidth()
{
// MC This needs to get reset when characters are inserted and deleted
if (sequences.size() > 0)
{
- width = ((SequenceI) sequences.elementAt(0)).getLength();
+ width = sequences.elementAt(0).getLength();
}
for (int i = 1; i < sequences.size(); i++)
{
- SequenceI seq = (SequenceI) sequences.elementAt(i);
+ SequenceI seq = sequences.elementAt(i);
if (seq.getLength() > width)
{
// TODO add in other methods like 'getAlignmentAnnotation(String label),
// etc'
ArrayList<AlignmentAnnotation> annot = new ArrayList<AlignmentAnnotation>();
- for (SequenceI seq : (Vector<SequenceI>) sequences)
+ for (SequenceI seq : sequences)
{
AlignmentAnnotation[] aa = seq.getAnnotation();
if (aa != null)
return aa;
}
+ /**
+ * Answer true if any annotation matches the calcId passed in (if not null).
+ *
+ * @param calcId
+ * @return
+ */
+ public boolean hasAnnotation(String calcId)
+ {
+ if (calcId != null && !"".equals(calcId))
+ {
+ for (AlignmentAnnotation a : getAlignmentAnnotation())
+ {
+ if (a.getCalcId() == calcId)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
public void clear()
{
sequences.clear();
tm.setText(title);//
tm.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
NewTreePanel(type, (String) pwtype, title);
trimrs.setSelected(Cache.getDefault("TRIM_FETCHED_DATASET_SEQS", true));
trimrs.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
trimrs.setSelected(trimrs.isSelected());
tabbedPane.setSelectedIndex(alignPanels.indexOf(alignmentPanel));
}
}
+
+ /**
+ * On menu option, open a panel to allow choice of annotation types to
+ * show/hide.
+ */
+ @Override
+ protected void chooseAnnotations_actionPerformed()
+ {
+ new AnnotationChooser(this.alignPanel);
+ }
}
class PrintThread extends Thread
--- /dev/null
+package jalview.gui;
+
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceGroup;
+import jalview.util.MessageManager;
+
+import java.awt.BorderLayout;
+import java.awt.Checkbox;
+import java.awt.CheckboxGroup;
+import java.awt.FlowLayout;
+import java.awt.Font;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
+import javax.swing.JPanel;
+
+/**
+ * A panel that allows the user to select which sequence-associated annotation
+ * rows to show or hide.
+ *
+ * @author gmcarstairs
+ *
+ */
+public class AnnotationChooser extends JPanel
+{
+
+ private static final Font CHECKBOX_FONT = new Font("Serif", Font.BOLD, 12);
+
+ private static final int MY_FRAME_WIDTH = 600;
+
+ private static final int MY_FRAME_HEIGHT = 250;
+
+ private JInternalFrame frame;
+
+ private AlignmentPanel ap;
+
+ private SequenceGroup sg;
+
+ // all annotation rows' original visible state
+ private boolean[] resetState = null;
+
+ // is 'Show' selected?
+ private boolean showSelected;
+
+ // apply settings to selected (or all) sequences?
+ private boolean applyToSelectedSequences;
+
+ // apply settings to unselected (or all) sequences?
+ private boolean applyToUnselectedSequences;
+
+ // currently selected 'annotation type' checkboxes
+ private Map<String, String> selectedTypes = new HashMap<String, String>();
+
+ /**
+ * Constructor.
+ *
+ * @param alignPane
+ */
+ public AnnotationChooser(AlignmentPanel alignPane)
+ {
+ super();
+ this.ap = alignPane;
+ this.sg = alignPane.av.getSelectionGroup();
+ saveResetState(alignPane.getAlignment());
+
+ try
+ {
+ jbInit();
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ showFrame();
+ }
+
+ /**
+ * Save the initial show/hide state of all annotations to allow a Cancel
+ * operation.
+ *
+ * @param alignment
+ */
+ protected void saveResetState(AlignmentI alignment)
+ {
+ AlignmentAnnotation[] annotations = alignment.getAlignmentAnnotation();
+ final int count = annotations.length;
+ this.resetState = new boolean[count];
+ for (int i = 0; i < count; i++)
+ {
+ this.resetState[i] = annotations[i].visible;
+ }
+ }
+
+ /**
+ * Populate this frame with:
+ * <p>
+ * checkboxes for the types of annotation to show or hide (i.e. any annotation
+ * type shown for any sequence in the whole alignment)
+ * <p>
+ * option to show or hide selected types
+ * <p>
+ * option to show/hide for the currently selected group, or its inverse
+ * <p>
+ * OK and Cancel (reset) buttons
+ */
+ protected void jbInit()
+ {
+ setLayout(new GridLayout(3, 1));
+ add(buildAnnotationTypesPanel());
+ add(buildShowHideOptionsPanel());
+ add(buildActionButtonsPanel());
+ validate();
+ }
+
+ /**
+ * Construct the panel with checkboxes for annotation types.
+ *
+ * @return
+ */
+ protected JPanel buildAnnotationTypesPanel()
+ {
+ JPanel jp = new JPanel(new FlowLayout(FlowLayout.LEFT));
+
+ List<String> annotationTypes = getAnnotationTypes(
+ this.ap.getAlignment(), true);
+
+ for (final String type : annotationTypes)
+ {
+ final JCheckBox check = new JCheckBox(type);
+ check.setFont(CHECKBOX_FONT);
+ check.addItemListener(new ItemListener()
+ {
+ @Override
+ public void itemStateChanged(ItemEvent evt)
+ {
+ if (evt.getStateChange() == ItemEvent.SELECTED)
+ {
+ AnnotationChooser.this.selectedTypes.put(type, type);
+ }
+ else
+ {
+ AnnotationChooser.this.selectedTypes.remove(type);
+ }
+ repaintAnnotations(false);
+ }
+ });
+ jp.add(check);
+ }
+ return jp;
+ }
+
+ /**
+ * Set visibility flags on annotation rows then repaint the alignment panel.
+ * <p>
+ * Optionally, update all rows, including those not in the 'apply to' scope.
+ * This makes more sense when switching between selected and unselected
+ * sequences. When selecting annotation types, or show/hide, we only apply the
+ * settings to the selected sequences.
+ * <p>
+ * Note this only affects sequence-specific annotations, others are left
+ * unchanged.
+ */
+ protected void repaintAnnotations(boolean updateAllRows)
+ {
+ for (AlignmentAnnotation aa : this.ap.getAlignment()
+ .getAlignmentAnnotation())
+ {
+ if (aa.sequenceRef != null)
+ {
+ setAnnotationVisibility(aa, updateAllRows);
+ }
+ }
+ // copied from AnnotationLabel.actionPerformed (after show/hide row)...
+ // TODO should drive this functionality into AlignmentPanel
+ ap.updateAnnotation();
+ this.ap.annotationPanel.adjustPanelHeight();
+ this.ap.alabels.setSize(this.ap.alabels.getSize().width,
+ this.ap.annotationPanel.getSize().height);
+ this.ap.validate();
+ this.ap.paintAlignment(true);
+ }
+
+ /**
+ * Determine and set the visibility of the given annotation from the currently
+ * selected options.
+ * <p>
+ * If its sequence is in the selected application scope
+ * (all/selected/unselected sequences), then we set its visibility.
+ * <p>
+ * If the annotation type is one of those currently selected by checkbox, set
+ * its visibility to the selected value. If it is not currently selected, set
+ * it to the opposite value. So, unselecting an annotation type with 'hide'
+ * selected, will cause those annotations to be unhidden.
+ * <p>
+ * If force update of all rows is wanted, then set rows not in the sequence
+ * selection scope to the opposite visibility to those in scope.
+ *
+ * @param aa
+ * @param updateAllRows
+ */
+ protected void setAnnotationVisibility(AlignmentAnnotation aa,
+ boolean updateAllRows)
+ {
+ boolean setToVisible = false;
+ if (this.selectedTypes.containsKey(aa.label))
+ {
+ setToVisible = this.showSelected;
+ }
+ else
+ {
+ setToVisible = !this.showSelected;
+ }
+ if (isInActionScope(aa))
+ {
+ aa.visible = setToVisible;
+ }
+ else if (updateAllRows)
+ {
+ aa.visible = !setToVisible;
+ }
+ // TODO force not visible if associated sequence is hidden?
+ // currently hiding a sequence does not hide its annotation rows
+ }
+
+ /**
+ * Answers true if the annotation falls in the current selection criteria for
+ * show/hide.
+ * <p>
+ * It must be in the sequence selection group (for 'Apply to selection'), or
+ * not in it (for 'Apply except to selection'). No check needed for 'Apply to
+ * all'.
+ *
+ * @param aa
+ * @return
+ */
+ protected boolean isInActionScope(AlignmentAnnotation aa)
+ {
+ boolean result = false;
+ if (this.applyToSelectedSequences && this.applyToUnselectedSequences)
+ {
+ // we don't care if the annotation's sequence is selected or not
+ result = true;
+ }
+ else if (this.sg.getSequences().contains(aa.sequenceRef))
+ {
+ // annotation is for a member of the selection group
+ result = this.applyToSelectedSequences ? true : false;
+ }
+ else
+ {
+ // annotation is not associated with the selection group
+ result = this.applyToUnselectedSequences ? true : false;
+ }
+ return result;
+ }
+
+ /**
+ * Get annotation 'types' for an alignment, optionally restricted to
+ * sequence-specific annotations only. The label is currently used for 'type'.
+ *
+ * TODO refactor to helper class. See
+ * AnnotationColourChooser.getAnnotationItems() for another client
+ *
+ * @param alignment
+ * @param sequenceSpecific
+ * @return
+ */
+ public static List<String> getAnnotationTypes(AlignmentI alignment,
+ boolean sequenceSpecificOnly)
+ {
+ // stub
+ List<String> result = new ArrayList<String>();
+ for (AlignmentAnnotation aa : alignment.getAlignmentAnnotation())
+ {
+ if (!sequenceSpecificOnly || aa.sequenceRef != null)
+ {
+ String label = aa.label;
+ if (!result.contains(label))
+ {
+ result.add(label);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Construct the panel with options to:
+ * <p>
+ * show or hide the selected annotation types
+ * <p>
+ * do this for the current selection group or its inverse
+ *
+ * @return
+ */
+ protected JPanel buildShowHideOptionsPanel()
+ {
+ JPanel jp = new JPanel();
+ jp.setLayout(new BorderLayout());
+
+ JPanel showHideOptions = buildShowHidePanel();
+ jp.add(showHideOptions, BorderLayout.CENTER);
+
+ JPanel applyToOptions = buildApplyToOptionsPanel();
+ jp.add(applyToOptions, BorderLayout.SOUTH);
+
+ return jp;
+ }
+
+ /**
+ * Build a panel with radio buttons options for sequences to apply show/hide
+ * to. Options are all, current selection, all except current selection.
+ * Initial state has 'current selection' selected.
+ * <p>
+ * If the sequence group is null, then we are acting on the whole alignment,
+ * and only 'all sequences' is enabled (and selected).
+ *
+ * @return
+ */
+ protected JPanel buildApplyToOptionsPanel()
+ {
+ final boolean wholeAlignment = this.sg == null;
+ JPanel applyToOptions = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ CheckboxGroup actingOn = new CheckboxGroup();
+
+ String forAll = MessageManager.getString("label.all_sequences");
+ final Checkbox allSequences = new Checkbox(forAll, actingOn,
+ wholeAlignment);
+ allSequences.addItemListener(new ItemListener()
+ {
+ @Override
+ public void itemStateChanged(ItemEvent evt)
+ {
+ if (evt.getStateChange() == ItemEvent.SELECTED) {
+ AnnotationChooser.this.setApplyToSelectedSequences(true);
+ AnnotationChooser.this.setApplyToUnselectedSequences(true);
+ AnnotationChooser.this.repaintAnnotations(true);
+ }
+ }
+ });
+ applyToOptions.add(allSequences);
+
+ String forSelected = MessageManager
+ .getString("label.selected_sequences");
+ final Checkbox selectedSequences = new Checkbox(forSelected, actingOn,
+ !wholeAlignment);
+ selectedSequences.setEnabled(!wholeAlignment);
+ selectedSequences.addItemListener(new ItemListener()
+ {
+ @Override
+ public void itemStateChanged(ItemEvent evt)
+ {
+ if (evt.getStateChange() == ItemEvent.SELECTED)
+ {
+ AnnotationChooser.this.setApplyToSelectedSequences(true);
+ AnnotationChooser.this.setApplyToUnselectedSequences(false);
+ AnnotationChooser.this.repaintAnnotations(true);
+ }
+ }
+ });
+ applyToOptions.add(selectedSequences);
+
+ String exceptSelected = MessageManager
+ .getString("label.except_selected_sequences");
+ final Checkbox unselectedSequences = new Checkbox(exceptSelected, actingOn, false);
+ unselectedSequences.setEnabled(!wholeAlignment);
+ unselectedSequences.addItemListener(new ItemListener()
+ {
+ @Override
+ public void itemStateChanged(ItemEvent evt)
+ {
+ if (evt.getStateChange() == ItemEvent.SELECTED)
+ {
+ AnnotationChooser.this.setApplyToSelectedSequences(false);
+ AnnotationChooser.this.setApplyToUnselectedSequences(true);
+ AnnotationChooser.this.repaintAnnotations(true);
+ }
+ }
+ });
+ applyToOptions.add(unselectedSequences);
+
+ // set member variables to match the initial selection state
+ this.applyToSelectedSequences = selectedSequences.getState()
+ || allSequences.getState();
+ this.applyToUnselectedSequences = unselectedSequences.getState()
+ || allSequences.getState();
+
+ return applyToOptions;
+ }
+
+ /**
+ * Build a panel with radio buttons options to show or hide selected
+ * annotations.
+ *
+ * @return
+ */
+ protected JPanel buildShowHidePanel()
+ {
+ JPanel showHideOptions = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ CheckboxGroup showOrHide = new CheckboxGroup();
+
+ /*
+ * Radio button 'Show selected annotations' - initially unselected
+ */
+ String showLabel = MessageManager
+ .getString("label.show_selected_annotations");
+ final Checkbox showOption = new Checkbox(showLabel, showOrHide, false);
+ showOption.addItemListener(new ItemListener()
+ {
+ @Override
+ public void itemStateChanged(ItemEvent evt)
+ {
+ if (evt.getStateChange() == ItemEvent.SELECTED) {
+ AnnotationChooser.this.setShowSelected(true);
+ AnnotationChooser.this.repaintAnnotations(false);
+ }
+ }
+ });
+ showHideOptions.add(showOption);
+
+ /*
+ * Radio button 'hide selected annotations'- initially selected
+ */
+ String hideLabel = MessageManager
+ .getString("label.hide_selected_annotations");
+ final Checkbox hideOption = new Checkbox(hideLabel, showOrHide, true);
+ hideOption.addItemListener(new ItemListener()
+ {
+ @Override
+ public void itemStateChanged(ItemEvent evt)
+ {
+ if (evt.getStateChange() == ItemEvent.SELECTED)
+ {
+ AnnotationChooser.this.setShowSelected(false);
+ AnnotationChooser.this.repaintAnnotations(false);
+ }
+ }
+ });
+ showHideOptions.add(hideOption);
+
+ /*
+ * Set member variable to match initial selection state
+ */
+ this.showSelected = showOption.getState();
+
+ return showHideOptions;
+ }
+
+ /**
+ * Construct the panel with OK and Cancel buttons.
+ *
+ * @return
+ */
+ protected JPanel buildActionButtonsPanel()
+ {
+ JPanel jp = new JPanel();
+ final Font labelFont = JvSwingUtils.getLabelFont();
+
+ JButton ok = new JButton(MessageManager.getString("action.ok"));
+ ok.setFont(labelFont);
+ ok.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ close_actionPerformed();
+ }
+ });
+ jp.add(ok);
+
+ JButton cancel = new JButton(MessageManager.getString("action.cancel"));
+ cancel.setFont(labelFont);
+ cancel.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ cancel_actionPerformed();
+ }
+ });
+ jp.add(cancel);
+
+ return jp;
+ }
+
+ /**
+ * On 'Cancel' button, undo any changes.
+ */
+ protected void cancel_actionPerformed()
+ {
+ resetOriginalState();
+ this.ap.repaint();
+ close_actionPerformed();
+ }
+
+ /**
+ * Restore annotation visibility to their state on entry here, and repaint
+ * alignment.
+ */
+ protected void resetOriginalState()
+ {
+ int i = 0;
+ for (AlignmentAnnotation aa : this.ap.getAlignment()
+ .getAlignmentAnnotation())
+ {
+ aa.visible = this.resetState[i++];
+ }
+ }
+
+ /**
+ * On 'Close' button, close the dialog.
+ */
+ protected void close_actionPerformed()
+ {
+ try
+ {
+ this.frame.setClosed(true);
+ } catch (Exception exe)
+ {
+ }
+ }
+
+ /**
+ * Render a frame containing this panel.
+ */
+ private void showFrame()
+ {
+ frame = new JInternalFrame();
+ frame.setContentPane(this);
+ frame.setLayer(JLayeredPane.PALETTE_LAYER);
+ Desktop.addInternalFrame(frame,
+ MessageManager.getString("label.choose_annotations"),
+ MY_FRAME_WIDTH, MY_FRAME_HEIGHT, true);
+ }
+
+ protected void setShowSelected(boolean showSelected)
+ {
+ this.showSelected = showSelected;
+ }
+
+ protected void setApplyToSelectedSequences(
+ boolean applyToSelectedSequences)
+ {
+ this.applyToSelectedSequences = applyToSelectedSequences;
+ }
+
+ protected void setApplyToUnselectedSequences(
+ boolean applyToUnselectedSequences)
+ {
+ this.applyToUnselectedSequences = applyToUnselectedSequences;
+ }
+
+}
*/
package jalview.gui;
-import java.util.*;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-import javax.swing.event.*;
-
-import net.miginfocom.swing.MigLayout;
-
import jalview.bin.Cache;
-import jalview.datamodel.*;
-import jalview.schemes.*;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.SequenceGroup;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.ColourSchemeI;
import jalview.util.MessageManager;
+import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JColorChooser;
+import javax.swing.JComboBox;
+import javax.swing.JInternalFrame;
+import javax.swing.JLayeredPane;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+import javax.swing.JTextField;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import net.miginfocom.swing.MigLayout;
public class AnnotationColourChooser extends JPanel
{
slider.addChangeListener(new ChangeListener()
{
+ @Override
public void stateChanged(ChangeEvent evt)
{
if (!adjusting)
{
- thresholdValue.setText(((float) slider.getValue() / 1000f) + "");
+ thresholdValue.setText((slider.getValue() / 1000f) + "");
valueChanged(!sliderDragging);
}
}
super.mouseDragged(e);
}
+ @Override
public void mouseReleased(MouseEvent evt)
{
if (sliderDragging)
if (!list.contains(label))
{
anmap[list.size()] = i;
- list.addElement(label);
+ list.add(label);
}
else
if (!isSeqAssociated)
{
anmap[list.size()] = i;
- list.addElement(label + "_" + (index++));
+ list.add(label + "_" + (index++));
}
}
}
seqAssociated.setEnabled(enableSeqAss);
- annmap = new int[list.size()];
- System.arraycopy(anmap, 0, annmap, 0, annmap.length);
+ this.annmap = new int[list.size()];
+ System.arraycopy(anmap, 0, this.annmap, 0, this.annmap.length);
return list;
}
minColour.setToolTipText(MessageManager.getString("label.min_colour"));
minColour.addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent e)
{
if (minColour.isEnabled())
maxColour.setToolTipText(MessageManager.getString("label.max_colour"));
maxColour.addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent e)
{
if (maxColour.isEnabled())
ok.setText(MessageManager.getString("action.ok"));
ok.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
ok_actionPerformed(e);
cancel.setText(MessageManager.getString("action.cancel"));
cancel.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
cancel_actionPerformed(e);
annotations.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
annotations_actionPerformed(e);
});
threshold.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
threshold_actionPerformed(e);
});
thresholdValue.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
thresholdValue_actionPerformed(e);
.getString("label.use_original_colours"));
currentColours.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
currentColours_actionPerformed(e);
.getString("label.threshold_minmax"));
thresholdIsMin.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
thresholdIsMin_actionPerformed(actionEvent);
{
changeColour();
}
- currentAnnotation.threshold.value = (float) slider.getValue() / 1000f;
+ currentAnnotation.threshold.value = slider.getValue() / 1000f;
propagateSeqAssociatedThreshold(updateAllAnnotation);
ap.paintAlignment(false);
}
import jalview.commands.ChangeCaseCommand;
import jalview.commands.EditCommand;
import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AlignmentView;
import jalview.datamodel.Annotation;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.PDBEntry;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Hashtable;
-import java.util.List;
import java.util.Vector;
import javax.swing.ButtonGroup;
JMenuItem sequenceSelDetails = new JMenuItem();
+ JMenuItem chooseAnnotations = new JMenuItem();
+
SequenceI sequence;
JMenuItem createGroupMenuItem = new JMenuItem();
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
outputText_actionPerformed(e);
menuItem.setText(pdb.getId());
menuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
// TODO re JAL-860: optionally open dialog or provide a menu entry
menuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
// System.out.println("1:"+structureLine);
{ seq.getName() }));
menuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
// TODO: VARNA does'nt print gaps in the sequence
MessageManager.getString("action.hide_sequences"));
menuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hideSequences(false);
{ seq.getName() }));
menuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hideSequences(true);
MessageManager.getString("action.reveal_sequences"));
menuItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
ap.av.showSequence(index);
MessageManager.getString("action.reveal_all"));
menuItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
ap.av.showAllHiddenSeqs();
SequenceI sqass = null;
for (SequenceI sq : ap.av.getSequenceSelection())
{
- Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence()
+ Vector<PDBEntry> pes = sq.getDatasetSequence()
.getPDBId();
if (pes != null && pes.size() > 0)
{
{ url }));
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
showLink(url);
// TODO: put in info about what is being sent.
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
new Thread(new Runnable()
{
+ @Override
public void run()
{
try
groupName.setText(MessageManager.getString("label.name"));
groupName.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
groupName_actionPerformed();
.getString("label.edit_name_description"));
sequenceName.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sequenceName_actionPerformed();
}
});
+ chooseAnnotations.setText(MessageManager
+ .getString("label.choose_annotations") + "...");
+ chooseAnnotations
+ .addActionListener(new java.awt.event.ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ chooseAnnotations_actionPerformed(e);
+ }
+ });
sequenceDetails.setText(MessageManager
.getString("label.sequence_details") + "...");
sequenceDetails.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sequenceDetails_actionPerformed();
sequenceSelDetails
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sequenceSelectionDetails_actionPerformed();
.setText(MessageManager.getString("action.remove_group"));
unGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
unGroupMenuItem_actionPerformed();
createGroupMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
createGroupMenuItem_actionPerformed();
outline.setText(MessageManager.getString("action.border_colour"));
outline.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
outline_actionPerformed();
.setText(MessageManager.getString("label.nucleotide"));
nucleotideMenuItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
nucleotideMenuItem_actionPerformed();
showBoxes.setState(true);
showBoxes.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showBoxes_actionPerformed();
showText.setState(true);
showText.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showText_actionPerformed();
showColourText.setText(MessageManager.getString("label.colour_text"));
showColourText.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showColourText_actionPerformed();
displayNonconserved.setState(true);
displayNonconserved.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showNonconserved_actionPerformed();
cut.setText(MessageManager.getString("action.cut"));
cut.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
cut_actionPerformed();
upperCase.setText(MessageManager.getString("label.to_upper_case"));
upperCase.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
changeCase(e);
copy.setText(MessageManager.getString("action.copy"));
copy.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
copy_actionPerformed();
lowerCase.setText(MessageManager.getString("label.to_lower_case"));
lowerCase.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
changeCase(e);
toggle.setText(MessageManager.getString("label.toggle_case"));
toggle.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
changeCase(e);
pdbFromFile.setText(MessageManager.getString("label.from_file"));
pdbFromFile.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
pdbFromFile_actionPerformed();
enterPDB.setText(MessageManager.getString("label.enter_pdb_id"));
enterPDB.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
enterPDB_actionPerformed();
discoverPDB.setText(MessageManager.getString("label.discover_pdb_ids"));
discoverPDB.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
discoverPDB_actionPerformed();
.getString("label.create_sequence_feature"));
sequenceFeature.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sequenceFeature_actionPerformed();
textColour.setText(MessageManager.getString("label.text_colour"));
textColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
textColour_actionPerformed();
+ "...");
editSequence.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
editSequence_actionPerformed(actionEvent);
add(groupMenu);
add(sequenceMenu);
this.add(structureMenu);
+ groupMenu.add(chooseAnnotations);
groupMenu.add(editMenu);
groupMenu.add(outputMenu);
groupMenu.add(sequenceFeature);
JMenuItem item = new JMenuItem(userColours.nextElement().toString());
item.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent evt)
{
userDefinedColour_actionPerformed(evt);
noColourmenuItem.setText(MessageManager.getString("label.none"));
noColourmenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
noColourmenuItem_actionPerformed();
.getString("label.clustalx_colours"));
clustalColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
clustalColour_actionPerformed();
zappoColour.setText(MessageManager.getString("label.zappo"));
zappoColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
zappoColour_actionPerformed();
taylorColour.setText(MessageManager.getString("label.taylor"));
taylorColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
taylorColour_actionPerformed();
hydrophobicityColour
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hydrophobicityColour_actionPerformed();
helixColour.setText(MessageManager.getString("label.helix_propensity"));
helixColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
helixColour_actionPerformed();
.getString("label.strand_propensity"));
strandColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
strandColour_actionPerformed();
turnColour.setText(MessageManager.getString("label.turn_propensity"));
turnColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
turnColour_actionPerformed();
buriedColour.setText(MessageManager.getString("label.buried_index"));
buriedColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
buriedColour_actionPerformed();
.getString("label.above_identity_percentage"));
abovePIDColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
abovePIDColour_actionPerformed();
.getString("action.user_defined"));
userDefinedColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
userDefinedColour_actionPerformed(e);
.setText(MessageManager.getString("label.percentage_identity"));
PIDColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
PIDColour_actionPerformed();
BLOSUM62Colour.setText(MessageManager.getString("label.blosum62"));
BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
BLOSUM62Colour_actionPerformed();
purinePyrimidineColour
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
purinePyrimidineColour_actionPerformed();
conservationMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
conservationMenuItem_actionPerformed();
}
/**
+ * Open a panel where the user can choose which types of sequence annotation
+ * to show or hide.
+ *
+ * @param e
+ */
+ protected void chooseAnnotations_actionPerformed(ActionEvent e)
+ {
+ // todo correct way to guard against opening a duplicate panel?
+ new AnnotationChooser(ap);
+ }
+ /**
* DOCUMENT ME!
*
* @param e
: ap.av.getSequenceSelection());
Thread discpdb = new Thread(new Runnable()
{
+ @Override
public void run()
{
if (sg != null)
{
if (sequence == null)
- sequence = (Sequence) sg.getSequenceAt(0);
+ sequence = sg.getSequenceAt(0);
EditNameDialog dialog = new EditNameDialog(
sequence.getSequenceAsString(sg.getStartRes(),
public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
+ JMenuItem chooseAnnotations = new JMenuItem();
+
JMenuItem deleteGroups = new JMenuItem();
JMenuItem createGroup = new JMenuItem();
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
outputText_actionPerformed(e);
radioItem.setName("USER_DEFINED");
radioItem.addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent evt)
{
if (evt.isControlDown()
{
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);
| java.awt.event.KeyEvent.SHIFT_MASK, false));
saveAs.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
saveAs_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
closeMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
closeMenuItem_actionPerformed(false);
selectAllSequenceMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
selectAllSequenceMenuItem_actionPerformed(e);
deselectAllSequenceMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
deselectAllSequenceMenuItem_actionPerformed(e);
invertSequenceMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
invertSequenceMenuItem_actionPerformed(e);
.getString("action.make_groups_selection"));
grpsFromSelection.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
makeGrpsFromSelection_actionPerformed(e);
remove2LeftMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
remove2LeftMenuItem_actionPerformed(e);
remove2RightMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
remove2RightMenuItem_actionPerformed(e);
removeGappedColumnMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
removeGappedColumnMenuItem_actionPerformed(e);
removeAllGapsMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
removeAllGapsMenuItem_actionPerformed(e);
justifyLeftMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
justifyLeftMenuItem_actionPerformed(e);
justifyRightMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
justifyRightMenuItem_actionPerformed(e);
viewBoxesMenuItem.setState(true);
viewBoxesMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
viewBoxesMenuItem_actionPerformed(e);
viewTextMenuItem.setState(true);
viewTextMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
viewTextMenuItem_actionPerformed(e);
showNonconservedMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showUnconservedMenuItem_actionPerformed(e);
sortPairwiseMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sortPairwiseMenuItem_actionPerformed(e);
sortIDMenuItem.setText(MessageManager.getString("action.by_id"));
sortIDMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sortIDMenuItem_actionPerformed(e);
sortLengthMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sortLengthMenuItem_actionPerformed(e);
sortGroupMenuItem.setText(MessageManager.getString("action.by_group"));
sortGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sortGroupMenuItem_actionPerformed(e);
removeRedundancyMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
removeRedundancyMenuItem_actionPerformed(e);
pairwiseAlignmentMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
pairwiseAlignmentMenuItem_actionPerformed(e);
.getString("label.principal_component_analysis"));
PCAMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
PCAMenuItem_actionPerformed(e);
averageDistanceTreeMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
averageDistanceTreeMenuItem_actionPerformed(e);
neighbourTreeMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
neighbourTreeMenuItem_actionPerformed(e);
clustalColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
clustalColour_actionPerformed(e);
zappoColour.setText(MessageManager.getString("label.zappo"));
zappoColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
zappoColour_actionPerformed(e);
taylorColour.setText(MessageManager.getString("label.taylor"));
taylorColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
taylorColour_actionPerformed(e);
hydrophobicityColour
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hydrophobicityColour_actionPerformed(e);
helixColour.setText(MessageManager.getString("label.helix_propensity"));
helixColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
helixColour_actionPerformed(e);
.getString("label.strand_propensity"));
strandColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
strandColour_actionPerformed(e);
turnColour.setText(MessageManager.getString("label.turn_propensity"));
turnColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
turnColour_actionPerformed(e);
buriedColour.setText(MessageManager.getString("label.buried_index"));
buriedColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
buriedColour_actionPerformed(e);
.getString("action.user_defined"));
userDefinedColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
userDefinedColour_actionPerformed(e);
.setText(MessageManager.getString("label.percentage_identity"));
PIDColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
PIDColour_actionPerformed(e);
.setText(MessageManager.getString("label.blosum62_score"));
BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
BLOSUM62Colour_actionPerformed(e);
nucleotideColour.setText(MessageManager.getString("label.nucleotide"));
nucleotideColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
nucleotideColour_actionPerformed(e);
purinePyrimidineColour
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
purinePyrimidineColour_actionPerformed(e);
RNAInteractionColour
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
RNAInteractionColour_actionPerformed(e);
avDistanceTreeBlosumMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
avTreeBlosumMenuItem_actionPerformed(e);
njTreeBlosumMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
njTreeBlosumMenuItem_actionPerformed(e);
annotationPanelMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
annotationPanelMenuItem_actionPerformed(e);
colourTextMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
colourTextMenuItem_actionPerformed(e);
htmlMenuItem.setText(MessageManager.getString("label.html"));
htmlMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
htmlMenuItem_actionPerformed(e);
.getString("label.overview_window"));
overviewMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
overviewMenuItem_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
undoMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
undoMenuItem_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
redoMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
redoMenuItem_actionPerformed(e);
conservationMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
conservationMenuItem_actionPerformed(e);
noColourmenuItem.setText(MessageManager.getString("label.none"));
noColourmenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
noColourmenuItem_actionPerformed(e);
wrapMenuItem.setText(MessageManager.getString("label.wrap"));
wrapMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
wrapMenuItem_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
printMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
printMenuItem_actionPerformed(e);
renderGapsMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
renderGapsMenuItem_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
findMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
findMenuItem_actionPerformed(e);
.getString("label.above_identity_threshold"));
abovePIDThreshold.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
abovePIDThreshold_actionPerformed(e);
.getString("label.show_sequence_features"));
showSeqFeatures.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
showSeqFeatures_actionPerformed(actionEvent);
}
});
+ chooseAnnotations.setText(MessageManager
+ .getString("label.choose_annotations") + "...");
+ chooseAnnotations.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ chooseAnnotations_actionPerformed();
+ }
+ });
/*
* showSeqFeaturesHeight.setText("Vary Sequence Feature Height");
* showSeqFeaturesHeight.addActionListener(new ActionListener() { public
showDbRefsMenuitem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showDbRefs_actionPerformed(e);
showNpFeatsMenuitem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showNpFeats_actionPerformed(e);
showGroupConservation.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showGroupConservation_actionPerformed(e);
showGroupConsensus.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showGroupConsensus_actionPerformed(e);
showConsensusHistogram.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showConsensusHistogram_actionPerformed(e);
showSequenceLogo.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showSequenceLogo_actionPerformed(e);
normaliseSequenceLogo.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
normaliseSequenceLogo_actionPerformed(e);
applyAutoAnnotationSettings.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
applyAutoAnnotationSettings_actionPerformed(e);
nucleotideColour.setText(MessageManager.getString("label.nucleotide"));
nucleotideColour.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
nucleotideColour_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
deleteGroups.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
deleteGroups_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
createGroup.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
createGroup_actionPerformed(e);
| java.awt.event.KeyEvent.SHIFT_MASK, false));
unGroup.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
unGroup_actionPerformed(e);
copy.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
copy_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
cut.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
cut_actionPerformed(e);
java.awt.event.KeyEvent.VK_BACK_SPACE, 0, false));
delete.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
delete_actionPerformed(e);
| java.awt.event.KeyEvent.SHIFT_MASK, false));
pasteNew.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
pasteNew_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
pasteThis.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
pasteThis_actionPerformed(e);
.getString("label.apply_colour_to_all_groups"));
applyToAllGroups.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
applyToAllGroups_actionPerformed(e);
});
createPNG.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
createPNG(null);
font.setText(MessageManager.getString("action.font"));
font.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
font_actionPerformed(e);
seqLimits.setState(jalview.bin.Cache.getDefault("SHOW_JVSUFFIX", true));
seqLimits.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
seqLimit_actionPerformed(e);
epsFile.setText("EPS");
epsFile.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
createEPS(null);
.getString("label.load_associated_tree"));
LoadtreeMenuItem.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
LoadtreeMenuItem_actionPerformed(e);
scaleAbove.setText(MessageManager.getString("action.scale_above"));
scaleAbove.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
scaleAbove_actionPerformed(e);
scaleLeft.setText(MessageManager.getString("action.scale_left"));
scaleLeft.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
scaleLeft_actionPerformed(e);
scaleRight.setText(MessageManager.getString("action.scale_right"));
scaleRight.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
scaleRight_actionPerformed(e);
centreColumnLabelsMenuItem
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
centreColumnLabels_actionPerformed(e);
followHighlightMenuItem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
followHighlight_actionPerformed();
.getString("label.modify_identity_thereshold"));
modifyPID.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
modifyPID_actionPerformed(e);
modifyConservation
.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
modifyConservation_actionPerformed(e);
sort.setText(MessageManager.getString("action.sort"));
sort.addMenuListener(new MenuListener()
{
+ @Override
public void menuSelected(MenuEvent e)
{
buildTreeMenu();
}
+ @Override
public void menuDeselected(MenuEvent e)
{
}
+ @Override
public void menuCanceled(MenuEvent e)
{
}
sortByAnnotScore.addMenuListener(new javax.swing.event.MenuListener()
{
+ @Override
public void menuCanceled(MenuEvent e)
{
}
+ @Override
public void menuDeselected(MenuEvent e)
{
}
+ @Override
public void menuSelected(MenuEvent e)
{
buildSortByAnnotationScoresMenu();
.getDefault("PAD_GAPS", false));
padGapsMenuitem.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
padGapsMenuitem_actionPerformed(e);
vamsasStore.setText(MessageManager.getString("label.vamsas_store"));
vamsasStore.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
vamsasStore_actionPerformed(e);
.getString("label.translate_cDNA"));
showTranslation.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showTranslation_actionPerformed(e);
+ "...");
extractScores.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
extractScores_actionPerformed(e);
.getString("label.feature_settings"));
openFeatureSettings.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
featureSettings_actionPerformed(e);
.setText(MessageManager.getString("label.fetch_sequences"));
fetchSequence.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
fetchSequence_actionPerformed(e);
.getString("action.by_annotation"));
annotationColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
annotationColour_actionPerformed(e);
.getString("action.by_rna_helixes"));
rnahelicesColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
rnahelicesColour_actionPerformed(e);
.getString("label.load_features_annotations"));
associatedData.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
associatedData_actionPerformed(e);
"AUTO_CALC_CONSENSUS", true));
autoCalculate.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
autoCalculate_actionPerformed(e);
.setState(jalview.bin.Cache.getDefault("SORT_BY_TREE", false));
sortByTree.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
sortByTreeOption_actionPerformed(e);
listenToViewSelections.setState(false);
listenToViewSelections.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
listenToViewSelections_actionPerformed(e);
addFromFile.setText(MessageManager.getString("label.from_file"));
addFromFile.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
addFromFile_actionPerformed(e);
addFromText.setText(MessageManager.getString("label.from_textbox"));
addFromText.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
addFromText_actionPerformed(e);
addFromURL.setText(MessageManager.getString("label.from_url"));
addFromURL.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
addFromURL_actionPerformed(e);
.getString("label.export_features"));
exportFeatures.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
exportFeatures_actionPerformed(e);
.getString("label.export_annotations"));
exportAnnotations.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
exportAnnotations_actionPerformed(e);
.getString("label.toggle_sequence_visibility"));
showAllSeqs.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showAllSeqs_actionPerformed(e);
.getString("label.toggle_columns_visibility"));
showAllColumns.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showAllColumns_actionPerformed(e);
.getString("label.toggle_sequence_visibility"));
hideSelSequences.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hideSelSequences_actionPerformed(e);
.getString("label.toggle_columns_visibility"));
hideSelColumns.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hideSelColumns_actionPerformed(e);
.getString("label.selected_region"));
hideAllSelection.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hideAllSelection_actionPerformed(e);
.getString("label.all_but_selected_region"));
hideAllButSelection.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hideAllButSelection_actionPerformed(e);
.getString("label.toggles_visibility_hidden_selected_regions"));
showAllhidden.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
showAllhidden_actionPerformed(e);
.getString("action.show_hidden_markers"));
hiddenMarkers.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
hiddenMarkers_actionPerformed(e);
| java.awt.event.KeyEvent.ALT_MASK, false));
invertColSel.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
invertColSel_actionPerformed(e);
});
tabbedPane.addChangeListener(new javax.swing.event.ChangeListener()
{
+ @Override
public void stateChanged(ChangeEvent evt)
{
JTabbedPane pane = (JTabbedPane) evt.getSource();
});
tabbedPane.addMouseListener(new MouseAdapter()
{
+ @Override
public void mousePressed(MouseEvent e)
{
tabbedPane_mousePressed(e);
});
tabbedPane.addFocusListener(new FocusAdapter()
{
+ @Override
public void focusGained(FocusEvent e)
{
tabbedPane_focusGained(e);
.getMenuShortcutKeyMask(), false));
save.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
save_actionPerformed(e);
reload.setText(MessageManager.getString("action.reload"));
reload.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
reload_actionPerformed(e);
.getMenuShortcutKeyMask(), false));
newView.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
newView_actionPerformed(e);
+ "...");
textColour.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
textColour_actionPerformed(e);
.getString("label.right_align_sequence_id"));
idRightAlign.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
idRightAlign_actionPerformed(e);
java.awt.event.KeyEvent.VK_G, 0, false));
gatherViews.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
gatherViews_actionPerformed(e);
java.awt.event.KeyEvent.VK_X, 0, false));
expandViews.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
expandViews_actionPerformed(e);
.setText(MessageManager.getString("action.page_setup") + "...");
pageSetup.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
pageSetup_actionPerformed(e);
.getString("label.alignment_props") + "...");
alignmentProperties.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent actionEvent)
{
alignmentProperties();
viewMenu.add(autoAnnMenu);
viewMenu.addSeparator();
viewMenu.add(showSeqFeatures);
+ viewMenu.add(chooseAnnotations);
// viewMenu.add(showSeqFeaturesHeight);
viewMenu.add(openFeatureSettings);
// selectMenu.add(listenToViewSelections);
}
+ /**
+ * Action on menu item "Show/hide sequence annotations..."
+ */
+ protected void chooseAnnotations_actionPerformed()
+ {
+
+ }
+
protected void normaliseSequenceLogo_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
--- /dev/null
+package jalview.gui;
+
+import jalview.io.AppletFormatAdapter;
+import jalview.io.FileLoader;
+
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Unit tests for AnnotationChooser
+ *
+ * @author gmcarstairs
+ *
+ */
+public class AnnotationChooserTest
+{
+ final static String TEST_FILE = "./examples/uniref50.fa";
+ AnnotationChooser testee;
+
+ AlignFrame af;
+
+ @Before
+ public void setUp()
+ {
+ FileLoader fl = new jalview.io.FileLoader(false);
+ af = fl.LoadFileWaitTillLoaded(TEST_FILE,
+ AppletFormatAdapter.FILE);
+
+ }
+
+ @Test
+ public void testAlignmentLoader() throws Exception
+ {
+
+ AlignmentPanel parentPanel = new AlignmentPanel(af, af.getViewport());
+ testee = new AnnotationChooser(parentPanel);
+ }
+
+ @Test
+ public void testBuildFrame()
+ {
+
+ }
+}