X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FStructureViewerBase.java;fp=src%2Fjalview%2Fgui%2FStructureViewerBase.java;h=0b4541712456ff46a6317237ff11dee44ec3ec77;hb=2783208dc83a836be2cac47efb9877949909e781;hp=93d675acf785acc05db92a3b8f9578316cdfccc4;hpb=3f308bf567cb401b0f735c8f5e9ff57eea083011;p=jalview.git diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index 93d675a..0b45417 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import jalview.api.AlignmentViewPanel; import jalview.bin.Cache; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; @@ -402,8 +403,15 @@ public abstract class StructureViewerBase extends GStructureViewer return getBinding().hasPdbId(pdbId); } - protected abstract List getViewersFor( - AlignmentPanel alp); + /** + * Returns a list of any viewer of the instantiated type. The list is + * restricted to those linked to the given alignment panel if it is not null. + */ + protected List getViewersFor(AlignmentPanel alp) + { + return Desktop.instance.getStructureViewers(alp, this.getClass()); + } + /** * Check for any existing views involving this alignment and give user the