X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;fp=src%2Fjalview%2Fgui%2FAlignViewport.java;h=5c383d868edd485616e413a6f1cfe042f421fbbe;hb=8d98d7ffc5c6ad61d7ff662fb88692c23a9791e5;hp=6d6531f27ff92c21518cf5a28249446080c0ef99;hpb=95f6ef5142fb82c4f3a781954eeaff7694f42f0b;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 6d6531f..5c383d8 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -38,6 +38,7 @@ */ package jalview.gui; +import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; import jalview.analysis.NJTree; import jalview.api.AlignViewportI; import jalview.bin.Cache; @@ -99,6 +100,8 @@ public class AlignViewport extends AlignmentViewport implements boolean showAnnotation = true; + SequenceAnnotationOrder sortAnnotationsBy = null; + int charHeight; int charWidth; @@ -358,12 +361,15 @@ public class AlignViewport extends AlignmentViewport implements } } - wrapAlignment = jalview.bin.Cache.getDefault("WRAP_ALIGNMENT", false); - showUnconserved = jalview.bin.Cache.getDefault("SHOW_UNCONSERVED", - false); - sortByTree = jalview.bin.Cache.getDefault("SORT_BY_TREE", false); - followSelection = jalview.bin.Cache.getDefault("FOLLOW_SELECTIONS", - true); + wrapAlignment = Cache.getDefault("WRAP_ALIGNMENT", false); + showUnconserved = Cache.getDefault("SHOW_UNCONSERVED", false); + sortByTree = Cache.getDefault("SORT_BY_TREE", false); + followSelection = Cache.getDefault("FOLLOW_SELECTIONS", true); + sortAnnotationsBy = SequenceAnnotationOrder.valueOf(Cache.getDefault( + Preferences.SORT_ANNOTATIONS, + SequenceAnnotationOrder.NONE.name())); + showAutocalculatedAbove = Cache.getDefault( + Preferences.SHOW_AUTOCALC_ABOVE, false); } /** @@ -969,8 +975,10 @@ public class AlignViewport extends AlignmentViewport implements { // TODO: JAL-1126 if (historyList == null || redoList == null) + { return new long[] { -1, -1 }; + } return new long[] { historyList.hashCode(), this.redoList.hashCode() }; } @@ -1207,7 +1215,9 @@ public class AlignViewport extends AlignmentViewport implements Vector pdbs = alignment.getSequenceAt(i).getDatasetSequence() .getPDBId(); if (pdbs == null) + { continue; + } SequenceI sq; for (int p = 0; p < pdbs.size(); p++) { @@ -1215,7 +1225,9 @@ public class AlignViewport extends AlignmentViewport implements if (p1.getId().equals(pdb.getId())) { if (!seqs.contains(sq = alignment.getSequenceAt(i))) + { seqs.add(sq); + } continue; } @@ -1247,6 +1259,8 @@ public class AlignViewport extends AlignmentViewport implements private Hashtable calcIdParams = new Hashtable(); + private boolean showAutocalculatedAbove; + public AutoCalcSetting getCalcIdSettingsFor(String calcId) { return calcIdParams.get(calcId); @@ -1264,4 +1278,24 @@ public class AlignViewport extends AlignmentViewport implements Cache.log.debug("trigger update for " + calcId); } } + + protected SequenceAnnotationOrder getSortAnnotationsBy() + { + return sortAnnotationsBy; + } + + protected void setSortAnnotationsBy(SequenceAnnotationOrder sortAnnotationsBy) + { + this.sortAnnotationsBy = sortAnnotationsBy; + } + + protected boolean isShowAutocalculatedAbove() + { + return showAutocalculatedAbove; + } + + protected void setShowAutocalculatedAbove(boolean showAutocalculatedAbove) + { + this.showAutocalculatedAbove = showAutocalculatedAbove; + } }