X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignViewport.java;h=8c6c7d26f4dc176ceac0eaa90bc243824526400f;hb=99f3f01792321efb671ac7ad946efffc3a3319a4;hp=e7cae4434305e6beea837c9fc87f28067a0db551;hpb=9fff97021c2c637e426f6971d54dcf3fd4191985;p=jalview.git diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index e7cae44..8c6c7d2 100755 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -36,7 +36,7 @@ public class AlignViewport int startSeq; int endSeq; - boolean showFullId = true; + boolean showJVSuffix = true; boolean showText = true; boolean showColourText = false; boolean showBoxes = true; @@ -57,8 +57,7 @@ public class AlignViewport int charHeight; int charWidth; - int chunkWidth; - int chunkHeight; + int wrappedWidth; Font font = new Font("SansSerif", Font.PLAIN, 10); AlignmentI alignment; @@ -74,6 +73,19 @@ 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 = null; + + + public Vector vconsensus; + AlignmentAnnotation consensus; + AlignmentAnnotation conservation; + AlignmentAnnotation quality; + + public int ConsPercGaps = 25; // JBPNote : This should be a scalable property! + + private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(this); boolean ignoreGapsInConsensusCalculation = false; @@ -91,7 +103,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"); @@ -139,15 +151,12 @@ public class AlignViewport showSequenceFeatures = b; } - public Vector vconsensus; - AlignmentAnnotation consensus; - AlignmentAnnotation conservation; - AlignmentAnnotation quality; - - public int ConsPercGaps = 25; // JBPNote : This should be a scalable property! public void updateConservation() { + if(alignment.isNucleotide()) + return; + Conservation cons = new jalview.analysis.Conservation("All", jalview.schemes.ResidueProperties.propHash, 3, alignment.getSequences(), 0, @@ -217,7 +226,7 @@ public class AlignViewport annotations, 0f, // cons.qualityRange[0].floatValue(), 11f, // cons.qualityRange[1].floatValue() - 1); + AlignmentAnnotation.BAR_GRAPH); if (showConservation) { alignment.addAnnotation(conservation); @@ -227,7 +236,7 @@ public class AlignViewport qannotations, cons.qualityRange[0].floatValue(), cons.qualityRange[1].floatValue(), - 1); + AlignmentAnnotation.BAR_GRAPH); if (showQuality) { alignment.addAnnotation(quality); @@ -290,7 +299,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); @@ -301,6 +310,9 @@ public class AlignViewport consensus.annotations = annotations; } + if(globalColourScheme!=null) + globalColourScheme.setConsensus(vconsensus); + } public SequenceGroup getSelectionGroup() @@ -435,24 +447,14 @@ public class AlignViewport return charHeight; } - public void setChunkWidth(int w) + public void setWrappedWidth(int w) { - this.chunkWidth = w; + this.wrappedWidth = w; } - public int getChunkWidth() + public int getwrappedWidth() { - return chunkWidth; - } - - public void setChunkHeight(int h) - { - this.chunkHeight = h; - } - - public int getChunkHeight() - { - return chunkHeight; + return wrappedWidth; } public AlignmentI getAlignment() @@ -599,14 +601,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() @@ -653,16 +655,50 @@ public class AlignViewport { ignoreGapsInConsensusCalculation = b; updateConsensus(); - if (globalColourScheme!=null && globalColourScheme instanceof ResidueColourScheme) + if (globalColourScheme!=null) { - ( (ResidueColourScheme) globalColourScheme).setThreshold( - ( (ResidueColourScheme) globalColourScheme).getThreshold(), + globalColourScheme.setThreshold(globalColourScheme.getThreshold(), ignoreGapsInConsensusCalculation); } + } + + /** + * Property change listener for changes in alignment + * + * @param listener DOCUMENT ME! + */ + public void addPropertyChangeListener( + java.beans.PropertyChangeListener listener) + { + changeSupport.addPropertyChangeListener(listener); + } + + /** + * DOCUMENT ME! + * + * @param listener DOCUMENT ME! + */ + public void removePropertyChangeListener( + java.beans.PropertyChangeListener listener) + { + changeSupport.removePropertyChangeListener(listener); + } + /** + * Property change listener for changes in alignment + * + * @param prop DOCUMENT ME! + * @param oldvalue DOCUMENT ME! + * @param newvalue DOCUMENT ME! + */ + public void firePropertyChange(String prop, Object oldvalue, Object newvalue) + { + changeSupport.firePropertyChange(prop, oldvalue, newvalue); } + + public boolean getIgnoreGapsConsensus() { return ignoreGapsInConsensusCalculation;