if (col != null)
{
fcol = new FeatureColour(col);
- updateColourButton(mainPanel, colour, new FeatureColour(col));
+ updateColourButton(mainPanel, colour, fcol);
}
}
else
end.setValue(new Integer(firstFeature.getEnd()));
description.setText(firstFeature.getDescription());
updateColourButton(mainPanel, colour,
- (oldcol = fcol = getFeatureStyle(name.getText())));
+ (oldcol = fcol = getFeatureStyle(featureType)));
Object[] options;
if (!create)
{
FeaturesFile ffile = new FeaturesFile();
- if (reply == JvOptionPane.OK_OPTION && name.getText().length() > 0)
+ String enteredType = name.getText().trim();
+ if (reply == JvOptionPane.OK_OPTION && enteredType.length() > 0)
{
/*
* update default values only if creating using default values
*/
if (useLastDefaults)
{
- lastFeatureAdded = name.getText().trim();
+ lastFeatureAdded = enteredType;
lastFeatureGroupAdded = group.getText().trim();
// TODO: determine if the null feature group is valid
if (lastFeatureGroupAdded.length() < 1)
* YES_OPTION corresponds to the Amend button
* need to refresh Feature Settings if type, group or colour changed
*/
- sf.type = name.getText().trim();
+ sf.type = enteredType;
sf.featureGroup = group.getText().trim();
sf.description = description.getText().replaceAll("\n", " ");
boolean refreshSettings = (!featureType.equals(sf.type) || !featureGroup
else
// NEW FEATURES ADDED
{
- if (reply == JvOptionPane.OK_OPTION && lastFeatureAdded.length() > 0)
+ if (reply == JvOptionPane.OK_OPTION && enteredType.length() > 0)
{
for (int i = 0; i < sequences.size(); i++)
{
SequenceFeature sf = features.get(i);
- sf.type = name.getText().trim();
+ sf.type = enteredType;
// fix for JAL-1538 - always set feature group here
sf.featureGroup = group.getText().trim();
sf.description = description.getText().replaceAll("\n", " ");
ffile.parseDescriptionHTML(sf, false);
}
- setColour(lastFeatureAdded, fcol);
+ setColour(enteredType, fcol);
featuresAdded();