+/*
+ * 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.AssertJUnit.assertEquals;
import jalview.io.FormatAdapter;
import jalview.structure.StructureSelectionManager;
-import java.util.LinkedHashSet;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.List;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
AlignedCodonFrame acf1 = new AlignedCodonFrame();
AlignedCodonFrame acf2 = new AlignedCodonFrame();
- Set<AlignedCodonFrame> mappings = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings = new ArrayList<AlignedCodonFrame>();
mappings.add(acf1);
mappings.add(acf2);
af1.getViewport().getAlignment().setCodonFrames(mappings);
*/
StructureSelectionManager ssm = StructureSelectionManager
.getStructureSelectionManager(Desktop.instance);
- assertEquals(2, ssm.seqmappings.size());
- assertTrue(ssm.seqmappings.contains(acf1));
- assertTrue(ssm.seqmappings.contains(acf2));
+ assertEquals(2, ssm.getSequenceMappings().size());
+ assertTrue(ssm.getSequenceMappings().contains(acf1));
+ assertTrue(ssm.getSequenceMappings().contains(acf2));
/*
* Close the second view. Verify that mappings are not removed as the first
* view still holds a reference to them.
*/
af1.closeMenuItem_actionPerformed(false);
- assertEquals(2, ssm.seqmappings.size());
- assertTrue(ssm.seqmappings.contains(acf1));
- assertTrue(ssm.seqmappings.contains(acf2));
+ assertEquals(2, ssm.getSequenceMappings().size());
+ assertTrue(ssm.getSequenceMappings().contains(acf1));
+ assertTrue(ssm.getSequenceMappings().contains(acf2));
}
/**
AlignedCodonFrame acf2 = new AlignedCodonFrame();
AlignedCodonFrame acf3 = new AlignedCodonFrame();
- Set<AlignedCodonFrame> mappings1 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings1 = new ArrayList<AlignedCodonFrame>();
mappings1.add(acf1);
af1.getViewport().getAlignment().setCodonFrames(mappings1);
- Set<AlignedCodonFrame> mappings2 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings2 = new ArrayList<AlignedCodonFrame>();
mappings2.add(acf2);
mappings2.add(acf3);
af2.getViewport().getAlignment().setCodonFrames(mappings2);
* AlignFrame1 has mapping acf1, AlignFrame2 has acf2 and acf3
*/
- Set<AlignedCodonFrame> ssmMappings = ssm.seqmappings;
+ List<AlignedCodonFrame> ssmMappings = ssm.getSequenceMappings();
assertEquals(0, ssmMappings.size());
ssm.registerMapping(acf1);
assertEquals(1, ssmMappings.size());
AlignedCodonFrame acf2 = new AlignedCodonFrame();
AlignedCodonFrame acf3 = new AlignedCodonFrame();
- Set<AlignedCodonFrame> mappings1 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings1 = new ArrayList<AlignedCodonFrame>();
mappings1.add(acf1);
mappings1.add(acf2);
af1.getViewport().getAlignment().setCodonFrames(mappings1);
- Set<AlignedCodonFrame> mappings2 = new LinkedHashSet<AlignedCodonFrame>();
+ List<AlignedCodonFrame> mappings2 = new ArrayList<AlignedCodonFrame>();
mappings2.add(acf2);
mappings2.add(acf3);
af2.getViewport().getAlignment().setCodonFrames(mappings2);
* AlignFrame1 has mappings acf1 and acf2, AlignFrame2 has acf2 and acf3
*/
- Set<AlignedCodonFrame> ssmMappings = ssm.seqmappings;
+ List<AlignedCodonFrame> ssmMappings = ssm.getSequenceMappings();
assertEquals(0, ssmMappings.size());
ssm.registerMapping(acf1);
assertEquals(1, ssmMappings.size());