X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FFeaturesFile.java;h=48eeee38286fc7e3fad4d09cd78268045489cf93;hb=8e1be43e250107a4d86898bd554cf03098fa5957;hp=aa38540d559b7c09c2203f59dd0a6bfc59519789;hpb=bf0d052fef43e9809b7170dbfd372b3ea116391b;p=jalview.git diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index aa38540..48eeee3 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -35,11 +35,12 @@ import jalview.io.gff.GffHelperBase; import jalview.io.gff.GffHelperFactory; import jalview.io.gff.GffHelperI; import jalview.schemes.FeatureColour; -import jalview.schemes.UserColourScheme; +import jalview.util.ColorUtils; import jalview.util.MapList; import jalview.util.ParseHtmlBodyAndLinks; import jalview.util.StringUtils; +import java.awt.Color; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -94,12 +95,13 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * Constructor which does not parse the file immediately * * @param inFile - * @param type + * @param paste * @throws IOException */ - public FeaturesFile(String inFile, String type) throws IOException + public FeaturesFile(String inFile, DataSourceType paste) + throws IOException { - super(false, inFile, type); + super(false, inFile, paste); } /** @@ -119,7 +121,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @param type * @throws IOException */ - public FeaturesFile(boolean parseImmediately, String inFile, String type) + public FeaturesFile(boolean parseImmediately, String inFile, + DataSourceType type) throws IOException { super(parseImmediately, inFile, type); @@ -138,8 +141,7 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @return true if features were added */ public boolean parse(AlignmentI align, - Map colours, - boolean removeHTML) + Map colours, boolean removeHTML) { return parse(align, colours, removeHTML, false); } @@ -176,8 +178,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @return true if features were added */ public boolean parse(AlignmentI align, - Map colours, - boolean removeHTML, boolean relaxedIdmatching) + Map colours, boolean removeHTML, + boolean relaxedIdmatching) { Map gffProps = new HashMap(); /* @@ -354,8 +356,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * Perhaps an old style groups file with no colours - * synthesize a colour from the feature type */ - UserColourScheme ucs = new UserColourScheme(ft); - featureColours.put(ft, new FeatureColour(ucs.findColour('A'))); + Color colour = ColorUtils.createColourFromName(ft); + featureColours.put(ft, new FeatureColour(colour)); } SequenceFeature sf = new SequenceFeature(ft, desc, "", startPos, endPos, featureGroup); @@ -587,7 +589,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI { for (SequenceFeature sequenceFeature : features) { - isnonpos = sequenceFeature.begin == 0 && sequenceFeature.end == 0; + isnonpos = sequenceFeature.begin == 0 + && sequenceFeature.end == 0; if ((!nonpos && isnonpos) || (!isnonpos && visOnly && !visible .containsKey(sequenceFeature.type))) @@ -710,7 +713,8 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI dataset = new Alignment(new SequenceI[] {}); } - boolean parseResult = parse(dataset, null, false, true); + Map featureColours = new HashMap(); + boolean parseResult = parse(dataset, featureColours, false, true); if (!parseResult) { // pass error up somehow @@ -731,9 +735,10 @@ public class FeaturesFile extends AlignFile implements FeaturesSourceI * @return error message */ @Override - public String print() + public String print(SequenceI[] sqs, boolean jvsuffix) { - return "Use printGffFormat() or printJalviewFormat()"; + System.out.println("Use printGffFormat() or printJalviewFormat()"); + return null; } /**