- static String lastFeatureAdded;
- static String lastFeatureGroupAdded;
- static String lastDescriptionAdded;
-
- int featureIndex = 0;
- boolean amendFeatures(final SequenceI[] sequences,
- final SequenceFeature[] features,
- boolean newFeatures,
- final AlignmentPanel ap)
- {
-
- featureIndex = 0;
-
- JPanel bigPanel = new JPanel(new BorderLayout());
- final JComboBox overlaps;
- final JTextField name = new JTextField(25);
- final JTextField source = new JTextField(25);
- final JTextArea description = new JTextArea(3, 25);
- final JSpinner start = new JSpinner();
- final JSpinner end = new JSpinner();
- start.setPreferredSize(new Dimension(80, 20));
- end.setPreferredSize(new Dimension(80, 20));
-
- final JPanel colour = new JPanel();
- colour.setBorder(BorderFactory.createEtchedBorder());
- colour.setMaximumSize(new Dimension(40, 10));
- colour.addMouseListener(new MouseAdapter()
- {
- public void mousePressed(MouseEvent evt)
- {
- Color col = JColorChooser.showDialog(Desktop.desktop,
- "Select Feature Colour",
- colour.getBackground());
- if (col != null)
- colour.setBackground(col);
-
- }
- });
-
- JPanel tmp = new JPanel();
- JPanel panel = new JPanel(new GridLayout(3, 1));
-
- ///////////////////////////////////////
- ///MULTIPLE FEATURES AT SELECTED RESIDUE
- if(!newFeatures && features.length>1)
- {
- panel = new JPanel(new GridLayout(4, 1));
- tmp = new JPanel();
- tmp.add(new JLabel("Select Feature: "));
- overlaps = new JComboBox();
- for(int i=0; i<features.length; i++)
- {
- overlaps.addItem(features[i].getType()
- +"/"+features[i].getBegin()+"-"+features[i].getEnd()
- +" ("+features[i].getFeatureGroup()+")");
- }
-
- tmp.add(overlaps);
-
- overlaps.addItemListener(new ItemListener()
- {
- public void itemStateChanged(ItemEvent e)
- {
- int index = overlaps.getSelectedIndex();
- if (index != -1)
- {
- featureIndex = index;
- name.setText(features[index].getType());
- description.setText(features[index].getDescription());
- source.setText(features[index].getFeatureGroup());
- start.setValue(new Integer(features[index].getBegin()));
- end.setValue(new Integer(features[index].getEnd()));
-
- SearchResults highlight = new SearchResults();
- highlight.addResult(sequences[0],
- features[index].getBegin(),
- features[index].getEnd());
-
- ap.seqPanel.seqCanvas.highlightSearchResults(highlight);
-
- }
- Color col = getColour(name.getText());
- if (col == null)
- {
- col = new
- jalview.schemes.UserColourScheme()
- .createColourFromName(name.getText());
- }
-
- colour.setBackground(col);
- }
- });
-
-
- panel.add(tmp);