*/
package jalview.schemes;
+import jalview.api.AlignViewportI;
import jalview.datamodel.AnnotatedCollectionI;
-import jalview.datamodel.SequenceCollectionI;
-import jalview.datamodel.SequenceI;
import jalview.util.ColorUtils;
import jalview.util.StringUtils;
}
@Override
- public ColourSchemeI getInstance(AnnotatedCollectionI sg,
- Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
+ public ColourSchemeI getInstance(AlignViewportI view,
+ AnnotatedCollectionI sg)
{
return new UserColourScheme(this);
}
schemeName = from.schemeName;
if (from.lowerCaseColours != null)
{
- lowerCaseColours = new Color[lowerCaseColours.length];
+ lowerCaseColours = new Color[from.lowerCaseColours.length];
System.arraycopy(from.lowerCaseColours, 0, lowerCaseColours, 0,
from.lowerCaseColours.length);
}
{
lowerCaseColours = new Color[colors.length];
}
- lowerCaseColours[colIndex] = ColorUtils.parseColourString(colour);
+ lowerCaseColours[colIndex] = ColorUtils
+ .parseColourString(colour);
}
else
{
}
} catch (Exception ex)
{
- System.out.println("Error parsing userDefinedColours:\n" + token
- + "\n" + ex);
+ System.out.println(
+ "Error parsing userDefinedColours:\n" + token + "\n" + ex);
}
}
}
/**
- * Answers the customised name of the colour scheme, if it has one, else
- * "User Defined"
+ * Answers the customised name of the colour scheme, if it has one, else "User
+ * Defined"
*/
@Override
public String getSchemeName()
{
return schemeName;
}
- return "User Defined";
+ return ResidueColourScheme.USER_DEFINED;
}
/**
/*
* step 1: build a map from colours to the symbol(s) that have the colour
*/
- Map<Color, List<String>> colours = new HashMap<Color, List<String>>();
+ Map<Color, List<String>> colours = new HashMap<>();
for (char symbol = 'A'; symbol <= 'Z'; symbol++)
{
/*
* step 2: make a list of { A,G,R=12f9d6 } residues/colour specs
*/
- List<String> residueColours = new ArrayList<String>();
+ List<String> residueColours = new ArrayList<>();
for (Entry<Color, List<String>> cols : colours.entrySet())
{
boolean first = true;
Collections.sort(residueColours);
return StringUtils.listToDelimitedString(residueColours, ";");
}
+
+ @Override
+ public boolean hasGapColour()
+ {
+ return (findColour(' ') != null);
+ }
}