X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=088d4273b8397893f8fd4fea13df5e64b43218c1;hb=9a4258bfc6277f67d677ce0e62f6ffd6bcc3d436;hp=6627941df9e97b70c2ab3c097ae5d429cf53d027;hpb=a2fef61921a7ff524851552c18e579fa5051cad4;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 6627941..088d427 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -43,7 +43,7 @@ public class AlignViewport int endRes; int startSeq; int endSeq; - boolean showFullId = false; + boolean showJVSuffix = true; boolean showText = true; boolean showColourText = false; boolean showBoxes = true; @@ -61,8 +61,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 +86,17 @@ public class AlignViewport boolean ignoreGapsInConsensusCalculation = false; + boolean isDataset = false; + + boolean antiAlias = false; + + + public AlignViewport(AlignmentI al, boolean dataset) + { + isDataset = dataset; + setAlignment(al); + init(); + } /** * Creates a new AlignViewport object. * @@ -95,20 +105,19 @@ public class AlignViewport public AlignViewport(AlignmentI al) { setAlignment(al); + init(); + } + + void init() + { this.startRes = 0; - this.endRes = al.getWidth() - 1; + this.endRes = alignment.getWidth() - 1; this.startSeq = 0; - this.endSeq = al.getHeight() - 1; + this.endSeq = alignment.getHeight() - 1; - updateFromPreferences(); - } + antiAlias = Cache.getDefault("ANTI_ALIAS", false); - /** - * DOCUMENT ME! - */ - public void updateFromPreferences() - { - showFullId = Cache.getDefault("SHOW_FULL_ID", true); + showJVSuffix = Cache.getDefault("SHOW_JVSUFFIX", true); showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true); showConservation = Cache.getDefault("SHOW_CONSERVATION", true); @@ -138,8 +147,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 +188,9 @@ public class AlignViewport */ public void updateConservation() { + if(alignment.isNucleotide()) + return; + try{ Conservation cons = new jalview.analysis.Conservation("All", jalview.schemes.ResidueProperties.propHash, 3, @@ -253,7 +268,7 @@ public class AlignViewport ConsPercGaps + "% gaps", annotations, 0f, // cons.qualityRange[0].floatValue(), 11f, // cons.qualityRange[1].floatValue() - 1); + AlignmentAnnotation.BAR_GRAPH); if (showConservation) { @@ -265,7 +280,7 @@ public class AlignViewport qannotations, cons.qualityRange[0].floatValue(), cons.qualityRange[1].floatValue(), - 1); + AlignmentAnnotation.BAR_GRAPH); if (showQuality) { @@ -349,7 +364,7 @@ public class AlignViewport if (consensus == null) { consensus = new AlignmentAnnotation("Consensus", "PID", - annotations, 0f, 100f, 1); + annotations, 0f, 100f,AlignmentAnnotation.BAR_GRAPH); if (showIdentity) { @@ -630,9 +645,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 +655,11 @@ public class AlignViewport * * @return DOCUMENT ME! */ - public int getChunkWidth() - { - return chunkWidth; - } - - /** - * DOCUMENT ME! - * - * @param h DOCUMENT ME! - */ - public void setChunkHeight(int h) + public int getWrappedWidth() { - this.chunkHeight = h; + return wrappedWidth; } - /** - * DOCUMENT ME! - * - * @return DOCUMENT ME! - */ - public int getChunkHeight() - { - return chunkHeight; - } /** * DOCUMENT ME! @@ -930,9 +926,9 @@ public class AlignViewport * * @return DOCUMENT ME! */ - public boolean getShowFullId() + public boolean getShowJVSuffix() { - return showFullId; + return showJVSuffix; } /** @@ -940,11 +936,12 @@ public class AlignViewport * * @param b DOCUMENT ME! */ - public void setShowFullId(boolean b) + public void setShowJVSuffix(boolean b) { - showFullId = b; + showJVSuffix = b; } + /** * DOCUMENT ME! * @@ -1074,4 +1071,14 @@ public class AlignViewport { return ignoreGapsInConsensusCalculation; } + + public void setDataset(boolean b) + { + isDataset = b; + } + + public boolean isDataset() + { + return isDataset; + } }