Debian Codegraph @

src/dr/app/beauti/alignmentviewer/VolumeAminoAcidDecorator.java

raw symbols SCIP
1 /*
2 * VolumeAminoAcidDecorator.java
3 *
4 * Copyright (c) 2002-2015 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
24 */
25
26 package dr.app.beauti.alignmentviewer;
27
28 import jebl.evolution.sequences.AminoAcids;
29
30 import java.awt.*;
31
32 /**
33 * @author Andrew Rambaut
34 * @version $Id: VolumeAminoAcidDecorator.java,v 1.1 2005/11/11 16:40:41 rambaut Exp $
35 */
36 public class VolumeAminoAcidDecorator implements StateDecorator {
37 Paint[] paints = new Paint[AminoAcids.getStateCount()];
38
39 public VolumeAminoAcidDecorator() {
40 // 60-90
41 paints[AminoAcids.G_STATE.getIndex()] =
42 paints[AminoAcids.A_STATE.getIndex()] =
43 paints[AminoAcids.S_STATE.getIndex()] =
44 new Color(255, 153, 153);
45
46 // 108-117
47 paints[AminoAcids.C_STATE.getIndex()] =
48 paints[AminoAcids.D_STATE.getIndex()] =
49 paints[AminoAcids.P_STATE.getIndex()] =
50 paints[AminoAcids.N_STATE.getIndex()] =
51 paints[AminoAcids.T_STATE.getIndex()] =
52 new Color(230, 6, 6);
53
54 // 138-154
55 paints[AminoAcids.E_STATE.getIndex()] =
56 paints[AminoAcids.V_STATE.getIndex()] =
57 paints[AminoAcids.Q_STATE.getIndex()] =
58 paints[AminoAcids.H_STATE.getIndex()] =
59 new Color(255, 255, 0);
60
61 // 162-174
62 paints[AminoAcids.M_STATE.getIndex()] =
63 paints[AminoAcids.I_STATE.getIndex()] =
64 paints[AminoAcids.L_STATE.getIndex()] =
65 paints[AminoAcids.K_STATE.getIndex()] =
66 paints[AminoAcids.R_STATE.getIndex()] =
67 new Color(153, 204, 255);
68 // 189-228
69 paints[AminoAcids.F_STATE.getIndex()] =
70 paints[AminoAcids.Y_STATE.getIndex()] =
71 paints[AminoAcids.W_STATE.getIndex()] =
72 new Color(51, 102, 255);
73
74 paints[AminoAcids.B_STATE.getIndex()] = Color.DARK_GRAY;
75 paints[AminoAcids.Z_STATE.getIndex()] = Color.DARK_GRAY;
76 paints[AminoAcids.X_STATE.getIndex()] = Color.GRAY;
77 paints[AminoAcids.UNKNOWN_STATE.getIndex()] = Color.GRAY;
78 paints[AminoAcids.STOP_STATE.getIndex()] = Color.GRAY;
79 paints[AminoAcids.GAP_STATE.getIndex()] = Color.GRAY;
80 };
81
82 public Paint getStatePaint(int stateIndex) {
83 return paints[stateIndex];
84 }
85 }