/*
- * 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.0b1)
+ * 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.
- *
+ *
* 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 <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.appletgui;
import java.awt.*;
import jalview.analysis.*;
-import jalview.api.AlignCalcManagerI;
import jalview.api.AlignViewportI;
import jalview.bin.*;
import jalview.datamodel.*;
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;
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;
// currently visible, in the correct order or rendering
public Hashtable featuresDisplayed;
-
boolean showHiddenMarkers = true;
public jalview.bin.JalviewLite applet;
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)
{
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)
}
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", normaliseSequenceLogo);
+ normaliseSequenceLogo = applet.getDefaultParameter(
+ "normaliseSequenceLogo", applet.getDefaultParameter(
+ "normaliseLogo", normaliseSequenceLogo));
+
+ showGroupConsensus = applet.getDefaultParameter("showGroupConsensus",
+ showGroupConsensus);
+
+ showGroupConservation = applet.getDefaultParameter(
+ "showGroupConservation", showGroupConservation);
+
+ showConsensusHistogram = applet.getDefaultParameter(
+ "showConsensusHistogram", showConsensusHistogram);
- showGroupConsensus = applet.getDefaultParameter("showGroupConsensus", showGroupConsensus);
-
- showGroupConservation = applet.getDefaultParameter("showGroupConservation", showGroupConservation);
-
- showConsensusHistogram = applet.getDefaultParameter("showConsensusHistogram", showConsensusHistogram);
-
}
if (applet != null)
.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();
}
return showSequenceFeatures;
}
-
/**
* get the consensus sequence as displayed under the PID consensus annotation
* row.
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;
return currentTree;
}
- public void setColourAppliesToAllGroups(boolean b)
- {
- colourAppliesToAllGroups = b;
- }
-
- public boolean getColourAppliesToAllGroups()
- {
- return colourAppliesToAllGroups;
- }
-
public boolean getShowJVSuffix()
{
return showJVSuffix;
}
}
-
-
-
-
public boolean getShowHiddenMarkers()
{
return showHiddenMarkers;
public void updateSequenceIdColours()
{
- Vector groups = alignment.getGroups();
- for (int ig = 0, igSize = groups.size(); ig < igSize; ig++)
+
+ for (SequenceGroup sg : alignment.getGroups())
{
- 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++)
+ for (SequenceI s : sg.getSequences(getHiddenRepSequences()))
{
- this.setSequenceColour((SequenceI) sqs.elementAt(s), sg.idColour);
+ this.setSequenceColour(s, sg.idColour);
}
}
}
{
return followSelection;
}
+
public void sendSelection()
{
jalview.structure.StructureSelectionManager
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
{
return hasHiddenColumns;
}
-
+
public boolean isNormaliseSequenceLogo()
{
return normaliseSequenceLogo;
/**
*
- * @return true if alignment characters should be displayed
+ * @return true if alignment characters should be displayed
*/
public boolean isValidCharWidth()
{