/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
JButton defColours = new JButton();
- JButton ok = new JButton();
-
- JButton cancel = new JButton();
-
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
oldgroupColours = new Hashtable<SequenceGroup, ColourSchemeI>();
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
- if (sg.cs != null)
+ if (sg.getColourScheme() != null)
{
- oldgroupColours.put(sg, sg.cs);
+ oldgroupColours.put(sg, sg.getColourScheme());
}
}
}
getThreshold().setSelectedIndex(2);
break;
default:
- throw new Error(MessageManager.getString("error.implementation_error_dont_know_about_thereshold_setting"));
+ throw new Error(
+ MessageManager
+ .getString("error.implementation_error_dont_know_about_threshold_setting"));
}
thresholdIsMin.setSelected(acg.thresholdIsMinMax);
thresholdValue.setText("" + acg.getAnnotationThreshold());
@Override
public void actionPerformed(ActionEvent e)
{
- ok_actionPerformed(e);
+ ok_actionPerformed();
}
});
cancel.setOpaque(false);
@Override
public void actionPerformed(ActionEvent e)
{
- cancel_actionPerformed(e);
+ cancel_actionPerformed();
}
});
defColours.setOpaque(false);
@Override
public void actionPerformed(ActionEvent arg0)
{
- resetColours_actionPerformed(arg0);
+ resetColours_actionPerformed();
}
});
@Override
public void actionPerformed(ActionEvent e)
{
- annotations_actionPerformed(e);
+ annotations_actionPerformed();
}
});
getThreshold().addActionListener(new ActionListener()
@Override
public void actionPerformed(ActionEvent e)
{
- threshold_actionPerformed(e);
+ threshold_actionPerformed();
}
});
thresholdValue.addActionListener(new ActionListener()
@Override
public void actionPerformed(ActionEvent e)
{
- thresholdValue_actionPerformed(e);
+ thresholdValue_actionPerformed();
}
});
slider.setPaintLabels(false);
@Override
public void actionPerformed(ActionEvent e)
{
- currentColours_actionPerformed(e);
+ currentColours_actionPerformed();
}
});
thresholdIsMin.setBackground(Color.white);
@Override
public void actionPerformed(ActionEvent actionEvent)
{
- thresholdIsMin_actionPerformed(actionEvent);
+ thresholdIsMin_actionPerformed();
}
});
seqAssociated.setBackground(Color.white);
@Override
public void actionPerformed(ActionEvent arg0)
{
- seqAssociated_actionPerformed(arg0, annotations, seqAssociated);
+ seqAssociated_actionPerformed(annotations);
}
});
this.validate();
}
- protected void resetColours_actionPerformed(ActionEvent arg0)
+ protected void resetColours_actionPerformed()
{
setDefaultMinMax();
updateView();
public void minColour_actionPerformed()
{
Color col = JColorChooser.showDialog(this,
- MessageManager.getString("label.select_colour_minimum_value"), minColour.getBackground());
+ MessageManager.getString("label.select_colour_minimum_value"),
+ minColour.getBackground());
if (col != null)
{
minColour.setBackground(col);
public void maxColour_actionPerformed()
{
Color col = JColorChooser.showDialog(this,
- MessageManager.getString("label.select_colour_maximum_value"), maxColour.getBackground());
+ MessageManager.getString("label.select_colour_maximum_value"),
+ maxColour.getBackground());
if (col != null)
{
maxColour.setBackground(col);
updateView();
}
+ @Override
public void reset()
{
av.setGlobalColourScheme(oldcs);
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
- sg.cs = oldgroupColours.get(sg);
+ sg.setColourScheme(oldgroupColours.get(sg));
}
}
}
+ @Override
public void valueChanged(boolean updateAllAnnotation)
{
- if (currentColours.isSelected()
- && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient))
+ if (slider.isEnabled())
{
- updateView();
+ if (currentColours.isSelected()
+ && !(av.getGlobalColourScheme() instanceof AnnotationColourGradient))
+ {
+ updateView();
+ }
+ getCurrentAnnotation().threshold.value = slider.getValue() / 1000f;
+ propagateSeqAssociatedThreshold(updateAllAnnotation,
+ getCurrentAnnotation());
+ ap.paintAlignment(false);
}
- getCurrentAnnotation().threshold.value = slider.getValue() / 1000f;
- propagateSeqAssociatedThreshold(updateAllAnnotation,
- getCurrentAnnotation());
- ap.paintAlignment(false);
}
public JComboBox<String> getThreshold()
this.threshold = threshold;
}
- public void currentColours_actionPerformed(ActionEvent e)
+ public void currentColours_actionPerformed()
{
if (currentColours.isSelected())
{
@Override
public void updateView()
{
- changeColour();
- }
- void changeColour()
- {
// Check if combobox is still adjusting
if (adjusting)
{
&& getCurrentAnnotation().threshold == null)
{
getCurrentAnnotation()
- .setThreshold(new jalview.datamodel.GraphLine(
- (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f,
- "Threshold", Color.black));
+ .setThreshold(
+ new jalview.datamodel.GraphLine(
+ (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f,
+ "Threshold", Color.black));
}
if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD)