From 6c32da957091bb863e5bc70e94b13fd4bf72cf38 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 26 Mar 2018 12:44:47 +0100 Subject: [PATCH] JAL-2939 pull up set/IsNormalise[HMM]SequenceLogo --- src/jalview/appletgui/AlignViewport.java | 17 ------------- src/jalview/gui/AlignViewport.java | 26 -------------------- src/jalview/gui/CalculationChooser.java | 12 +++++---- src/jalview/gui/Desktop.java | 3 ++- src/jalview/gui/OverviewPanel.java | 3 ++- src/jalview/gui/PairwiseAlignPanel.java | 9 +++---- src/jalview/gui/SplitFrame.java | 5 ++-- src/jalview/hmmer/HMMBuild.java | 4 +-- src/jalview/viewmodel/AlignmentViewport.java | 22 +++++++++++++++++ .../scoremodels/FeatureDistanceModelTest.java | 4 +-- test/jalview/datamodel/AlignmentViewTest.java | 4 +-- test/jalview/datamodel/HiddenSequencesTest.java | 3 ++- test/jalview/gui/AlignFrameTest.java | 10 +++++--- test/jalview/gui/AlignViewportTest.java | 12 ++++----- test/jalview/gui/PairwiseAlignmentPanelTest.java | 10 +++++--- test/jalview/gui/SequenceRendererTest.java | 3 ++- test/jalview/io/Jalview2xmlTests.java | 3 +-- .../renderer/OverviewResColourFinderTest.java | 16 ++++++------ test/jalview/renderer/ResidueColourFinderTest.java | 8 +++--- test/jalview/renderer/ScaleRendererTest.java | 4 +-- .../seqfeatures/FeatureColourFinderTest.java | 4 +-- test/jalview/schemes/PIDColourSchemeTest.java | 4 +-- 22 files changed, 87 insertions(+), 99 deletions(-) diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index b0d6f85..753e972 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -299,17 +299,6 @@ public class AlignViewport extends AlignmentViewport .getStructureSelectionManager(applet); } - @Override - public boolean isNormaliseSequenceLogo() - { - return normaliseSequenceLogo; - } - - public void setNormaliseSequenceLogo(boolean state) - { - normaliseSequenceLogo = state; - } - /** * * @return true if alignment characters should be displayed @@ -408,10 +397,4 @@ public class AlignViewport extends AlignmentViewport // TODO implement for applet } - @Override - public boolean isNormaliseHMMSequenceLogo() - { - return normaliseHMMSequenceLogo; - } - } diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 96fea6e..63cbfbd 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -35,7 +35,6 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.ColumnSelection; import jalview.datamodel.HiddenColumns; -import jalview.datamodel.PDBEntry; import jalview.datamodel.SearchResults; import jalview.datamodel.SearchResultsI; import jalview.datamodel.SequenceGroup; @@ -57,11 +56,9 @@ import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Rectangle; -import java.util.ArrayList; import java.util.Hashtable; import java.util.Iterator; import java.util.List; -import java.util.Vector; import javax.swing.JInternalFrame; @@ -588,23 +585,6 @@ public class AlignViewport extends AlignmentViewport .getStructureSelectionManager(Desktop.instance); } - @Override - public boolean isNormaliseSequenceLogo() - { - return normaliseSequenceLogo; - } - - - public void setNormaliseSequenceLogo(boolean state) - { - normaliseSequenceLogo = state; - } - - public void setNormaliseHMMSequenceLogo(boolean state) - { - normaliseHMMSequenceLogo = state; - } - /** * * @return true if alignment characters should be displayed @@ -1045,10 +1025,4 @@ public class AlignViewport extends AlignmentViewport fr.setTransparency(featureSettings.getTransparency()); } - @Override - public boolean isNormaliseHMMSequenceLogo() - { - return normaliseHMMSequenceLogo; - } - } diff --git a/src/jalview/gui/CalculationChooser.java b/src/jalview/gui/CalculationChooser.java index f674c7e..eaaf0a5 100644 --- a/src/jalview/gui/CalculationChooser.java +++ b/src/jalview/gui/CalculationChooser.java @@ -23,10 +23,12 @@ package jalview.gui; import jalview.analysis.TreeBuilder; import jalview.analysis.scoremodels.ScoreModels; import jalview.analysis.scoremodels.SimilarityParams; +import jalview.api.AlignViewportI; import jalview.api.analysis.ScoreModelI; import jalview.api.analysis.SimilarityParamsI; import jalview.datamodel.SequenceGroup; import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; import java.awt.BorderLayout; import java.awt.Color; @@ -103,7 +105,7 @@ public class CalculationChooser extends JPanel final ComboBoxTooltipRenderer renderer = new ComboBoxTooltipRenderer(); - List tips = new ArrayList(); + List tips = new ArrayList<>(); /* * the most recently opened PCA results panel @@ -375,7 +377,7 @@ public class CalculationChooser extends JPanel */ protected JComboBox buildModelOptionsList() { - final JComboBox scoreModelsCombo = new JComboBox(); + final JComboBox scoreModelsCombo = new JComboBox<>(); scoreModelsCombo.setRenderer(renderer); /* @@ -418,7 +420,7 @@ public class CalculationChooser extends JPanel { Object curSel = comboBox.getSelectedItem(); toolTips.clear(); - DefaultComboBoxModel model = new DefaultComboBoxModel(); + DefaultComboBoxModel model = new DefaultComboBoxModel<>(); /* * now we can actually add entries to the combobox, @@ -492,7 +494,7 @@ public class CalculationChooser extends JPanel * gui validation shouldn't allow insufficient sequences here, but leave * this check in in case this method gets exposed programmatically in future */ - AlignViewport viewport = af.getViewport(); + AlignViewportI viewport = af.getViewport(); SequenceGroup sg = viewport.getSelectionGroup(); if (sg != null && sg.getSize() < MIN_TREE_SELECTION) { @@ -519,7 +521,7 @@ public class CalculationChooser extends JPanel */ protected void openPcaPanel(String modelName, SimilarityParamsI params) { - AlignViewport viewport = af.getViewport(); + AlignViewportI viewport = af.getViewport(); /* * gui validation shouldn't allow insufficient sequences here, but leave diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 24ed1f7..b26a8af 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -1471,7 +1471,8 @@ public class Desktop extends jalview.jbgui.GDesktop return; } - AlignmentViewport source = null, target = null; + AlignViewportI source = null; + AlignViewportI target = null; if (frames[0] instanceof AlignFrame) { source = ((AlignFrame) frames[0]).getCurrentView(); diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 02d54a8..ffedede 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import jalview.api.AlignViewportI; import jalview.bin.Cache; import jalview.renderer.OverviewRenderer; import jalview.util.MessageManager; @@ -62,7 +63,7 @@ public class OverviewPanel extends JPanel private OverviewCanvas oviewCanvas; - private AlignViewport av; + private AlignViewportI av; private AlignmentPanel ap; diff --git a/src/jalview/gui/PairwiseAlignPanel.java b/src/jalview/gui/PairwiseAlignPanel.java index d081794..e736a11 100755 --- a/src/jalview/gui/PairwiseAlignPanel.java +++ b/src/jalview/gui/PairwiseAlignPanel.java @@ -21,13 +21,13 @@ package jalview.gui; import jalview.analysis.AlignSeq; +import jalview.api.AlignViewportI; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentView; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.jbgui.GPairwiseAlignPanel; import jalview.util.MessageManager; -import jalview.viewmodel.AlignmentViewport; import java.awt.event.ActionEvent; import java.util.Vector; @@ -43,7 +43,7 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel private static final String DASHES = "---------------------\n"; - AlignmentViewport av; + AlignViewportI av; Vector sequences; @@ -51,14 +51,13 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel * Creates a new PairwiseAlignPanel object. * * @param viewport - * DOCUMENT ME! */ - public PairwiseAlignPanel(AlignmentViewport viewport) + public PairwiseAlignPanel(AlignViewportI viewport) { super(); this.av = viewport; - sequences = new Vector(); + sequences = new Vector<>(); SequenceGroup selectionGroup = viewport.getSelectionGroup(); boolean isSelection = selectionGroup != null diff --git a/src/jalview/gui/SplitFrame.java b/src/jalview/gui/SplitFrame.java index 5bff407..56d1fac 100644 --- a/src/jalview/gui/SplitFrame.java +++ b/src/jalview/gui/SplitFrame.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import jalview.api.AlignViewportI; import jalview.api.SplitContainerI; import jalview.datamodel.AlignmentI; import jalview.jbgui.GAlignFrame; @@ -215,8 +216,8 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI topFrame.alignPanel.adjustAnnotationHeight(); bottomFrame.alignPanel.adjustAnnotationHeight(); - final AlignViewport topViewport = topFrame.viewport; - final AlignViewport bottomViewport = bottomFrame.viewport; + final AlignViewportI topViewport = topFrame.viewport; + final AlignViewportI bottomViewport = bottomFrame.viewport; final AlignmentI topAlignment = topViewport.getAlignment(); final AlignmentI bottomAlignment = bottomViewport.getAlignment(); boolean topAnnotations = topViewport.isShowAnnotation(); diff --git a/src/jalview/hmmer/HMMBuild.java b/src/jalview/hmmer/HMMBuild.java index 373c160..97dc59a 100644 --- a/src/jalview/hmmer/HMMBuild.java +++ b/src/jalview/hmmer/HMMBuild.java @@ -8,12 +8,12 @@ import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; -import jalview.gui.AlignViewport; import jalview.gui.JvOptionPane; import jalview.io.DataSourceType; import jalview.io.FileParse; import jalview.io.HMMFile; import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; import jalview.ws.params.ArgumentI; import java.io.File; @@ -66,7 +66,7 @@ public class HMMBuild extends HmmerCommand af.setProgressBar(MessageManager.getString("status.running_hmmbuild"), msgID); - AlignViewport viewport = af.getViewport(); + AlignViewportI viewport = af.getViewport(); try { /* diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index ff47484..0f46d5a 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -3076,4 +3076,26 @@ public abstract class AlignmentViewport { return currentTree; } + + @Override + public boolean isNormaliseSequenceLogo() + { + return normaliseSequenceLogo; + } + + public void setNormaliseSequenceLogo(boolean state) + { + normaliseSequenceLogo = state; + } + + @Override + public boolean isNormaliseHMMSequenceLogo() + { + return normaliseHMMSequenceLogo; + } + + public void setNormaliseHMMSequenceLogo(boolean state) + { + normaliseHMMSequenceLogo = state; + } } diff --git a/test/jalview/analysis/scoremodels/FeatureDistanceModelTest.java b/test/jalview/analysis/scoremodels/FeatureDistanceModelTest.java index 16ca70d..a1623f6 100644 --- a/test/jalview/analysis/scoremodels/FeatureDistanceModelTest.java +++ b/test/jalview/analysis/scoremodels/FeatureDistanceModelTest.java @@ -23,6 +23,7 @@ package jalview.analysis.scoremodels; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; +import jalview.api.AlignViewportI; import jalview.api.analysis.ScoreModelI; import jalview.api.analysis.SimilarityParamsI; import jalview.datamodel.Alignment; @@ -32,7 +33,6 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; -import jalview.gui.AlignViewport; import jalview.gui.JvOptionPane; import jalview.io.DataSourceType; import jalview.io.FileLoader; @@ -280,7 +280,7 @@ public class FeatureDistanceModelTest public void testFindDistances_withParams() { AlignFrame af = setupAlignmentView(); - AlignViewport viewport = af.getViewport(); + AlignViewportI viewport = af.getViewport(); AlignmentView view = viewport.getAlignmentView(false); ScoreModelI sm = new FeatureDistanceModel(); diff --git a/test/jalview/datamodel/AlignmentViewTest.java b/test/jalview/datamodel/AlignmentViewTest.java index b201c7e..9be344c 100644 --- a/test/jalview/datamodel/AlignmentViewTest.java +++ b/test/jalview/datamodel/AlignmentViewTest.java @@ -23,10 +23,10 @@ package jalview.datamodel; import static org.testng.Assert.assertEquals; import jalview.gui.AlignFrame; -import jalview.gui.AlignViewport; import jalview.gui.JvOptionPane; import jalview.io.DataSourceType; import jalview.io.FileLoader; +import jalview.viewmodel.AlignmentViewport; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -60,7 +60,7 @@ public class AlignmentViewTest { AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( ">s1\n0123456789\n", DataSourceType.PASTE); - AlignViewport av = af.getViewport(); + AlignmentViewport av = af.getViewport(); AlignmentView view = av.getAlignmentView(true); /* diff --git a/test/jalview/datamodel/HiddenSequencesTest.java b/test/jalview/datamodel/HiddenSequencesTest.java index 11b993d..efd71e6 100644 --- a/test/jalview/datamodel/HiddenSequencesTest.java +++ b/test/jalview/datamodel/HiddenSequencesTest.java @@ -31,6 +31,7 @@ import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; import jalview.gui.AlignViewport; import jalview.gui.JvOptionPane; +import jalview.viewmodel.AlignmentViewport; import java.util.List; @@ -487,7 +488,7 @@ public class HiddenSequencesTest * represent seqs 2-4 with seq3 * this hides seq2 and seq4 but not seq3 */ - AlignViewport av = new AlignViewport(al); + AlignmentViewport av = new AlignViewport(al); SequenceGroup sg = new SequenceGroup(); sg.addSequence(seqs[1], false); sg.addSequence(seqs[2], false); diff --git a/test/jalview/gui/AlignFrameTest.java b/test/jalview/gui/AlignFrameTest.java index b0aaab9..0f15ce4 100644 --- a/test/jalview/gui/AlignFrameTest.java +++ b/test/jalview/gui/AlignFrameTest.java @@ -26,6 +26,7 @@ import static org.testng.Assert.assertNotSame; import static org.testng.Assert.assertSame; import static org.testng.Assert.assertTrue; +import jalview.api.AlignViewportI; import jalview.api.FeatureColourI; import jalview.bin.Cache; import jalview.bin.Jalview; @@ -47,6 +48,7 @@ import jalview.schemes.JalviewColourScheme; import jalview.schemes.StrandColourScheme; import jalview.schemes.TurnColourScheme; import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; import java.awt.Color; import java.util.Iterator; @@ -208,7 +210,7 @@ public class AlignFrameTest @Test(groups = "Functional") public void testChangeColour_background_groupsAndThresholds() { - AlignViewport av = af.getViewport(); + AlignViewportI av = af.getViewport(); AlignmentI al = av.getAlignment(); /* @@ -339,7 +341,7 @@ public class AlignFrameTest @Test(groups = "Functional") public void testColourThresholdActions() { - AlignViewport av = af.getViewport(); + AlignViewportI av = af.getViewport(); AlignmentI al = av.getAlignment(); /* @@ -508,7 +510,7 @@ public class AlignFrameTest @Test(groups = "Functional") public void testNewView_colourThresholds() { - AlignViewport av = af.getViewport(); + AlignViewportI av = af.getViewport(); AlignmentI al = av.getAlignment(); /* @@ -572,7 +574,7 @@ public class AlignFrameTest */ af.newView_actionPerformed(null); assertEquals(af.alignPanel.getViewName(), "View 1"); - AlignViewport av2 = af.getViewport(); + AlignmentViewport av2 = af.getViewport(); assertNotSame(av, av2); assertSame(av2, af.alignPanel.av); rs = av2.getResidueShading(); diff --git a/test/jalview/gui/AlignViewportTest.java b/test/jalview/gui/AlignViewportTest.java index f0120d6..6ab2622 100644 --- a/test/jalview/gui/AlignViewportTest.java +++ b/test/jalview/gui/AlignViewportTest.java @@ -26,6 +26,7 @@ import static org.testng.AssertJUnit.assertNotNull; import static org.testng.AssertJUnit.assertSame; import static org.testng.AssertJUnit.assertTrue; +import jalview.api.AlignViewportI; import jalview.bin.Cache; import jalview.bin.Jalview; import jalview.datamodel.AlignedCodonFrame; @@ -33,8 +34,6 @@ import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Annotation; -import jalview.datamodel.PDBEntry; -import jalview.datamodel.PDBEntry.Type; import jalview.datamodel.SearchResults; import jalview.datamodel.SearchResultsI; import jalview.datamodel.Sequence; @@ -46,6 +45,7 @@ import jalview.schemes.ColourSchemeI; import jalview.schemes.PIDColourScheme; import jalview.structure.StructureSelectionManager; import jalview.util.MapList; +import jalview.viewmodel.AlignmentViewport; import jalview.viewmodel.ViewportRanges; import java.util.ArrayList; @@ -68,7 +68,7 @@ public class AlignViewportTest AlignmentI al; - AlignViewport testee; + AlignmentViewport testee; @BeforeClass(alwaysRun = true) public static void setUpBeforeClass() throws Exception @@ -355,7 +355,7 @@ public class AlignViewportTest { AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); - AlignViewport av = af.getViewport(); + AlignViewportI av = af.getViewport(); SequenceGroup sg1 = new SequenceGroup(); SequenceGroup sg2 = new SequenceGroup(); SequenceGroup sg3 = new SequenceGroup(); @@ -384,7 +384,7 @@ public class AlignViewportTest jalview.bin.Cache.setProperty("SHOW_OCCUPANCY", Boolean.FALSE.toString()); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); - AlignViewport av = af.getViewport(); + AlignViewportI av = af.getViewport(); Assert.assertNull(av.getOccupancyAnnotation(), "Preference did not disable occupancy row."); int c = 0; for (AlignmentAnnotation aa : av.getAlignment().findAnnotations(null, @@ -423,7 +423,7 @@ public class AlignViewportTest String fasta = ">s1\nA-C\n>s2\nA-C\n>s3\nA-D\n>s4\n--D\n"; AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(fasta, DataSourceType.PASTE); - AlignViewport testme = af.getViewport(); + AlignmentViewport testme = af.getViewport(); SequenceI cons = testme.getConsensusSeq(); assertEquals("A-C", cons.getSequenceAsString()); } diff --git a/test/jalview/gui/PairwiseAlignmentPanelTest.java b/test/jalview/gui/PairwiseAlignmentPanelTest.java index 3322ee8..1ea0ba1 100644 --- a/test/jalview/gui/PairwiseAlignmentPanelTest.java +++ b/test/jalview/gui/PairwiseAlignmentPanelTest.java @@ -2,17 +2,19 @@ package jalview.gui; import static org.testng.Assert.assertEquals; +import jalview.api.AlignViewportI; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceGroup; import jalview.io.DataSourceType; import jalview.io.FileLoader; +import jalview.viewmodel.AlignmentViewport; import javax.swing.JTextArea; -import junit.extensions.PA; - import org.testng.annotations.Test; +import junit.extensions.PA; + public class PairwiseAlignmentPanelTest { @Test(groups = "Functional") @@ -20,7 +22,7 @@ public class PairwiseAlignmentPanelTest { AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); - AlignViewport viewport = af.getViewport(); + AlignViewportI viewport = af.getViewport(); AlignmentI al = viewport.getAlignment(); /* @@ -58,7 +60,7 @@ public class PairwiseAlignmentPanelTest String seqs = ">Q93XJ9_SOLTU/23-29\nL-KAISNV\n>FER1_PEA/26-32\nV-TTTKAF\n"; AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(seqs, DataSourceType.PASTE); - AlignViewport viewport = af.getViewport(); + AlignViewportI viewport = af.getViewport(); PairwiseAlignPanel testee = new PairwiseAlignPanel(viewport); diff --git a/test/jalview/gui/SequenceRendererTest.java b/test/jalview/gui/SequenceRendererTest.java index 359377a..d3d6476 100644 --- a/test/jalview/gui/SequenceRendererTest.java +++ b/test/jalview/gui/SequenceRendererTest.java @@ -22,6 +22,7 @@ package jalview.gui; import static org.testng.Assert.assertEquals; +import jalview.api.AlignViewportI; import jalview.bin.Jalview; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; @@ -41,7 +42,7 @@ import org.testng.annotations.Test; public class SequenceRendererTest { AlignmentI al; - AlignViewport av; + AlignViewportI av; SequenceI seq1; diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index e9e0782..41a6b89 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -44,7 +44,6 @@ import jalview.datamodel.features.FeatureMatcher; import jalview.datamodel.features.FeatureMatcherSet; import jalview.datamodel.features.FeatureMatcherSetI; import jalview.gui.AlignFrame; -import jalview.gui.AlignViewport; import jalview.gui.AlignmentPanel; import jalview.gui.Desktop; import jalview.gui.FeatureRenderer; @@ -771,7 +770,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); - AlignViewport av = af.getViewport(); + AlignViewportI av = af.getViewport(); AlignmentI al = av.getAlignment(); /* diff --git a/test/jalview/renderer/OverviewResColourFinderTest.java b/test/jalview/renderer/OverviewResColourFinderTest.java index 1687516..d01e53f 100644 --- a/test/jalview/renderer/OverviewResColourFinderTest.java +++ b/test/jalview/renderer/OverviewResColourFinderTest.java @@ -22,6 +22,7 @@ package jalview.renderer; import static org.testng.AssertJUnit.assertEquals; +import jalview.api.AlignViewportI; import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; @@ -33,6 +34,7 @@ import jalview.gui.JvOptionPane; import jalview.schemes.ColourSchemeI; import jalview.schemes.UserColourScheme; import jalview.schemes.ZappoColourScheme; +import jalview.viewmodel.AlignmentViewport; import java.awt.Color; import java.util.ArrayList; @@ -56,7 +58,7 @@ public class OverviewResColourFinderTest { SequenceI seq = new Sequence("name", "MA--TVLGSPRAPAFF"); AlignmentI al = new Alignment(new SequenceI[] { seq }); - final AlignViewport av = new AlignViewport(al); + final AlignViewportI av = new AlignViewport(al); ResidueColourFinder rcf = new OverviewResColourFinder(); // gaps are grey, residues white @@ -80,7 +82,7 @@ public class OverviewResColourFinderTest SequenceI seq = new Sequence("name", "MAT--GSPRAPAFF"); // FER1_MAIZE... + a // gap AlignmentI al = new Alignment(new SequenceI[] { seq }); - final AlignViewport av = new AlignViewport(al); + final AlignViewportI av = new AlignViewport(al); ResidueColourFinder rcf = new OverviewResColourFinder(); av.setGlobalColourScheme(new ZappoColourScheme()); @@ -126,7 +128,7 @@ public class OverviewResColourFinderTest SequenceI seq = new Sequence("name", "MAT--GSPRAPAFF"); // FER1_MAIZE... + a // gap AlignmentI al = new Alignment(new SequenceI[] { seq }); - final AlignViewport av = new AlignViewport(al); + final AlignViewportI av = new AlignViewport(al); ResidueColourFinder rcf = new OverviewResColourFinder(); Color[] newColours = new Color[24]; @@ -179,7 +181,7 @@ public class OverviewResColourFinderTest SequenceGroup[] groups = new SequenceGroup[1]; groups[0] = sg; - final AlignViewport av = new AlignViewport(al); + final AlignViewportI av = new AlignViewport(al); ResidueColourFinder rcf = new OverviewResColourFinder(); // G in group specified as magenta in Zappo @@ -230,8 +232,6 @@ public class OverviewResColourFinderTest { SequenceI seq = new Sequence("name", "MAT--GSPRAPAFF"); // FER1_MAIZE... + a // gap - AlignmentI al = new Alignment(new SequenceI[] { seq }); - final AlignViewport av = new AlignViewport(al); // non-legacy colouring ResidueColourFinder rcf = new OverviewResColourFinder(); @@ -269,9 +269,7 @@ public class OverviewResColourFinderTest // gaps gap colour c = rcf.getBoxColour(shader, seq, 3); - assertEquals( - jalview.renderer.OverviewResColourFinder.OVERVIEW_DEFAULT_GAP, - c); + assertEquals(OverviewResColourFinder.OVERVIEW_DEFAULT_GAP, c); // non legacy colouring with colour scheme rcf = new OverviewResColourFinder(false, Color.blue, Color.red); diff --git a/test/jalview/renderer/ResidueColourFinderTest.java b/test/jalview/renderer/ResidueColourFinderTest.java index 81fb2c0..24f653c 100644 --- a/test/jalview/renderer/ResidueColourFinderTest.java +++ b/test/jalview/renderer/ResidueColourFinderTest.java @@ -22,6 +22,7 @@ package jalview.renderer; import static org.testng.AssertJUnit.assertEquals; +import jalview.api.AlignViewportI; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.Sequence; @@ -30,6 +31,7 @@ import jalview.gui.AlignViewport; import jalview.gui.JvOptionPane; import jalview.schemes.UserColourScheme; import jalview.schemes.ZappoColourScheme; +import jalview.viewmodel.AlignmentViewport; import java.awt.Color; @@ -51,7 +53,7 @@ public class ResidueColourFinderTest { SequenceI seq = new Sequence("name", "MATVLGSPRAPAFF"); // FER1_MAIZE... AlignmentI al = new Alignment(new SequenceI[] { seq }); - final AlignViewport av = new AlignViewport(al); + final AlignViewportI av = new AlignViewport(al); ResidueColourFinder rcf = new ResidueColourFinder(); av.setGlobalColourScheme(new ZappoColourScheme()); @@ -86,7 +88,7 @@ public class ResidueColourFinderTest { SequenceI seq = new Sequence("name", "MA--TVLGSPRAPAFF"); AlignmentI al = new Alignment(new SequenceI[] { seq }); - final AlignViewport av = new AlignViewport(al); + final AlignViewportI av = new AlignViewport(al); ResidueColourFinder rcf = new ResidueColourFinder(); assertEquals(Color.white, @@ -109,7 +111,7 @@ public class ResidueColourFinderTest SequenceI seq = new Sequence("name", "MAT--GSPRAPAFF"); // FER1_MAIZE... + a // gap AlignmentI al = new Alignment(new SequenceI[] { seq }); - final AlignViewport av = new AlignViewport(al); + final AlignViewportI av = new AlignViewport(al); ResidueColourFinder rcf = new ResidueColourFinder(); Color[] newColours = new Color[24]; diff --git a/test/jalview/renderer/ScaleRendererTest.java b/test/jalview/renderer/ScaleRendererTest.java index 0af67cd..e78fc5a 100644 --- a/test/jalview/renderer/ScaleRendererTest.java +++ b/test/jalview/renderer/ScaleRendererTest.java @@ -6,10 +6,10 @@ import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; import jalview.gui.AlignFrame; -import jalview.gui.AlignViewport; import jalview.io.DataSourceType; import jalview.io.FileLoader; import jalview.renderer.ScaleRenderer.ScaleMark; +import jalview.viewmodel.AlignmentViewport; import java.util.List; @@ -23,7 +23,7 @@ public class ScaleRendererTest String data = ">Seq/20-45\nABCDEFGHIJKLMNOPQRSTUVWXYS\n"; AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(data, DataSourceType.PASTE); - AlignViewport av = af.getViewport(); + AlignmentViewport av = af.getViewport(); /* * scale has minor ticks at 5, 15, 25, major at 10 and 20 diff --git a/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java b/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java index d8b905e..76e4fc5 100644 --- a/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java +++ b/test/jalview/renderer/seqfeatures/FeatureColourFinderTest.java @@ -6,11 +6,11 @@ import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; +import jalview.api.AlignViewportI; import jalview.api.FeatureColourI; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; -import jalview.gui.AlignViewport; import jalview.gui.FeatureRenderer; import jalview.io.DataSourceType; import jalview.io.FileLoader; @@ -43,7 +43,7 @@ import org.testng.annotations.Test; */ public class FeatureColourFinderTest { - private AlignViewport av; + private AlignViewportI av; private SequenceI seq; diff --git a/test/jalview/schemes/PIDColourSchemeTest.java b/test/jalview/schemes/PIDColourSchemeTest.java index fa4b5d9..c2f86d6 100644 --- a/test/jalview/schemes/PIDColourSchemeTest.java +++ b/test/jalview/schemes/PIDColourSchemeTest.java @@ -4,9 +4,9 @@ import static org.testng.Assert.assertEquals; import jalview.datamodel.SequenceI; import jalview.gui.AlignFrame; -import jalview.gui.AlignViewport; import jalview.io.DataSourceType; import jalview.io.FileLoader; +import jalview.viewmodel.AlignmentViewport; import java.awt.Color; @@ -83,7 +83,7 @@ public class PIDColourSchemeTest */ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(seqs, DataSourceType.PASTE); - AlignViewport viewport = af.getViewport(); + AlignmentViewport viewport = af.getViewport(); viewport.setIgnoreGapsConsensus(false, af.alignPanel); while (viewport.getConsensusSeq() == null) { -- 1.7.10.2