{\r
type = renderOrder[renderIndex];\r
\r
- if(!av.featuresDisplayed.containsKey(type))\r
+ if(type==null || !av.featuresDisplayed.containsKey(type))\r
continue;\r
\r
// loop through all features in sequence to find\r
int pady = (y1 + av.charHeight) - av.charHeight / 5;\r
for (i = fstart; i <= fend; i++)\r
{\r
- s = seq.getSequence().charAt(i);\r
+ s = seq.getCharAt(i);\r
\r
if (jalview.util.Comparison.isGap(s))\r
{\r
public boolean createNewFeatures(SequenceI[] sequences,\r
SequenceFeature [] features)\r
{\r
- return amendFeatures(sequences, features, true);\r
+ return amendFeatures(sequences, features, true, null);\r
}\r
\r
int featureIndex = 0;\r
- boolean amendFeatures(SequenceI[] sequences,\r
- final SequenceFeature [] features,\r
- boolean newFeatures)\r
+ boolean amendFeatures(final SequenceI[] sequences,\r
+ final SequenceFeature[] features,\r
+ boolean newFeatures,\r
+ final AlignmentPanel ap)\r
{\r
JPanel bigPanel = new JPanel(new BorderLayout());\r
final JComboBox name = new JComboBox();\r
final JTextArea description = new JTextArea(3,25);\r
final JSpinner start = new JSpinner();\r
final JSpinner end = new JSpinner();\r
-\r
- // final JTextField start = new JTextField(6);\r
- // final JTextField end = new JTextField(6);\r
- final JButton colour = new JButton(" ");\r
+ start.setPreferredSize(new Dimension(80,20));\r
+ end.setPreferredSize(new Dimension(80,20));\r
+ final JPanel colour = new JPanel();\r
+ colour.setBorder(BorderFactory.createEtchedBorder());\r
colour.setMaximumSize(new Dimension(40,10));\r
- colour.addActionListener(new ActionListener()\r
+ colour.addMouseListener(new MouseAdapter()\r
{\r
- public void actionPerformed(ActionEvent evt)\r
+ public void mousePressed(MouseEvent evt)\r
{\r
colour.setBackground(\r
JColorChooser.showDialog(Desktop.desktop,\r
bigPanel.add(panel, BorderLayout.SOUTH);\r
\r
panel = new JPanel();\r
- panel.add(new JLabel(" Start: ", JLabel.RIGHT));\r
+ panel.add(new JLabel(" Start:", JLabel.RIGHT));\r
panel.add(start);\r
- panel.add(new JLabel(" End: ", JLabel.RIGHT));\r
+ panel.add(new JLabel(" End:", JLabel.RIGHT));\r
panel.add(end);\r
bigPanel.add(panel, BorderLayout.CENTER);\r
}\r
if (getColour(lastFeatureAdded) != null)\r
{\r
colour.setBackground(getColour(lastFeatureAdded));\r
- colour.setForeground(getColour(lastFeatureAdded));\r
}\r
else\r
{\r
colour.setBackground(new Color(60, 160, 115));\r
- colour.setForeground(new Color(60, 160, 115));\r
}\r
\r
}\r
end.setValue(new Integer(features[index].getEnd()));\r
colour.setBackground(\r
getColour(name.getSelectedItem().toString()));\r
- colour.setForeground(\r
- getColour(name.getSelectedItem().toString()));\r
+\r
+ SearchResults highlight = new SearchResults();\r
+ highlight.addResult(sequences[0],\r
+ features[index].getBegin(),\r
+ features[index].getEnd());\r
+\r
+ ap.seqPanel.seqCanvas.highlightSearchResults(highlight);\r
+\r
}\r
+ Color col = getColour(name.getSelectedItem().toString());\r
+ if (col == null)\r
+ col = new\r
+ jalview.schemes.UserColourScheme()\r
+ .createColourFromName(name.getSelectedItem().toString());\r
+\r
+ colour.setBackground(col);\r
}\r
});\r
\r
else\r
options = new Object[]{"OK", "Cancel"};\r
\r
+ String title = newFeatures ? "Create New Sequence Feature(s)" :\r
+ "Amend/Delete Features for "\r
+ +sequences[0].getName();\r
+\r
int reply = JOptionPane.showInternalOptionDialog(Desktop.desktop,\r
bigPanel,\r
- newFeatures ?\r
- "Create New Sequence Feature(s)" :\r
- "Amend/Delete Features",\r
+ title,\r
JOptionPane.YES_NO_CANCEL_OPTION,\r
JOptionPane.QUESTION_MESSAGE,\r
null,\r