*/
class Stripy extends ResidueColourScheme
{
+ private ColourSchemeI odd;
+
+ private ColourSchemeI even;
+
+ private Stripy()
+ {
+ }
+
+ /**
+ * constructor given colours for odd and even columns
+ *
+ * @param odd
+ * @param even
+ */
+ private Stripy(ColourSchemeI cs1, ColourSchemeI cs2)
+ {
+ odd = cs1;
+ even = cs2;
+ }
+
@Override
public ColourSchemeI getInstance(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
{
- final ColourSchemeI odd = ColourSchemes.getInstance()
+ final ColourSchemeI cs1 = ColourSchemes.getInstance()
.getColourScheme(JalviewColourScheme.Taylor.toString(),
(AnnotatedCollectionI) null);
- final ColourSchemeI even = ColourSchemes.getInstance()
+ final ColourSchemeI cs2 = ColourSchemes.getInstance()
.getColourScheme(JalviewColourScheme.Zappo.toString(),
(AnnotatedCollectionI) null);
- return new ResidueColourScheme() {
- @Override
- public Color findColour(char c, int j, SequenceI seq)
- {
- if (j % 2 == 1)
- {
- return odd.findColour(c, j, seq);
- }
- else
- {
- return even.findColour(c, j, seq);
- }
- }
-
- @Override
- public ColourSchemeI getInstance(AnnotatedCollectionI ac,
- Map<SequenceI, SequenceCollectionI> hrs)
- {
- return null;
- }
+ return new Stripy(cs1, cs2);
+ }
- @Override
- public String getSchemeName()
- {
- return Stripy.this.getSchemeName();
- }
-
- };
+ @Override
+ public Color findColour(char c, int j, SequenceI seq)
+ {
+ if (j % 2 == 1)
+ {
+ return odd.findColour(c, j, seq);
+ }
+ else
+ {
+ return even.findColour(c, j, seq);
+ }
}
-
+
@Override
public String getSchemeName()
{
{
ColourSchemeI delegate;
- public MyClustal()
+ private MyClustal()
{
}
- public MyClustal(ColourSchemeI scheme)
+ private MyClustal(ColourSchemeI scheme)
{
delegate = scheme;
}