2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
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.
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.
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.
21 package jalview.ext.rbvi.chimera;
23 import static org.testng.AssertJUnit.assertEquals;
25 import java.awt.Color;
26 import java.util.LinkedHashMap;
29 import org.testng.annotations.Test;
31 public class ChimeraCommandsTest
33 @Test(groups = { "Functional" })
34 public void testBuildColourCommands()
37 Map<Color, AtomSpecModel> map = new LinkedHashMap<Color, AtomSpecModel>();
38 ChimeraCommands.addColourRange(map, Color.blue, 0, 2, 5, "A");
39 ChimeraCommands.addColourRange(map, Color.blue, 0, 7, 7, "B");
40 ChimeraCommands.addColourRange(map, Color.blue, 0, 9, 23, "A");
41 ChimeraCommands.addColourRange(map, Color.blue, 1, 1, 1, "A");
42 ChimeraCommands.addColourRange(map, Color.blue, 1, 4, 7, "B");
43 ChimeraCommands.addColourRange(map, Color.yellow, 1, 8, 8, "A");
44 ChimeraCommands.addColourRange(map, Color.yellow, 1, 3, 5, "A");
45 ChimeraCommands.addColourRange(map, Color.red, 0, 3, 5, "A");
46 ChimeraCommands.addColourRange(map, Color.red, 0, 6, 9, "A");
48 // Colours should appear in the Chimera command in the order in which
49 // they were added; within colour, by model, by chain, ranges in start order
50 String command = ChimeraCommands.buildColourCommands(map).get(0);
52 "color #0000ff #0:2-5.A,9-23.A,7.B|#1:1.A,4-7.B; color #ffff00 #1:3-5.A,8.A; color #ff0000 #0:3-9.A",