X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=4fd39a3d6e86290f371fb8210c5c99d6d8a1d49c;hb=04bb62b586382f183f08eb70131e7bf5f67cb47a;hp=6627941df9e97b70c2ab3c097ae5d429cf53d027;hpb=a2fef61921a7ff524851552c18e579fa5051cad4;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 6627941..4fd39a3 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -43,7 +43,8 @@ public class AlignViewport int endRes; int startSeq; int endSeq; - boolean showFullId = false; + boolean showDBPrefix = true; + boolean showJVSuffix = true; boolean showText = true; boolean showColourText = false; boolean showBoxes = true; @@ -61,8 +62,7 @@ public class AlignViewport SequenceGroup selectionGroup; int charHeight; int charWidth; - int chunkWidth; - int chunkHeight; + int wrappedWidth; Font font = new Font("SansSerif", Font.PLAIN, 10); AlignmentI alignment; ColumnSelection colSel = new ColumnSelection(); @@ -87,6 +87,15 @@ public class AlignViewport boolean ignoreGapsInConsensusCalculation = false; + boolean isDataset = false; + + + public AlignViewport(AlignmentI al, boolean dataset) + { + isDataset = dataset; + setAlignment(al); + init(); + } /** * Creates a new AlignViewport object. * @@ -95,20 +104,18 @@ public class AlignViewport public AlignViewport(AlignmentI al) { setAlignment(al); - this.startRes = 0; - this.endRes = al.getWidth() - 1; - this.startSeq = 0; - this.endSeq = al.getHeight() - 1; - - updateFromPreferences(); + init(); } - /** - * DOCUMENT ME! - */ - public void updateFromPreferences() + void init() { - showFullId = Cache.getDefault("SHOW_FULL_ID", true); + this.startRes = 0; + this.endRes = alignment.getWidth() - 1; + this.startSeq = 0; + this.endSeq = alignment.getHeight() - 1; + + showDBPrefix = Cache.getDefault("SHOW_DBPREFIX", true); + showJVSuffix = Cache.getDefault("SHOW_JVSUFFIX", true); showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true); showConservation = Cache.getDefault("SHOW_CONSERVATION", true); @@ -138,8 +145,11 @@ public class AlignViewport // We must set conservation and consensus before setting colour, // as Blosum and Clustal require this to be done - updateConservation(); - updateConsensus(); + if(vconsensus==null && !isDataset) + { + updateConservation(); + updateConsensus(); + } if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null) { @@ -176,6 +186,9 @@ public class AlignViewport */ public void updateConservation() { + if(alignment.isNucleotide()) + return; + try{ Conservation cons = new jalview.analysis.Conservation("All", jalview.schemes.ResidueProperties.propHash, 3, @@ -630,9 +643,9 @@ public class AlignViewport * * @param w DOCUMENT ME! */ - public void setChunkWidth(int w) + public void setWrappedWidth(int w) { - this.chunkWidth = w; + this.wrappedWidth = w; } /** @@ -640,30 +653,11 @@ public class AlignViewport * * @return DOCUMENT ME! */ - public int getChunkWidth() + public int getWrappedWidth() { - return chunkWidth; + return wrappedWidth; } - /** - * DOCUMENT ME! - * - * @param h DOCUMENT ME! - */ - public void setChunkHeight(int h) - { - this.chunkHeight = h; - } - - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public int getChunkHeight() - { - return chunkHeight; - } /** * DOCUMENT ME! @@ -930,9 +924,29 @@ public class AlignViewport * * @return DOCUMENT ME! */ - public boolean getShowFullId() + public boolean getShowJVSuffix() + { + return showJVSuffix; + } + + /** + * DOCUMENT ME! + * + * @param b DOCUMENT ME! + */ + public void setShowJVSuffix(boolean b) + { + showJVSuffix = b; + } + + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean getShowDBPrefix() { - return showFullId; + return showDBPrefix; } /** @@ -940,9 +954,9 @@ public class AlignViewport * * @param b DOCUMENT ME! */ - public void setShowFullId(boolean b) + public void setShowDBPrefix(boolean b) { - showFullId = b; + showDBPrefix = b; } /** @@ -1074,4 +1088,14 @@ public class AlignViewport { return ignoreGapsInConsensusCalculation; } + + public void setDataset(boolean b) + { + isDataset = b; + } + + public boolean isDataset() + { + return isDataset; + } }