+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.gui;
import static org.testng.Assert.assertEquals;
* check i18n for display name
*/
String label = MessageManager.getStringOrReturn("label.colourScheme_",
- name.toLowerCase().replace(" ", "_"));
+ name);
assertEquals(item.getText(), label);
}
PopupMenu popup = new PopupMenu(af.alignPanel, s1, null);
ButtonGroup bg = ColourMenuHelper.addMenuItems(menu, popup, al, false);
Enumeration<AbstractButton> bgElements = bg.getElements();
-
+
/*
* first entry is 'No Colour' option
*/
assertEquals(item.getText(), MessageManager.getString("label.none"));
AbstractButton bgItem = bgElements.nextElement();
assertSame(bgItem, item);
-
+
/*
* check that each registered colour scheme is in the menu,
* and in the button group;
{
assertTrue(enabled);
}
-
+
/*
* check i18n for display name
*/
String label = MessageManager.getStringOrReturn("label.colourScheme_",
- name.toLowerCase().replace(" ", "_"));
+ name);
assertEquals(item.getText(), label);
}
-
+
/*
* check nothing left over
*/
SequenceI s1 = new Sequence("s1", "KFRQSILM");
AlignmentI al = new Alignment(new SequenceI[] { s1 });
JMenu menu = new JMenu();
-
+
ButtonGroup bg = ColourMenuHelper.addMenuItems(menu, null, al, true);
Enumeration<AbstractButton> bgElements = bg.getElements();
-
+
/*
* check that only 'simple' colour schemes are included
*/
AbstractButton bgItem = bgElements.nextElement();
assertSame(bgItem, item);
}
-
+
/*
* check nothing left over
*/
AlignmentI al = new Alignment(new SequenceI[] { s1 });
AlignFrame af = new AlignFrame(al, 500, 500);
JMenu menu = new JMenu();
-
+
ButtonGroup bg = ColourMenuHelper.addMenuItems(menu, af, al, false);
Enumeration<AbstractButton> bgElements = bg.getElements();
-
+
/*
* check that each registered colour scheme is in the menu,
* (skipping over No Colour which is the first menu item),
ColourSchemeI cs = colourSchemes.next();
assertEquals(item.getName(), cs.getSchemeName());
}
-
+
/*
* check menu also has User Defined Colour
*/