label.style = Style:
label.calculating = Calculating....
label.modify_conservation_visibility = Modify conservation visibility
-label.colour_residues_above_occurence = Colour residues above % occurence
+label.colour_residues_above_occurence = Colour residues above % occurrence
label.set_this_label_text = set this label text
label.sequences_from = Sequences from {0}
label.successfully_loaded_file = Successfully loaded file {0}
protected MenuItem buriedColour = new MenuItem();
- protected CheckboxMenuItem abovePIDColour = new CheckboxMenuItem();
-
protected MenuItem userDefinedColour = new MenuItem();
protected MenuItem PIDColour = new MenuItem();
MenuItem noColourmenuItem = new MenuItem();
+ protected CheckboxMenuItem abovePIDColour = new CheckboxMenuItem();
+
+ MenuItem modifyPID = new MenuItem();
+
protected CheckboxMenuItem conservationMenuItem = new CheckboxMenuItem();
+ MenuItem modifyConservation = new MenuItem();
+
final AlignmentPanel ap;
MenuItem unGroupMenuItem = new MenuItem();
if (sg.cs != null)
{
abovePIDColour.setState(sg.cs.getThreshold() > 0);
+ modifyPID.setEnabled(abovePIDColour.getState());
conservationMenuItem.setState(sg.cs.conservationApplied());
+ modifyConservation.setEnabled(conservationMenuItem.getState());
}
}
}
{
noColourmenuItem_actionPerformed();
}
+ else if (source == modifyConservation)
+ {
+ conservationMenuItem_itemStateChanged();
+ }
+ else if (source == modifyPID)
+ {
+ abovePIDColour_itemStateChanged();
+ }
else if (source == unGroupMenuItem)
{
unGroupMenuItem_actionPerformed();
nucleotideMenuItem.addActionListener(this);
conservationMenuItem.addItemListener(this);
abovePIDColour.addItemListener(this);
+ modifyPID.setLabel(MessageManager
+ .getString("label.modify_identity_threshold"));
+ modifyPID.addActionListener(this);
+ modifyConservation.setLabel(MessageManager
+ .getString("label.modify_conservation_threshold"));
+ modifyPID.setEnabled(abovePIDColour.getState());
+ modifyConservation.setEnabled(conservationMenuItem.getState());
+ modifyConservation.addActionListener(this);
colourMenu.setLabel(MessageManager.getString("label.group_colour"));
showBoxes.setLabel(MessageManager.getString("action.boxes"));
showBoxes.setState(true);
colourMenu.add(userDefinedColour);
colourMenu.addSeparator();
colourMenu.add(abovePIDColour);
+ colourMenu.add(modifyPID);
colourMenu.add(conservationMenuItem);
+ colourMenu.add(modifyConservation);
noColourmenuItem.setLabel(MessageManager.getString("label.none"));
noColourmenuItem.addActionListener(this);
else
// remove PIDColouring
{
+ SliderPanel.hidePIDSlider();
sg.cs.setThreshold(0, ap.av.isIgnoreGapsConsensus());
}
-
+ modifyPID.setEnabled(abovePIDColour.getState());
refresh();
-
}
protected void userDefinedColour_actionPerformed()
else
// remove ConservationColouring
{
+ SliderPanel.hideConservationSlider();
sg.cs.setConservation(null);
}
-
+ modifyConservation.setEnabled(conservationMenuItem.getState());
refresh();
}
protected void conservationMenuItem_actionPerformed()
{
- viewport.setConservationSelected(conservationMenuItem.getState());
+ boolean selected = conservationMenuItem.getState();
+ modifyConservation.setEnabled(selected);
+ viewport.setConservationSelected(selected);
- viewport.setAbovePIDThreshold(false);
- abovePIDThreshold.setState(false);
+ // viewport.setAbovePIDThreshold(false);
+ // abovePIDThreshold.setState(false);
changeColour(viewport.getGlobalColourScheme());
- modifyConservation_actionPerformed();
+ if (selected)
+ {
+ modifyConservation_actionPerformed();
+ }
+ else
+ {
+ SliderPanel.hideConservationSlider();
+ }
}
public void abovePIDThreshold_actionPerformed()
{
- viewport.setAbovePIDThreshold(abovePIDThreshold.getState());
-
- conservationMenuItem.setState(false);
- viewport.setConservationSelected(false);
+ boolean selected = abovePIDThreshold.getState();
+ modifyPID.setEnabled(selected);
+ viewport.setAbovePIDThreshold(selected);
+ // conservationMenuItem.setState(false);
+ // viewport.setConservationSelected(false);
changeColour(viewport.getGlobalColourScheme());
- modifyPID_actionPerformed();
+ if (selected)
+ {
+ modifyPID_actionPerformed();
+ }
+ else
+ {
+ SliderPanel.hidePIDSlider();
+ }
}
public void sortPairwiseMenuItem_actionPerformed()
nucleotideColour.addActionListener(this);
modifyPID.setLabel(MessageManager
.getString("label.modify_identity_threshold"));
+ modifyPID.setEnabled(abovePIDThreshold.getState());
modifyPID.addActionListener(this);
modifyConservation.setLabel(MessageManager
.getString("label.modify_conservation_threshold"));
+ modifyConservation.setEnabled(conservationMenuItem.getState());
modifyConservation.addActionListener(this);
annotationColour.setLabel(MessageManager
.getString("action.by_annotation"));
slider.addAdjustmentListener(new AdjustmentListener()
{
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
- valueField.setText(slider.getValue() + "");
+ valueField.setText(String.valueOf(slider.getValue()));
sliderValueChanged();
}
});
*
* @return DOCUMENT ME!
*/
+ @Override
public void run()
{
label.setText(MessageManager.getString("label.calculating"));
}
+ @Override
public void applyButton_actionPerformed()
{
Vector del = new Vector();
}
+ @Override
public void undoButton_actionPerformed()
{
CommandI command = (CommandI) historyList.pop();
}
}
+ @Override
public void windowOpened(WindowEvent evt)
{
}
+ @Override
public void windowClosing(WindowEvent evt)
{
ap.idPanel.idCanvas.setHighlighted(null);
}
+ @Override
public void windowClosed(WindowEvent evt)
{
}
+ @Override
public void windowActivated(WindowEvent evt)
{
}
+ @Override
public void windowDeactivated(WindowEvent evt)
{
}
+ @Override
public void windowIconified(WindowEvent evt)
{
}
+ @Override
public void windowDeiconified(WindowEvent evt)
{
}
import java.awt.event.ActionListener;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
conservationSlider.getTitle(), 420, 100);
conservationSlider.addWindowListener(new WindowAdapter()
{
+ @Override
public void windowClosing(WindowEvent e)
{
conservationSlider = null;
420, 100);
PIDSlider.addWindowListener(new WindowAdapter()
{
+ @Override
public void windowClosing(WindowEvent e)
{
PIDSlider = null;
}
+ public static void hidePIDSlider()
+ {
+ PIDSlider.setVisible(false);
+ PIDSlider = null;
+ }
+
+ public static void hideConservationSlider()
+ {
+ conservationSlider.setVisible(false);
+ conservationSlider = null;
+ }
public SliderPanel(AlignmentPanel ap, int value, boolean forConserve,
ColourSchemeI cs)
{
else
{
label.setText(MessageManager
- .getString("label.colour_residues_above_occurence"));
+ .getString("label.colour_residues_above_occurrence"));
slider.setMinimum(0);
slider.setMaximum(100 + slider.getVisibleAmount());
slider.setBlockIncrement(1);
allGroupsCheck.setEnabled(b);
}
+ @Override
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource() == applyButton)
}
}
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
valueField.setText(slider.getValue() + "");
{
try
{
- int i = Integer.parseInt(valueField.getText());
+ int i = Integer.valueOf(valueField.getText());
slider.setValue(i);
- } catch (Exception ex)
+ } catch (NumberFormatException ex)
{
- valueField.setText(slider.getValue() + "");
+ valueField.setText(String.valueOf(slider.getValue()));
}
}
valueField.setText(" ");
valueField.addActionListener(this);
valueField.setColumns(3);
+ valueField.addFocusListener(new FocusAdapter()
+ {
+ @Override
+ public void focusLost(FocusEvent e)
+ {
+ valueField_actionPerformed();
+ valueChanged(slider.getValue());
+ }
+ });
+
label.setFont(new java.awt.Font("Verdana", 0, 11));
label.setText(MessageManager.getString("label.set_this_label_text"));
jPanel1.setLayout(borderLayout1);
{
}
+ @Override
public void mousePressed(MouseEvent evt)
{
}
+ @Override
public void mouseReleased(MouseEvent evt)
{
ap.paintAlignment(true);
}
+ @Override
public void mouseClicked(MouseEvent evt)
{
}
+ @Override
public void mouseEntered(MouseEvent evt)
{
}
+ @Override
public void mouseExited(MouseEvent evt)
{
}
padGapsMenuitem.setSelected(av.isPadGaps());
colourTextMenuItem.setSelected(av.isShowColourText());
abovePIDThreshold.setSelected(av.getAbovePIDThreshold());
+ modifyPID.setEnabled(abovePIDThreshold.isSelected());
conservationMenuItem.setSelected(av.getConservationSelected());
+ modifyConservation.setEnabled(conservationMenuItem.isSelected());
seqLimits.setSelected(av.getShowJVSuffix());
idRightAlign.setSelected(av.isRightAlignIds());
centreColumnLabelsMenuItem.setState(av.isCentreColumnLabels());
/**
* DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
*/
@Override
- protected void modifyPID_actionPerformed(ActionEvent e)
+ protected void modifyPID_actionPerformed()
{
if (viewport.getAbovePIDThreshold()
&& viewport.getGlobalColourScheme() != null)
/**
* DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
*/
@Override
- protected void modifyConservation_actionPerformed(ActionEvent e)
+ protected void modifyConservation_actionPerformed()
{
if (viewport.getConservationSelected()
&& viewport.getGlobalColourScheme() != null)
}
/**
- * DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
+ * Action on selecting or deselecting (Colour) By Conservation
*/
@Override
- protected void conservationMenuItem_actionPerformed(ActionEvent e)
+ protected void conservationMenuItem_actionPerformed()
{
- viewport.setConservationSelected(conservationMenuItem.isSelected());
-
- viewport.setAbovePIDThreshold(false);
- abovePIDThreshold.setSelected(false);
+ boolean selected = conservationMenuItem.isSelected();
+ modifyConservation.setEnabled(selected);
+ viewport.setConservationSelected(selected);
changeColour(viewport.getGlobalColourScheme());
-
- modifyConservation_actionPerformed(null);
+ if (selected)
+ {
+ modifyConservation_actionPerformed();
+ }
+ else
+ {
+ SliderPanel.hideConservationSlider();
+ }
}
/**
- * DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
+ * Action on selecting or deselecting (Colour) Above PID Threshold
*/
@Override
- public void abovePIDThreshold_actionPerformed(ActionEvent e)
+ public void abovePIDThreshold_actionPerformed()
{
- viewport.setAbovePIDThreshold(abovePIDThreshold.isSelected());
-
- conservationMenuItem.setSelected(false);
- viewport.setConservationSelected(false);
+ boolean selected = abovePIDThreshold.isSelected();
+ modifyPID.setEnabled(selected);
+ viewport.setAbovePIDThreshold(selected);
changeColour(viewport.getGlobalColourScheme());
-
- modifyPID_actionPerformed(null);
+ if (selected)
+ {
+ modifyPID_actionPerformed();
+ }
+ else
+ {
+ SliderPanel.hidePIDSlider();
+ }
}
/**
import java.util.jar.JarOutputStream;
import javax.swing.JInternalFrame;
-import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.exolab.castor.xml.Marshaller;
af.viewport.setShowAnnotation(view.getShowAnnotation());
af.viewport.setAbovePIDThreshold(view.getPidSelected());
+ af.viewport.setThreshold(view.getPidThreshold());
af.viewport.setColourText(view.getShowColourText());
af.viewport.setConservationSelected(view.getConservationSelected());
+ af.viewport.setIncrement(view.getConsThreshold());
af.viewport.setShowJVSuffix(view.getShowFullId());
af.viewport.setRightAlignIds(view.getRightAlignIds());
af.viewport.setFont(
if (cs != null)
{
- cs.setThreshold(view.getPidThreshold(), true);
cs.setConsensus(af.viewport.getSequenceConsensusHash());
}
}
protected JRadioButtonMenuItem buriedColour = new JRadioButtonMenuItem();
- protected JCheckBoxMenuItem abovePIDColour = new JCheckBoxMenuItem();
-
protected JRadioButtonMenuItem userDefinedColour = new JRadioButtonMenuItem();
protected JRadioButtonMenuItem PIDColour = new JRadioButtonMenuItem();
JRadioButtonMenuItem noColourmenuItem = new JRadioButtonMenuItem();
+ protected JCheckBoxMenuItem abovePIDColour = new JCheckBoxMenuItem();
+
+ protected JMenuItem modifyPID = new JMenuItem();
+
protected JCheckBoxMenuItem conservationMenuItem = new JCheckBoxMenuItem();
+ protected JMenuItem modifyConservation = new JMenuItem();
+
AlignmentPanel ap;
JMenu sequenceMenu = new JMenu();
{
JMenuItem item = new JMenuItem(ff);
- item.addActionListener(new java.awt.event.ActionListener()
+ item.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
menuItem.setText(MessageManager.formatMessage(
"label.2d_rna_structure_line",
new Object[] { aa.label }));
- menuItem.addActionListener(new java.awt.event.ActionListener()
+ menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
menuItem.setText(MessageManager.formatMessage(
"label.2d_rna_sequence_name",
new Object[] { seq.getName() }));
- menuItem.addActionListener(new java.awt.event.ActionListener()
+ menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
menuItem = new JMenuItem(
MessageManager.getString("action.hide_sequences"));
- menuItem.addActionListener(new java.awt.event.ActionListener()
+ menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
menuItem = new JMenuItem(MessageManager.formatMessage(
"label.represent_group_with",
new Object[] { seq.getName() }));
- menuItem.addActionListener(new java.awt.event.ActionListener()
+ menuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
if (sg.cs.conservationApplied())
{
- conservationMenuItem.setSelected(true);
+ conservationMenuItem.setSelected(true);
}
if (sg.cs.getThreshold() > 0)
{
abovePIDColour.setSelected(true);
}
}
+ modifyConservation.setEnabled(conservationMenuItem.isSelected());
+ modifyPID.setEnabled(abovePIDColour.isSelected());
displayNonconserved.setSelected(sg.getShowNonconserved());
showText.setSelected(sg.getDisplayText());
showColourText.setSelected(sg.getColourText());
}
-
-
/**
* Add annotation types to 'Show annotations' and/or 'Hide annotations' menus.
* "All" is added first, followed by a separator. Then add any annotation
label = label.substring(1, label.length() - 1); // a, b, c
final JMenuItem item = new JMenuItem(label);
item.setToolTipText(calcId);
- item.addActionListener(new java.awt.event.ActionListener()
+ item.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
JMenuItem item = new JMenuItem(label);
item.setToolTipText(MessageManager.formatMessage(
"label.open_url_param", new Object[] { url }));
- item.addActionListener(new java.awt.event.ActionListener()
+ item.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
groupMenu.setText(MessageManager.getString("label.selection"));
groupName.setText(MessageManager.getString("label.name"));
- groupName.addActionListener(new java.awt.event.ActionListener()
+ groupName.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
sequenceMenu.setText(MessageManager.getString("label.sequence"));
sequenceName.setText(MessageManager
.getString("label.edit_name_description"));
- sequenceName.addActionListener(new java.awt.event.ActionListener()
+ sequenceName.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
chooseAnnotations.setText(MessageManager
.getString("action.choose_annotations"));
- chooseAnnotations.addActionListener(new java.awt.event.ActionListener()
+ chooseAnnotations.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
sequenceDetails.setText(MessageManager
.getString("label.sequence_details"));
- sequenceDetails.addActionListener(new java.awt.event.ActionListener()
+ sequenceDetails.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
sequenceSelDetails.setText(MessageManager
.getString("label.sequence_details"));
- sequenceSelDetails
- .addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- sequenceSelectionDetails_actionPerformed();
- }
- });
+ sequenceSelDetails.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ sequenceSelectionDetails_actionPerformed();
+ }
+ });
PIDColour.setFocusPainted(false);
unGroupMenuItem
.setText(MessageManager.getString("action.remove_group"));
- unGroupMenuItem.addActionListener(new java.awt.event.ActionListener()
+ unGroupMenuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
createGroupMenuItem.setText(MessageManager
.getString("action.create_group"));
- createGroupMenuItem
- .addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- createGroupMenuItem_actionPerformed();
- }
- });
+ createGroupMenuItem.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ createGroupMenuItem_actionPerformed();
+ }
+ });
outline.setText(MessageManager.getString("action.border_colour"));
- outline.addActionListener(new java.awt.event.ActionListener()
+ outline.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
colourMenu.addSeparator();
colourMenu.add(abovePIDColour);
+ colourMenu.add(modifyPID);
colourMenu.add(conservationMenuItem);
+ colourMenu.add(modifyConservation);
editMenu.add(copy);
editMenu.add(cut);
editMenu.add(editSequence);
jMenu1.add(outline);
jMenu1.add(displayNonconserved);
noColourmenuItem.setText(MessageManager.getString("label.none"));
- noColourmenuItem.addActionListener(new java.awt.event.ActionListener()
+ noColourmenuItem.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
clustalColour.setText(MessageManager
.getString("label.clustalx_colours"));
- clustalColour.addActionListener(new java.awt.event.ActionListener()
+ clustalColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
}
});
zappoColour.setText(MessageManager.getString("label.zappo"));
- zappoColour.addActionListener(new java.awt.event.ActionListener()
+ zappoColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
}
});
taylorColour.setText(MessageManager.getString("label.taylor"));
- taylorColour.addActionListener(new java.awt.event.ActionListener()
+ taylorColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
hydrophobicityColour.setText(MessageManager
.getString("label.hydrophobicity"));
- hydrophobicityColour
- .addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- hydrophobicityColour_actionPerformed();
- }
- });
+ hydrophobicityColour.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hydrophobicityColour_actionPerformed();
+ }
+ });
helixColour.setText(MessageManager.getString("label.helix_propensity"));
- helixColour.addActionListener(new java.awt.event.ActionListener()
+ helixColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
strandColour.setText(MessageManager
.getString("label.strand_propensity"));
- strandColour.addActionListener(new java.awt.event.ActionListener()
+ strandColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
}
});
turnColour.setText(MessageManager.getString("label.turn_propensity"));
- turnColour.addActionListener(new java.awt.event.ActionListener()
+ turnColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
}
});
buriedColour.setText(MessageManager.getString("label.buried_index"));
- buriedColour.addActionListener(new java.awt.event.ActionListener()
+ buriedColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
buriedColour_actionPerformed();
}
});
- abovePIDColour.setText(MessageManager
- .getString("label.above_identity_percentage"));
- abovePIDColour.addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- abovePIDColour_actionPerformed();
- }
- });
userDefinedColour.setText(MessageManager
.getString("action.user_defined"));
- userDefinedColour.addActionListener(new java.awt.event.ActionListener()
+ userDefinedColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
PIDColour
.setText(MessageManager.getString("label.percentage_identity"));
- PIDColour.addActionListener(new java.awt.event.ActionListener()
+ PIDColour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
}
});
BLOSUM62Colour.setText(MessageManager.getString("label.blosum62"));
- BLOSUM62Colour.addActionListener(new java.awt.event.ActionListener()
+ BLOSUM62Colour.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
});
purinePyrimidineColour.setText(MessageManager
.getString("label.purine_pyrimidine"));
- purinePyrimidineColour
- .addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- purinePyrimidineColour_actionPerformed();
- }
- });
+ purinePyrimidineColour.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ purinePyrimidineColour_actionPerformed();
+ }
+ });
/*
- * covariationColour.addActionListener(new java.awt.event.ActionListener() {
+ * covariationColour.addActionListener(new ActionListener() {
* public void actionPerformed(ActionEvent e) {
* covariationColour_actionPerformed(); } });
*/
+ abovePIDColour.setText(MessageManager
+ .getString("label.above_identity_percentage"));
+ abovePIDColour.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ abovePIDColour_actionPerformed();
+ }
+ });
+
+ modifyPID.setText(MessageManager
+ .getString("label.modify_identity_threshold"));
+ modifyPID.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ modifyPID_actionPerformed();
+ }
+ });
conservationMenuItem.setText(MessageManager
.getString("label.conservation"));
- conservationMenuItem
- .addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- conservationMenuItem_actionPerformed();
- }
- });
+ conservationMenuItem.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ conservationMenuItem_actionPerformed();
+ }
+ });
+
+ modifyConservation.setText(MessageManager
+ .getString("label.modify_conservation_threshold"));
+ modifyConservation.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ modifyConservation_actionPerformed();
+ }
+ });
+ }
+
+ protected void modifyConservation_actionPerformed()
+ {
+ SequenceGroup sg = getGroup();
+ if (sg.cs != null)
+ {
+ SliderPanel.setConservationSlider(ap, sg.cs, sg.getName());
+ SliderPanel.showConservationSlider();
+ }
+ }
+
+ protected void modifyPID_actionPerformed()
+ {
+ SequenceGroup sg = getGroup();
+ if (sg.cs != null)
+ {
+ // int threshold = SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
+ // .getName());
+ // sg.cs.setThreshold(threshold, ap.av.isIgnoreGapsConsensus());
+ SliderPanel.setPIDSliderSource(ap, sg.cs, getGroup()
+ .getName());
+ SliderPanel.showPIDSlider();
+ }
}
/**
return;
}
- if (abovePIDColour.isSelected())
+ boolean selected = abovePIDColour.isSelected();
+ if (selected)
{
sg.cs.setConsensus(AAFrequency.calculate(
sg.getSequences(ap.av.getHiddenRepSequences()),
// remove PIDColouring
{
sg.cs.setThreshold(0, ap.av.isIgnoreGapsConsensus());
+ SliderPanel.hidePIDSlider();
}
+ modifyPID.setEnabled(selected);
refresh();
}
return;
}
- if (conservationMenuItem.isSelected())
+ boolean selected = conservationMenuItem.isSelected();
+ if (selected)
{
// JBPNote: Conservation name shouldn't be i18n translated
Conservation c = new Conservation("Group", sg.getSequences(ap.av
// remove ConservationColouring
{
sg.cs.setConservation(null);
+ SliderPanel.hideConservationSlider();
}
+ modifyConservation.setEnabled(selected);
refresh();
}
slider.addChangeListener(new ChangeListener()
{
+ @Override
public void stateChanged(ChangeEvent evt)
{
valueField.setText(slider.getValue() + "");
false);
frame.addInternalFrameListener(new InternalFrameAdapter()
{
+ @Override
public void internalFrameClosing(InternalFrameEvent evt)
{
ap.getIdPanel().getIdCanvas().setHighlighted(null);
*
* @return DOCUMENT ME!
*/
+ @Override
public void run()
{
JProgressBar progress = new JProgressBar();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void applyButton_actionPerformed(ActionEvent e)
{
Vector del = new Vector();
* @param e
* DOCUMENT ME!
*/
+ @Override
public void undoButton_actionPerformed(ActionEvent e)
{
if (historyList == null || historyList.isEmpty())
}
}
- /**
- * DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
- */
- public void valueField_actionPerformed(ActionEvent e)
- {
- try
- {
- int i = Integer.parseInt(valueField.getText());
- slider.setValue(i);
- } catch (Exception ex)
- {
- valueField.setText(slider.getValue() + "");
- }
- }
-
}
import jalview.schemes.ColourSchemeI;
import jalview.util.MessageManager;
-import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.beans.PropertyVetoException;
import java.util.Iterator;
import javax.swing.JInternalFrame;
slider.addChangeListener(new ChangeListener()
{
+ @Override
public void stateChanged(ChangeEvent evt)
{
valueField.setText(slider.getValue() + "");
slider.addMouseListener(new MouseAdapter()
{
+ @Override
public void mouseReleased(MouseEvent evt)
{
ap.paintAlignment(true);
return sp.getValue();
}
+ public static void hidePIDSlider()
+ {
+ try
+ {
+ PIDSlider.setClosed(true);
+ PIDSlider = null;
+ } catch (PropertyVetoException ex)
+ {
+ }
+ }
+
+ public static void hideConservationSlider()
+ {
+ try
+ {
+ conservationSlider.setClosed(true);
+ conservationSlider = null;
+ } catch (PropertyVetoException ex)
+ {
+ }
+ }
+
/**
* DOCUMENT ME!
*/
conservationSlider
.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent e)
{
PIDSlider
.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
{
+ @Override
public void internalFrameClosed(
javax.swing.event.InternalFrameEvent e)
{
/**
* DOCUMENT ME!
*
- * @param e
- * DOCUMENT ME!
- */
- public void valueField_actionPerformed(ActionEvent e)
- {
- try
- {
- int i = Integer.parseInt(valueField.getText());
- slider.setValue(i);
- } catch (NumberFormatException ex)
- {
- valueField.setText(slider.getValue() + "");
- }
- }
-
- /**
- * DOCUMENT ME!
- *
* @param value
* DOCUMENT ME!
*/
return Integer.parseInt(valueField.getText());
}
+ @Override
public void slider_mouseReleased(MouseEvent e)
{
if (ap.overviewPanel != null)
protected JMenuItem modifyConservation = new JMenuItem();
+ protected JMenuItem modifyPID = new JMenuItem();
+
protected JMenu sortByTreeMenu = new JMenu();
protected JMenu sort = new JMenu();
@Override
public void actionPerformed(ActionEvent e)
{
- conservationMenuItem_actionPerformed(e);
+ conservationMenuItem_actionPerformed();
}
});
noColourmenuItem.setText(MessageManager.getString("label.none"));
@Override
public void actionPerformed(ActionEvent e)
{
- abovePIDThreshold_actionPerformed(e);
+ abovePIDThreshold_actionPerformed();
}
});
showSeqFeatures.setText(MessageManager
});
- JMenuItem modifyPID = new JMenuItem(
+ modifyPID = new JMenuItem(
MessageManager.getString("label.modify_identity_threshold"));
modifyPID.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
- modifyPID_actionPerformed(e);
+ modifyPID_actionPerformed();
}
});
modifyConservation.setText(MessageManager
@Override
public void actionPerformed(ActionEvent e)
{
- modifyConservation_actionPerformed(e);
+ modifyConservation_actionPerformed();
}
});
sortByTreeMenu
{
}
- protected void conservationMenuItem_actionPerformed(ActionEvent e)
+ protected void conservationMenuItem_actionPerformed()
{
}
{
}
- protected void abovePIDThreshold_actionPerformed(ActionEvent e)
+ protected void abovePIDThreshold_actionPerformed()
{
}
{
}
- protected void modifyPID_actionPerformed(ActionEvent e)
+ protected void modifyPID_actionPerformed()
{
}
- protected void modifyConservation_actionPerformed(ActionEvent e)
+ protected void modifyConservation_actionPerformed()
{
}
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
slider.setDoubleBuffered(true);
slider.addMouseListener(new MouseAdapter()
{
+ @Override
public void mouseReleased(MouseEvent e)
{
slider_mouseReleased(e);
valueField.setPreferredSize(new Dimension(50, 12));
valueField.setText("");
valueField.setHorizontalAlignment(SwingConstants.CENTER);
- valueField.addActionListener(new java.awt.event.ActionListener()
+ valueField.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
- valueField_actionPerformed(e);
+ valueField_actionPerformed();
+ }
+ });
+ valueField.addFocusListener(new FocusAdapter()
+ {
+ @Override
+ public void focusLost(FocusEvent e)
+ {
+ valueField_actionPerformed();
}
});
label.setFont(new java.awt.Font("Verdana", 0, 11));
applyButton.setText(MessageManager.getString("action.apply"));
applyButton.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
applyButton_actionPerformed(e);
undoButton.setText(MessageManager.getString("action.undo"));
undoButton.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
undoButton_actionPerformed(e);
.getString("action.apply_all_groups"));
allGroupsCheck.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
allGroupsCheck_actionPerformed(e);
}
/**
- * DOCUMENT ME!
- *
- * @param e
- * DOCUMENT ME!
+ * Action on changing the slider text field value
*/
- protected void valueField_actionPerformed(ActionEvent e)
+ protected void valueField_actionPerformed()
{
+ try
+ {
+ int i = Integer.valueOf(valueField.getText());
+ slider.setValue(i);
+ } catch (NumberFormatException ex)
+ {
+ valueField.setText(String.valueOf(slider.getValue()));
+ }
}
/**