e7a302e49e768d47b1f58ed99d3d7fa89a96cb3c
[jalview.git] / src / jalview / json / binding / biojson / v1 / JalviewBioJsColorSchemeMapper.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.json.binding.biojson.v1;
22
23 import jalview.schemes.Blosum62ColourScheme;
24 import jalview.schemes.BuriedColourScheme;
25 import jalview.schemes.ColourSchemeI;
26 import jalview.schemes.HelixColourScheme;
27 import jalview.schemes.HydrophobicColourScheme;
28 import jalview.schemes.NucleotideColourScheme;
29 import jalview.schemes.PIDColourScheme;
30 import jalview.schemes.PurinePyrimidineColourScheme;
31 import jalview.schemes.RNAInteractionColourScheme;
32 import jalview.schemes.StrandColourScheme;
33 import jalview.schemes.TaylorColourScheme;
34 import jalview.schemes.TurnColourScheme;
35 import jalview.schemes.ZappoColourScheme;
36
37 public enum JalviewBioJsColorSchemeMapper
38 {
39
40   USER_DEFINED("User Defined", "user defined", null), NONE("None", "foo",
41           null), CLUSTAL("Clustal", "clustal", null), ZAPPO("Zappo",
42           "zappo", new ZappoColourScheme()), TAYLOR("Taylor", "taylor",
43           new TaylorColourScheme()), NUCLEOTIDE("Nucleotide", "nucleotide",
44           new NucleotideColourScheme()), PURINE_PYRIMIDINE(
45           "Purine/Pyrimidine", "purine", new PurinePyrimidineColourScheme()), HELIX_PROPENSITY(
46           "Helix Propensity", "helix", new HelixColourScheme()), TURN_PROPENSITY(
47           "Turn Propensity", "turn", new TurnColourScheme()), STRAND_PROPENSITY(
48           "Strand Propensity", "strand", new StrandColourScheme()), BURIED_INDEX(
49           "Buried Index", "buried", new BuriedColourScheme()), HYDROPHOBIC(
50           "Hydrophobic", "hydro", new HydrophobicColourScheme()),
51
52   // The color types below are not yet supported by BioJs MSA viewer
53   T_COFFE_SCORES("T-Coffee Scores", "T-Coffee Scores", null), RNA_INT_TYPE(
54           "RNA Interaction type", "RNA Interaction type",
55           new RNAInteractionColourScheme()), BLOSUM62("Blosum62",
56           "Blosum62", new Blosum62ColourScheme()), RNA_HELICES(
57           "RNA Helices", "RNA Helices", null), PERCENTAGE_IDENTITY(
58           "% Identity", "pid", new PIDColourScheme());
59
60   private String jalviewName;
61
62   private String bioJsName;
63
64   private ColourSchemeI jvColourScheme;
65
66   private JalviewBioJsColorSchemeMapper(String jalviewName,
67           String bioJsName, ColourSchemeI jvColourScheme)
68   {
69     this.jalviewName = jalviewName;
70     this.bioJsName = bioJsName;
71     this.setJvColourScheme(jvColourScheme);
72   }
73
74   public String getJalviewName()
75   {
76     return jalviewName;
77   }
78
79   public String getBioJsName()
80   {
81     return bioJsName;
82   }
83
84   public ColourSchemeI getJvColourScheme()
85   {
86     return jvColourScheme;
87   }
88
89   public void setJvColourScheme(ColourSchemeI jvColourScheme)
90   {
91     this.jvColourScheme = jvColourScheme;
92   }
93
94 }