jalview.io.FeaturesFile ffile = new jalview.io.FeaturesFile();
- if (reply == JOptionPane.OK_OPTION
- && name.getText() != null
- && source.getText() != null)
+ if (reply == JOptionPane.OK_OPTION && name.getText().length()>0)
{
// This ensures that the last sequence
// is refreshed and new features are rendered
lastSeq = null;
- lastFeatureAdded = name.getText();
- lastFeatureGroupAdded = source.getText();
+ lastFeatureAdded = name.getText().trim();
+ lastFeatureGroupAdded = source.getText().trim();
lastDescriptionAdded = description.getText().replaceAll("\n", " ");
+
+ if(lastFeatureGroupAdded.length()<1)
+ lastFeatureGroupAdded = null;
}
if (!newFeatures)
featureGroups = new Hashtable();
}
- featureGroups.put(lastFeatureGroupAdded, new Boolean(true));
Color col = colour.getBackground();
setColour(lastFeatureAdded, colour.getBackground());
- av.featuresDisplayed.put(lastFeatureGroupAdded,
- new Integer(col.getRGB()));
-
+ if(lastFeatureGroupAdded!=null)
+ {
+ featureGroups.put(lastFeatureGroupAdded, new Boolean(true));
+ av.featuresDisplayed.put(lastFeatureGroupAdded,
+ new Integer(col.getRGB()));
+ }
findAllFeatures();
return true;