Use the isGap method in utils
[jalview.git] / src / jalview / gui / AlignViewport.java
index 03e0c5a..1c6c453 100755 (executable)
@@ -4,6 +4,7 @@ import java.awt.*;
 import jalview.io.*;\r
 import jalview.analysis.NJTree;\r
 import jalview.datamodel.*;\r
+import jalview.schemes.*;\r
 import java.util.*;\r
 \r
 public class AlignViewport\r
@@ -19,23 +20,24 @@ public class AlignViewport
   boolean showColourText=false;\r
   boolean showBoxes=true;\r
   boolean wrapAlignment=false;\r
-  boolean renderGaps = false;\r
+  boolean renderGaps = true;\r
 \r
-  boolean groupEdit    = false;\r
+  ColourSchemeI globalColourScheme = null;\r
+  boolean conservationColourSelected = false;\r
 \r
-  RendererI renderer = new SequenceRenderer();\r
+  SequenceGroup rubberbandGroup = null;\r
+\r
+  RendererI renderer = new SequenceRenderer(this);\r
 \r
   int             charHeight;\r
-  double          charWidth;\r
+  int             charWidth;\r
   int             chunkWidth;\r
   int             chunkHeight;\r
 \r
-  Color           backgroundColour;\r
-\r
   Font            font = new Font("SansSerif",Font.PLAIN,10);\r
   AlignmentI      alignment;\r
 \r
-  Selection       sel    = new Selection();\r
+  Selection       sel    = new Selection(this);\r
   ColumnSelection colSel = new ColumnSelection();\r
 \r
   OutputGenerator og;\r
@@ -87,18 +89,6 @@ public class AlignViewport
     setFont( font );\r
  }\r
 \r
-  public AlignViewport(int startRes, int endRes,\r
-                       int startSeq, int endSeq,\r
-                       boolean showScores,\r
-                       boolean showText,\r
-                       boolean showBoxes,\r
-                       boolean wrapAlignment,\r
-                       Color backgroundColour) {\r
-    this(startRes,endRes,startSeq,endSeq,showScores,showText,showBoxes,wrapAlignment);\r
-\r
-    this.backgroundColour = backgroundColour;\r
-  }\r
-\r
 \r
   public String getVisibleConsensus()\r
   {\r
@@ -125,6 +115,25 @@ public class AlignViewport
     return consensus;\r
   }\r
 \r
+  public SequenceGroup getRubberbandGroup()\r
+  {\r
+    return rubberbandGroup;\r
+  }\r
+\r
+  public void setRubberbandGroup(SequenceGroup sg)\r
+  {\r
+    rubberbandGroup = sg;\r
+  }\r
+\r
+ public boolean getConservationSelected()\r
+ {\r
+   return conservationColourSelected;\r
+ }\r
+\r
+ public void setConservationSelected(boolean b)\r
+ {\r
+   conservationColourSelected = b;\r
+ }\r
 \r
   public int getStartRes() {\r
     return startRes;\r
@@ -138,6 +147,16 @@ public class AlignViewport
     return startSeq;\r
   }\r
 \r
+  public void setGlobalColourScheme(ColourSchemeI cs)\r
+  {\r
+     globalColourScheme = cs;\r
+  }\r
+\r
+  public ColourSchemeI getGlobalColourScheme()\r
+  {\r
+    return globalColourScheme;\r
+  }\r
+\r
 \r
   public void setStartRes(int res) {\r
     this.startRes = res;\r
@@ -180,10 +199,10 @@ public class AlignViewport
   public Font getFont() {\r
     return font;\r
   }\r
-  public void setCharWidth(double w) {\r
+  public void setCharWidth(int w) {\r
     this.charWidth = w;\r
   }\r
-  public double getCharWidth() {\r
+  public int getCharWidth() {\r
     return charWidth;\r
   }\r
   public void setCharHeight(int h) {\r
@@ -255,15 +274,7 @@ public class AlignViewport
   public boolean getShowBoxes() {\r
     return showBoxes;\r
   }\r
- // public CommandParser getCommandLog() {\r
- ///   return log;\r
- // }\r
-  public boolean getGroupEdit() {\r
-    return groupEdit;\r
-  }\r
-  public void setGroupEdit(boolean state) {\r
-    groupEdit = state;\r
-  }\r
+\r
   public char getGapCharacter() {\r
     return getAlignment().getGapCharacter();\r
   }\r