X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignViewport.java;h=9a15e109c841164e69830f47ad36e5c12f97f45d;hb=b5d61763044c1d72f06ce0e50da2171422a3774b;hp=95aafab1c2056f1bc76a32d7f4aa84ae11169fd9;hpb=a822fc744dcc06e6a8d2399218da0d0dfd56cf2b;p=jalview.git
diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java
index 95aafab..9a15e10 100644
--- a/src/jalview/appletgui/AlignViewport.java
+++ b/src/jalview/appletgui/AlignViewport.java
@@ -1,19 +1,22 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.appletgui;
@@ -22,7 +25,6 @@ import java.util.*;
import java.awt.*;
import jalview.analysis.*;
-import jalview.api.AlignCalcManagerI;
import jalview.api.AlignViewportI;
import jalview.bin.*;
import jalview.datamodel.*;
@@ -30,10 +32,9 @@ import jalview.schemes.*;
import jalview.structure.SelectionSource;
import jalview.structure.VamsasSource;
import jalview.viewmodel.AlignmentViewport;
-import jalview.workers.ConservationThread;
-import jalview.workers.ConsensusThread;
-public class AlignViewport extends AlignmentViewport implements AlignViewportI, SelectionSource, VamsasSource
+public class AlignViewport extends AlignmentViewport implements
+ AlignViewportI, SelectionSource, VamsasSource
{
int startRes;
@@ -57,24 +58,10 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
boolean renderGaps = true;
- boolean showSequenceFeatures = false;
-
boolean showAnnotation = true;
- boolean showConservation = true;
-
- boolean showQuality = true;
-
- boolean showConsensus = true;
-
boolean upperCasebold = false;
- boolean colourAppliesToAllGroups = true;
-
- boolean conservationColourSelected = false;
-
- boolean abovePIDThreshold = false;
-
int charHeight;
int charWidth;
@@ -97,28 +84,22 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
boolean scaleRightWrapped = true;
- // The following vector holds the features which are
- // currently visible, in the correct order or rendering
- public Hashtable featuresDisplayed;
-
-
boolean showHiddenMarkers = true;
public jalview.bin.JalviewLite applet;
- Hashtable sequenceColours;
-
boolean MAC = false;
Stack historyList = new Stack();
Stack redoList = new Stack();
-
- public void finalize() {
- applet=null;
- quality=null;
- alignment=null;
- colSel=null;
+
+ public void finalize()
+ {
+ applet = null;
+ quality = null;
+ alignment = null;
+ colSel = null;
}
public AlignViewport(AlignmentI al, JalviewLite applet)
@@ -190,15 +171,19 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
{
showJVSuffix = applet.getDefaultParameter("showFullId", showJVSuffix);
- showAnnotation = applet.getDefaultParameter("showAnnotation", showAnnotation);
-
- showConservation = applet.getDefaultParameter("showConservation", showConservation);
-
+ showAnnotation = applet.getDefaultParameter("showAnnotation",
+ showAnnotation);
+
+ showConservation = applet.getDefaultParameter("showConservation",
+ showConservation);
+
showQuality = applet.getDefaultParameter("showQuality", showQuality);
- showConsensus = applet.getDefaultParameter("showConsensus", showConsensus);
+ showConsensus = applet.getDefaultParameter("showConsensus",
+ showConsensus);
- showUnconserved = applet.getDefaultParameter("showUnconserved", showUnconserved);
+ showUnconserved = applet.getDefaultParameter("showUnconserved",
+ showUnconserved);
String param = applet.getParameter("upperCase");
if (param != null)
@@ -210,19 +195,26 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
}
sortByTree = applet.getDefaultParameter("sortByTree", sortByTree);
- followHighlight = applet.getDefaultParameter("automaticScrolling",followHighlight);
+ followHighlight = applet.getDefaultParameter("automaticScrolling",
+ followHighlight);
followSelection = followHighlight;
- showSequenceLogo = applet.getDefaultParameter("showSequenceLogo", showSequenceLogo);
+ showSequenceLogo = applet.getDefaultParameter("showSequenceLogo",
+ showSequenceLogo);
+
+ normaliseSequenceLogo = applet.getDefaultParameter(
+ "normaliseSequenceLogo", applet.getDefaultParameter(
+ "normaliseLogo", normaliseSequenceLogo));
+
+ showGroupConsensus = applet.getDefaultParameter("showGroupConsensus",
+ showGroupConsensus);
+
+ showGroupConservation = applet.getDefaultParameter(
+ "showGroupConservation", showGroupConservation);
- normaliseSequenceLogo = applet.getDefaultParameter("normaliseSequenceLogo", normaliseSequenceLogo);
+ showConsensusHistogram = applet.getDefaultParameter(
+ "showConsensusHistogram", showConsensusHistogram);
- showGroupConsensus = applet.getDefaultParameter("showGroupConsensus", showGroupConsensus);
-
- showGroupConservation = applet.getDefaultParameter("showGroupConservation", showGroupConservation);
-
- showConsensusHistogram = applet.getDefaultParameter("showConsensusHistogram", showConsensusHistogram);
-
}
if (applet != null)
@@ -254,70 +246,10 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
.getParameter("userDefinedColour"));
}
}
- if (hconsensus == null)
- {
- if (!alignment.isNucleotide())
- {
- conservation = new AlignmentAnnotation("Conservation",
- "Conservation of total alignment less than " + getConsPercGaps()
- + "% gaps", new Annotation[1], 0f, 11f,
- AlignmentAnnotation.BAR_GRAPH);
- conservation.hasText = true;
- conservation.autoCalculated = true;
-
- if (showConservation)
- {
- alignment.addAnnotation(conservation);
- }
-
- if (showQuality)
- {
- quality = new AlignmentAnnotation("Quality",
- "Alignment Quality based on Blosum62 scores",
- new Annotation[1], 0f, 11f, AlignmentAnnotation.BAR_GRAPH);
- quality.hasText = true;
- quality.autoCalculated = true;
-
- alignment.addAnnotation(quality);
- }
- } else {
- if (alignment.hasRNAStructure())
- {
- strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
- new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- strucConsensus.hasText = true;
- strucConsensus.autoCalculated = true;
- }
- }
-
- consensus = new AlignmentAnnotation("Consensus", "PID",
- new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- consensus.hasText = true;
- consensus.autoCalculated = true;
-
- if (showConsensus)
- {
- alignment.addAnnotation(consensus);
- if (strucConsensus!=null)
- {
- alignment.addAnnotation(strucConsensus);
- }
- }
- }
+ initAutoAnnotation();
}
- public void showSequenceFeatures(boolean b)
- {
- showSequenceFeatures = b;
- }
-
- public boolean getShowSequenceFeatures()
- {
- return showSequenceFeatures;
- }
-
-
/**
* get the consensus sequence as displayed under the PID consensus annotation
* row.
@@ -355,26 +287,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
return sq;
}
- 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;
@@ -558,26 +470,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
}
}
- public void setThreshold(int thresh)
- {
- threshold = thresh;
- }
-
- public int getThreshold()
- {
- return threshold;
- }
-
- public void setIncrement(int inc)
- {
- increment = inc;
- }
-
- public int getIncrement()
- {
- return increment;
- }
-
public void resetSeqLimits(int height)
{
setEndSeq(height / getCharHeight());
@@ -593,16 +485,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
return currentTree;
}
- public void setColourAppliesToAllGroups(boolean b)
- {
- colourAppliesToAllGroups = b;
- }
-
- public boolean getColourAppliesToAllGroups()
- {
- return colourAppliesToAllGroups;
- }
-
public boolean getShowJVSuffix()
{
return showJVSuffix;
@@ -665,10 +547,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
}
}
-
-
-
-
public boolean getShowHiddenMarkers()
{
return showHiddenMarkers;
@@ -679,35 +557,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
showHiddenMarkers = show;
}
- public Color getSequenceColour(SequenceI seq)
- {
- if (sequenceColours == null || !sequenceColours.containsKey(seq))
- {
- return Color.white;
- }
- else
- {
- return (Color) sequenceColours.get(seq);
- }
- }
-
- public void setSequenceColour(SequenceI seq, Color col)
- {
- if (sequenceColours == null)
- {
- sequenceColours = new Hashtable();
- }
-
- if (col == null)
- {
- sequenceColours.remove(seq);
- }
- else
- {
- sequenceColours.put(seq, col);
- }
- }
-
boolean centreColumnLabels;
public boolean getCentreColumnLabels()
@@ -715,23 +564,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
return centreColumnLabels;
}
- public void updateSequenceIdColours()
- {
- Vector groups = alignment.getGroups();
- for (int ig = 0, igSize = groups.size(); ig < igSize; ig++)
- {
- SequenceGroup sg = (SequenceGroup) groups.elementAt(ig);
- if (sg.idColour != null)
- {
- Vector sqs = sg.getSequences(getHiddenRepSequences());
- for (int s = 0, sSize = sqs.size(); s < sSize; s++)
- {
- this.setSequenceColour((SequenceI) sqs.elementAt(s), sg.idColour);
- }
- }
- }
- }
-
public boolean followHighlight = true;
public boolean getFollowHighlight()
@@ -749,6 +581,7 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
{
return followSelection;
}
+
public void sendSelection()
{
jalview.structure.StructureSelectionManager
@@ -757,9 +590,6 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
new ColumnSelection(getColumnSelection()), this);
}
-
-
-
/**
* synthesize a column selection if none exists so it covers the given
* selection group. if wholewidth is false, no column selection is made if the
@@ -798,7 +628,7 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
{
return hasHiddenColumns;
}
-
+
public boolean isNormaliseSequenceLogo()
{
return normaliseSequenceLogo;
@@ -811,7 +641,7 @@ public class AlignViewport extends AlignmentViewport implements AlignViewportI,
/**
*
- * @return true if alignment characters should be displayed
+ * @return true if alignment characters should be displayed
*/
public boolean isValidCharWidth()
{