X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignViewport.java;h=7719f024b8ed750bea0db1900adc0a288e46b416;hb=00386d5511d779b555e93dbf71f33675937e1570;hp=1324c1ecc40fe43c01619e902185787a41913333;hpb=1ecf6419aba86993b3c223bf5ec0fa79427baf85;p=jalview.git diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 1324c1e..7719f02 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -4,6 +4,7 @@ import java.awt.*; import jalview.io.*; import jalview.analysis.NJTree; import jalview.datamodel.*; +import jalview.schemes.*; import java.util.*; public class AlignViewport @@ -14,31 +15,34 @@ public class AlignViewport int startSeq; int endSeq; - boolean showScores; - boolean showText; - boolean showColourText; - boolean showBoxes; - boolean wrapAlignment; + boolean showScores=false; + boolean showText=true; + boolean showColourText=false; + boolean showBoxes=true; + boolean wrapAlignment=false; + boolean renderGaps = true; + boolean showSequenceFeatures = false; - boolean groupEdit = false; + boolean colourAppliesToAllGroups = true; + ColourSchemeI globalColourScheme = null; + boolean conservationColourSelected = false; + boolean abovePIDThreshold = false; - RendererI renderer = new SequenceRenderer(); + SequenceGroup rubberbandGroup = null; + + RendererI renderer = new SequenceRenderer(this); int charHeight; - double charWidth; + int charWidth; int chunkWidth; int chunkHeight; - Color backgroundColour; - Font font = new Font("SansSerif",Font.PLAIN,10); AlignmentI alignment; - Selection sel = new Selection(); + Selection sel = new Selection(this); ColumnSelection colSel = new ColumnSelection(); - OutputGenerator og; - String visibleConsensus; int threshold; @@ -46,10 +50,6 @@ public class AlignViewport NJTree currentTree = null; - int window = 50; - int baseline = 30; - - Vector kmers; public AlignViewport(AlignmentI da, boolean showScores, @@ -86,18 +86,10 @@ public class AlignViewport setFont( font ); } - public AlignViewport(int startRes, int endRes, - int startSeq, int endSeq, - boolean showScores, - boolean showText, - boolean showBoxes, - boolean wrapAlignment, - Color backgroundColour) { - this(startRes,endRes,startSeq,endSeq,showScores,showText,showBoxes,wrapAlignment); - - this.backgroundColour = backgroundColour; - } - + public void showSequenceFeatures(boolean b) + { + showSequenceFeatures = b; + } public String getVisibleConsensus() { @@ -105,7 +97,6 @@ public class AlignViewport } Vector consensus = new Vector(); - public Vector getConsensus(boolean recalculate) { if(recalculate || consensus.size()<1) @@ -125,6 +116,35 @@ public class AlignViewport return consensus; } + public SequenceGroup getRubberbandGroup() + { + return rubberbandGroup; + } + + public void setRubberbandGroup(SequenceGroup sg) + { + rubberbandGroup = sg; + } + + public boolean getConservationSelected() + { + return conservationColourSelected; + } + + public void setConservationSelected(boolean b) + { + conservationColourSelected = b; + } + + public boolean getAbovePIDThreshold() + { + return abovePIDThreshold; + } + + public void setAbovePIDThreshold(boolean b) + { + abovePIDThreshold = b; + } public int getStartRes() { return startRes; @@ -138,6 +158,16 @@ public class AlignViewport return startSeq; } + public void setGlobalColourScheme(ColourSchemeI cs) + { + globalColourScheme = cs; + } + + public ColourSchemeI getGlobalColourScheme() + { + return globalColourScheme; + } + public void setStartRes(int res) { this.startRes = res; @@ -180,10 +210,10 @@ public class AlignViewport public Font getFont() { return font; } - public void setCharWidth(double w) { + public void setCharWidth(int w) { this.charWidth = w; } - public double getCharWidth() { + public int getCharWidth() { return charWidth; } public void setCharHeight(int h) { @@ -220,6 +250,16 @@ public class AlignViewport showText = state; } + public void setRenderGaps(boolean state){ + renderGaps = state; + if(renderer instanceof SequenceRenderer) + { + SequenceRenderer sr = (SequenceRenderer)renderer; + sr.renderGaps(state); + } + } + + public boolean getColourText() { return showColourText; @@ -245,19 +285,11 @@ public class AlignViewport public boolean getShowBoxes() { return showBoxes; } - // public CommandParser getCommandLog() { - /// return log; - // } - public boolean getGroupEdit() { - return groupEdit; - } - public void setGroupEdit(boolean state) { - groupEdit = state; - } - public String getGapCharacter() { + + public char getGapCharacter() { return getAlignment().getGapCharacter(); } - public void setGapCharacter(String gap) { + public void setGapCharacter(char gap) { if (getAlignment() != null) { getAlignment().setGapCharacter(gap); } @@ -299,9 +331,7 @@ public class AlignViewport public ColumnSelection getColumnSelection() { return colSel; } - public OutputGenerator getOutputGenerator() { - return og; - } + public void resetSeqLimits(int height) { setStartSeq(0); setEndSeq(height/getCharHeight()); @@ -320,27 +350,12 @@ public class AlignViewport public RendererI getRenderer() { return renderer; } - public int getPIDWindow() { - return window; - } - public void setPIDWindow(int window) { - this.window = window; - } - - public int getPIDBaseline() { - return baseline; - } - public void setPIDBaseline(int baseline) { - this.baseline = baseline; - } - public void setKmers(Vector kmers) { - this.kmers = kmers; - } + public void setColourAppliesToAllGroups(boolean b) + { colourAppliesToAllGroups = b; } - public Vector getKmers() { - return this.kmers; - } + public boolean getColourAppliesToAllGroups() + {return colourAppliesToAllGroups; } }