X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignViewport.java;h=152966e78dd90a414e0bde79b58eb96da71f29eb;hb=cd71fb9ef1a21678ad648ba13564b658b53ab834;hp=40d3dd499a51bb149c8ce4c70616cc70c16bd648;hpb=8da7acff9214ddaf0e6d28e76219ab51bd38e62d;p=jalview.git diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 40d3dd4..152966e 100755 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -36,7 +36,10 @@ public class AlignViewport int startSeq; int endSeq; - boolean showFullId = true; + + boolean cursorMode = false; + + boolean showJVSuffix = true; boolean showText = true; boolean showColourText = false; boolean showBoxes = true; @@ -57,10 +60,10 @@ public class AlignViewport int charHeight; int charWidth; - int chunkWidth; - int chunkHeight; + int wrappedWidth; Font font = new Font("SansSerif", Font.PLAIN, 10); + boolean validCharWidth = true; AlignmentI alignment; ColumnSelection colSel = new ColumnSelection(); @@ -74,11 +77,18 @@ public class AlignViewport boolean scaleLeftWrapped = true; boolean scaleRightWrapped = true; + // The following vector holds the features which are + // currently visible, in the correct order or rendering + Hashtable featuresDisplayed; + + public Vector vconsensus; AlignmentAnnotation consensus; AlignmentAnnotation conservation; AlignmentAnnotation quality; + boolean autocalculateConsensus = true; + public int ConsPercGaps = 25; // JBPNote : This should be a scalable property! private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(this); @@ -99,7 +109,7 @@ public class AlignViewport String param = applet.getParameter("showFullId"); if (param != null) { - showFullId = Boolean.valueOf(param).booleanValue(); + showJVSuffix = Boolean.valueOf(param).booleanValue(); } param = applet.getParameter("showAnnotation"); @@ -147,9 +157,17 @@ public class AlignViewport showSequenceFeatures = b; } + public boolean getShowSequenceFeatures() + { + return showSequenceFeatures; + } + public void updateConservation() { + if(alignment.isNucleotide()) + return; + Conservation cons = new jalview.analysis.Conservation("All", jalview.schemes.ResidueProperties.propHash, 3, alignment.getSequences(), 0, @@ -219,7 +237,7 @@ public class AlignViewport annotations, 0f, // cons.qualityRange[0].floatValue(), 11f, // cons.qualityRange[1].floatValue() - 1); + AlignmentAnnotation.BAR_GRAPH); if (showConservation) { alignment.addAnnotation(conservation); @@ -229,7 +247,7 @@ public class AlignViewport qannotations, cons.qualityRange[0].floatValue(), cons.qualityRange[1].floatValue(), - 1); + AlignmentAnnotation.BAR_GRAPH); if (showQuality) { alignment.addAnnotation(quality); @@ -292,7 +310,7 @@ public class AlignViewport if (consensus == null) { consensus = new AlignmentAnnotation("Consensus", - "PID", annotations, 0f, 100f, 1); + "PID", annotations, 0f, 100f, AlignmentAnnotation.BAR_GRAPH); if (showConsensus) { alignment.addAnnotation(consensus); @@ -405,12 +423,17 @@ public class AlignViewport return endSeq; } + java.awt.Frame nullFrame; public void setFont(Font f) { font = f; - java.awt.Frame temp = new java.awt.Frame(); - temp.addNotify(); - java.awt.FontMetrics fm = temp.getGraphics().getFontMetrics(font); + if(nullFrame == null) + { + nullFrame = new java.awt.Frame(); + nullFrame.addNotify(); + } + + java.awt.FontMetrics fm = nullFrame.getGraphics().getFontMetrics(font); setCharHeight(fm.getHeight()); setCharWidth(fm.charWidth('M')); } @@ -440,24 +463,14 @@ public class AlignViewport return charHeight; } - public void setChunkWidth(int w) - { - this.chunkWidth = w; - } - - public int getChunkWidth() - { - return chunkWidth; - } - - public void setChunkHeight(int h) + public void setWrappedWidth(int w) { - this.chunkHeight = h; + this.wrappedWidth = w; } - public int getChunkHeight() + public int getwrappedWidth() { - return chunkHeight; + return wrappedWidth; } public AlignmentI getAlignment() @@ -604,14 +617,14 @@ public class AlignViewport return colourAppliesToAllGroups; } - public boolean getShowFullId() + public boolean getShowJVSuffix() { - return showFullId; + return showJVSuffix; } - public void setShowFullId(boolean b) + public void setShowJVSuffix(boolean b) { - showFullId = b; + showJVSuffix = b; } public boolean getShowAnnotation()