import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureColourI;
-import jalview.bin.Cache;
import jalview.datamodel.GraphLine;
import jalview.datamodel.features.FeatureAttributes;
import jalview.datamodel.features.FeatureAttributes.Datatype;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
+import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JRadioButton;
import javax.swing.JSlider;
import javax.swing.JTextField;
-import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
JPanel maxColour = new JPanel();
- private JComboBox<Object> threshold = new JComboBox<>();
+ private JComboBox<String> threshold = new JComboBox<>();
JSlider slider = new JSlider();
/*
* choice of option for 'colour for no value'
*/
- private JComboBox<Object> noValueCombo;
+ private JComboBox<String> noValueCombo;
/*
* choice of what to colour by text (Label or attribute)
*/
- private JComboBox<Object> colourByTextCombo;
+ private JComboBox<String> colourByTextCombo;
/*
* choice of what to colour by range (Score or attribute)
*/
- private JComboBox<Object> colourByRangeCombo;
+ private JComboBox<String> colourByRangeCombo;
private JRadioButton andFilters;
* @param withRange
* @param withText
*/
- protected JComboBox<Object> populateAttributesDropdown(
+ protected JComboBox<String> populateAttributesDropdown(
List<String[]> attNames, boolean withRange, boolean withText)
{
List<String> displayAtts = new ArrayList<>();
tooltips.add(desc == null ? "" : desc);
}
- // now convert String List to Object List for buildComboWithTooltips
- List<Object> displayAttsObjects = new ArrayList<>(displayAtts);
- JComboBox<Object> attCombo = JvSwingUtils
- .buildComboWithTooltips(displayAttsObjects, tooltips);
-
+ JComboBox<String> attCombo = JvSwingUtils
+ .buildComboWithTooltips(displayAtts, tooltips);
+
return attCombo;
}
* drop-down choice of attribute, with description as a tooltip
* if we can obtain it
*/
- final JComboBox<Object> attCombo = populateAttributesDropdown(attNames,
- true, true);
+ JComboBox<String> attCombo = populateAttributesDropdown(attNames, true,
+ true);
String filterBy = setSelectedAttribute(attCombo, filter);
JComboBox<Condition> condCombo = new JComboBox<>();
if (!patternField.isEnabled()
|| (pattern != null && pattern.trim().length() > 0))
{
- JButton removeCondition = new JButton("\u2717"); // Dingbats cursive x
- removeCondition.setBorder(new EmptyBorder(0, 0, 0, 0));
+ JButton removeCondition = new JButton("\u2717")
+ {
+ @Override
+ public void paint(Graphics g)
+ {
+ g.setColor(Color.black);
+ g.drawString("\u2717", 2, 14); // Dingbats cursive x
+ }
+ };
removeCondition.setBackground(Color.WHITE);
+ removeCondition.setOpaque(true);
removeCondition.setPreferredSize(new Dimension(23, 17));
- removeCondition.setToolTipText(
- MessageManager.getString("label.delete_condition"));
- removeCondition.setBorder(new EmptyBorder(0, 0, 0, 0));
+ removeCondition
+ .setToolTipText(MessageManager.getString("label.delete_row"));
removeCondition.addActionListener(new ActionListener()
{
@Override
* @param attCombo
* @param filter
*/
- private String setSelectedAttribute(JComboBox<Object> attCombo,
+ private String setSelectedAttribute(JComboBox<String> attCombo,
FeatureMatcherI filter)
{
String item = null;
* @param valueField
* @param filterIndex
*/
- protected boolean updateFilter(JComboBox<Object> attCombo,
+ protected boolean updateFilter(JComboBox<String> attCombo,
JComboBox<Condition> condCombo, JTextField valueField,
int filterIndex)
{
- String attName;
- try
- {
- attName = (String) attCombo.getSelectedItem();
- } catch (Exception e)
- {
- Cache.log.error("Problem casting Combo box entry to String");
- attName = attCombo.getSelectedItem().toString();
- }
+ String attName = (String) attCombo.getSelectedItem();
Condition cond = (Condition) condCombo.getSelectedItem();
String pattern = valueField.getText().trim();