X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignViewport.java;h=1bc1b515bc8439254bf29b060e768141784996f8;hb=bf2bf43c980b18a26b724d2a2d51dddc1a79a185;hp=2e0c1cb6306f3844279d967e666d6ba3d1e6d237;hpb=55e2e9b22b133db8b9ff0979b0338a33081fc8fd;p=jalview.git diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index 2e0c1cb..1bc1b51 100755 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -36,6 +36,9 @@ public class AlignViewport int startSeq; int endSeq; + + boolean cursorMode = false; + boolean showJVSuffix = true; boolean showText = true; boolean showColourText = false; @@ -53,13 +56,14 @@ public class AlignViewport boolean conservationColourSelected = false; boolean abovePIDThreshold = false; - SequenceGroup selectionGroup = new SequenceGroup(); + SequenceGroup selectionGroup; int charHeight; int charWidth; int wrappedWidth; Font font = new Font("SansSerif", Font.PLAIN, 10); + boolean validCharWidth = true; AlignmentI alignment; ColumnSelection colSel = new ColumnSelection(); @@ -73,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); @@ -130,14 +141,34 @@ public class AlignViewport updateConservation(); updateConsensus(); - if (applet != null && applet.getParameter("defaultColour") != null) + + if (applet != null) { - globalColourScheme = ColourSchemeProperty.getColour(alignment, - applet.getParameter("defaultColour")); - if (globalColourScheme != null) + String colour = applet.getParameter("defaultColour"); + + if(colour == null) { - globalColourScheme.setConsensus(vconsensus); + colour = applet.getParameter("userDefinedColour"); + if(colour !=null) + colour = "User Defined"; } + + if(colour != null) + { + globalColourScheme = ColourSchemeProperty.getColour(alignment, colour); + if (globalColourScheme != null) + { + globalColourScheme.setConsensus(vconsensus); + } + } + + if(applet.getParameter("userDefinedColour")!=null) + { + ((UserColourScheme)globalColourScheme).parseAppletParameter( + applet.getParameter("userDefinedColour")); + } + + } } @@ -146,6 +177,11 @@ public class AlignViewport showSequenceFeatures = b; } + public boolean getShowSequenceFeatures() + { + return showSequenceFeatures; + } + public void updateConservation() { @@ -221,7 +257,7 @@ public class AlignViewport annotations, 0f, // cons.qualityRange[0].floatValue(), 11f, // cons.qualityRange[1].floatValue() - 1); + AlignmentAnnotation.BAR_GRAPH); if (showConservation) { alignment.addAnnotation(conservation); @@ -231,7 +267,7 @@ public class AlignViewport qannotations, cons.qualityRange[0].floatValue(), cons.qualityRange[1].floatValue(), - 1); + AlignmentAnnotation.BAR_GRAPH); if (showQuality) { alignment.addAnnotation(quality); @@ -294,7 +330,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); @@ -407,12 +443,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')); }