X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FFeatureRenderer.java;h=beef70c25c67a68e50f9df5b5a550ea84b355f4e;hb=bc77e2f0f477053147a4e56b681131c710eb3ec8;hp=e73679582db90930fa10098d1eb943d84694bd23;hpb=197359781e7142ec6bcb53740831fc626c4675cd;p=jalview.git diff --git a/src/jalview/gui/FeatureRenderer.java b/src/jalview/gui/FeatureRenderer.java index e736795..beef70c 100755 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@ -212,7 +212,7 @@ public class FeatureRenderer { type = renderOrder[renderIndex]; - if(!av.featuresDisplayed.containsKey(type)) + if(type==null || !av.featuresDisplayed.containsKey(type)) continue; // loop through all features in sequence to find @@ -423,13 +423,14 @@ public class FeatureRenderer public boolean createNewFeatures(SequenceI[] sequences, SequenceFeature [] features) { - return amendFeatures(sequences, features, true); + return amendFeatures(sequences, features, true, null); } int featureIndex = 0; - boolean amendFeatures(SequenceI[] sequences, - final SequenceFeature [] features, - boolean newFeatures) + boolean amendFeatures(final SequenceI[] sequences, + final SequenceFeature[] features, + boolean newFeatures, + final AlignmentPanel ap) { JPanel bigPanel = new JPanel(new BorderLayout()); final JComboBox name = new JComboBox(); @@ -437,7 +438,8 @@ public class FeatureRenderer 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)); @@ -477,9 +479,9 @@ public class FeatureRenderer bigPanel.add(panel, BorderLayout.SOUTH); panel = new JPanel(); - panel.add(new JLabel(" Start: ", JLabel.RIGHT)); + panel.add(new JLabel(" Start:", JLabel.RIGHT)); panel.add(start); - panel.add(new JLabel(" End: ", JLabel.RIGHT)); + panel.add(new JLabel(" End:", JLabel.RIGHT)); panel.add(end); bigPanel.add(panel, BorderLayout.CENTER); } @@ -529,12 +531,10 @@ public class FeatureRenderer if (getColour(lastFeatureAdded) != null) { colour.setBackground(getColour(lastFeatureAdded)); - colour.setForeground(getColour(lastFeatureAdded)); } else { colour.setBackground(new Color(60, 160, 115)); - colour.setForeground(new Color(60, 160, 115)); } } @@ -566,9 +566,22 @@ public class FeatureRenderer end.setValue(new Integer(features[index].getEnd())); colour.setBackground( getColour(name.getSelectedItem().toString())); - colour.setForeground( - getColour(name.getSelectedItem().toString())); + + SearchResults highlight = new SearchResults(); + highlight.addResult(sequences[0], + features[index].getBegin(), + features[index].getEnd()); + + ap.seqPanel.seqCanvas.highlightSearchResults(highlight); + } + Color col = getColour(name.getSelectedItem().toString()); + if (col == null) + col = new + jalview.schemes.UserColourScheme() + .createColourFromName(name.getSelectedItem().toString()); + + colour.setBackground(col); } }); @@ -582,7 +595,8 @@ public class FeatureRenderer options = new Object[]{"OK", "Cancel"}; String title = newFeatures ? "Create New Sequence Feature(s)" : - "Amend/Delete Features"; + "Amend/Delete Features for " + +sequences[0].getName(); int reply = JOptionPane.showInternalOptionDialog(Desktop.desktop, bigPanel,