From e3ff86bf4b17ec3cf58bfe8fdb152bfc431765b3 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 7 Oct 2013 17:02:45 +0100 Subject: [PATCH] JAL-1385 expose core view model methods in interface --- src/jalview/api/AlignViewportI.java | 23 +++++++++++++++++++++++ src/jalview/viewmodel/AlignmentViewport.java | 7 +++++++ 2 files changed, 30 insertions(+) diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index f42293d..15e5f1d 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -17,13 +17,17 @@ */ package jalview.api; +import java.awt.Color; import java.util.Hashtable; import java.util.Map; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.CigarArray; import jalview.datamodel.ColumnSelection; import jalview.datamodel.SequenceCollectionI; +import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; import jalview.schemes.ColourSchemeI; @@ -155,4 +159,23 @@ public interface AlignViewportI void updateGroupAnnotationSettings(boolean applyGlobalSettings, boolean preserveNewGroupSettings); + + SequenceGroup getSelectionGroup(); + + SequenceI[] getSequenceSelection(); + + + CigarArray getViewAsCigars(boolean selectedRegionOnly); + + AlignmentView getAlignmentView(boolean selectedOnly); + + AlignmentView getAlignmentView(boolean selectedOnly, boolean markGroups); + + String[] getViewAsString(boolean selectedRegionOnly); + + void setSelectionGroup(SequenceGroup sg); + + char getGapCharacter(); + + } diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index d65486d..dc352f4 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -594,6 +594,7 @@ public abstract class AlignmentViewport implements AlignViewportI * * @return null or the currently selected sequence region */ + @Override public SequenceGroup getSelectionGroup() { return selectionGroup; @@ -606,6 +607,7 @@ public abstract class AlignmentViewport implements AlignViewportI * - group holding references to sequences in this alignment view * */ + @Override public void setSelectionGroup(SequenceGroup sg) { selectionGroup = sg; @@ -1054,6 +1056,7 @@ public abstract class AlignmentViewport implements AlignViewportI * * @return array of references to sequence objects */ + @Override public SequenceI[] getSequenceSelection() { SequenceI[] sequences = null; @@ -1076,6 +1079,7 @@ public abstract class AlignmentViewport implements AlignViewportI * * @return String[] */ + @Override public jalview.datamodel.CigarArray getViewAsCigars( boolean selectedRegionOnly) { @@ -1092,6 +1096,7 @@ public abstract class AlignmentViewport implements AlignViewportI * boolean true to just return the selected view * @return AlignmentView */ + @Override public jalview.datamodel.AlignmentView getAlignmentView( boolean selectedOnly) { @@ -1110,6 +1115,7 @@ public abstract class AlignmentViewport implements AlignViewportI * is true) * @return AlignmentView */ + @Override public jalview.datamodel.AlignmentView getAlignmentView( boolean selectedOnly, boolean markGroups) { @@ -1125,6 +1131,7 @@ public abstract class AlignmentViewport implements AlignViewportI * * @return String[] */ + @Override public String[] getViewAsString(boolean selectedRegionOnly) { String[] selection = null; -- 1.7.10.2