Applet doesnt have hidden columns
[jalview.git] / src / jalview / appletgui / AlignViewport.java
index 8c6c7d2..1bc1b51 100755 (executable)
@@ -36,6 +36,9 @@ public class AlignViewport
   int startSeq;\r
   int endSeq;\r
 \r
+\r
+  boolean cursorMode = false;\r
+\r
   boolean showJVSuffix = true;\r
   boolean showText = true;\r
   boolean showColourText = false;\r
@@ -53,13 +56,14 @@ public class AlignViewport
   boolean conservationColourSelected = false;\r
   boolean abovePIDThreshold = false;\r
 \r
-  SequenceGroup selectionGroup = new SequenceGroup();\r
+  SequenceGroup selectionGroup;\r
 \r
   int charHeight;\r
   int charWidth;\r
   int wrappedWidth;\r
 \r
   Font font = new Font("SansSerif", Font.PLAIN, 10);\r
+  boolean validCharWidth = true;\r
   AlignmentI alignment;\r
 \r
   ColumnSelection colSel = new ColumnSelection();\r
@@ -75,7 +79,7 @@ public class AlignViewport
 \r
   // The following vector holds the features which are\r
  // currently visible, in the correct order or rendering\r
-  Hashtable featuresDisplayed = null;\r
+  Hashtable featuresDisplayed;\r
 \r
 \r
   public Vector vconsensus;\r
@@ -83,6 +87,8 @@ public class AlignViewport
   AlignmentAnnotation conservation;\r
   AlignmentAnnotation quality;\r
 \r
+  boolean autocalculateConsensus = true;\r
+\r
   public int ConsPercGaps = 25; // JBPNote : This should be a scalable property!\r
 \r
   private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(this);\r
@@ -135,14 +141,34 @@ public class AlignViewport
     updateConservation();\r
     updateConsensus();\r
 \r
-    if (applet != null && applet.getParameter("defaultColour") != null)\r
+\r
+    if (applet != null)\r
     {\r
-      globalColourScheme = ColourSchemeProperty.getColour(alignment,\r
-          applet.getParameter("defaultColour"));\r
-      if (globalColourScheme != null)\r
+      String colour = applet.getParameter("defaultColour");\r
+\r
+      if(colour == null)\r
       {\r
-        globalColourScheme.setConsensus(vconsensus);\r
+        colour = applet.getParameter("userDefinedColour");\r
+        if(colour !=null)\r
+          colour = "User Defined";\r
+      }\r
+\r
+      if(colour != null)\r
+      {\r
+        globalColourScheme = ColourSchemeProperty.getColour(alignment, colour);\r
+        if (globalColourScheme != null)\r
+        {\r
+          globalColourScheme.setConsensus(vconsensus);\r
+        }\r
       }\r
+\r
+      if(applet.getParameter("userDefinedColour")!=null)\r
+      {\r
+        ((UserColourScheme)globalColourScheme).parseAppletParameter(\r
+            applet.getParameter("userDefinedColour"));\r
+      }\r
+\r
+\r
     }\r
   }\r
 \r
@@ -151,6 +177,11 @@ public class AlignViewport
     showSequenceFeatures = b;\r
   }\r
 \r
+  public boolean getShowSequenceFeatures()\r
+  {\r
+    return showSequenceFeatures;\r
+  }\r
+\r
 \r
   public void updateConservation()\r
   {\r
@@ -412,12 +443,17 @@ public class AlignViewport
     return endSeq;\r
   }\r
 \r
+  java.awt.Frame nullFrame;\r
   public void setFont(Font f)\r
   {\r
     font = f;\r
-    java.awt.Frame temp = new java.awt.Frame();\r
-    temp.addNotify();\r
-    java.awt.FontMetrics fm = temp.getGraphics().getFontMetrics(font);\r
+    if(nullFrame == null)\r
+    {\r
+      nullFrame = new java.awt.Frame();\r
+      nullFrame.addNotify();\r
+    }\r
+\r
+    java.awt.FontMetrics fm = nullFrame.getGraphics().getFontMetrics(font);\r
     setCharHeight(fm.getHeight());\r
     setCharWidth(fm.charWidth('M'));\r
   }\r