/*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
+ * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
*
- * This program 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 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
*
- * This program 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.
+ * 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.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * 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/>.
*/
package jalview.gui;
jmol.pdbentry.getId().toLowerCase())))
continue;
matchedFile = jmol.pdbentry.getFile(); // record the file so we
- // can get at it if the ID
- // match is ambiguous (e.g.
- // 1QIP==1qipA)
+ // can get at it if the ID
+ // match is ambiguous (e.g.
+ // 1QIP==1qipA)
StructureState state = new StructureState();
state.setVisible(true);
state.setXpos(jmol.getX());
an.setId(aa[i].annotationId);
-
an.setVisible(aa[i].visible);
an.setDescription(aa[i].description);
// sequence rather than its display name
an.setSequenceRef(aa[i].sequenceRef.getName());
}
- if (aa[i].groupRef!=null)
+ if (aa[i].groupRef != null)
{
Object groupIdr = groupRefs.get(aa[i].groupRef);
- if (groupIdr==null)
+ if (groupIdr == null)
{
// make a locally unique String
- groupRefs.put(aa[i].groupRef, groupIdr = (""+System.currentTimeMillis()+aa[i].groupRef.getName()+groupRefs.size()));
+ groupRefs.put(aa[i].groupRef,
+ groupIdr = ("" + System.currentTimeMillis()
+ + aa[i].groupRef.getName() + groupRefs.size()));
}
an.setGroupRef(groupIdr.toString());
}
if (aa[i] == av.quality || aa[i] == av.conservation
|| aa[i] == av.consensus || aa[i].autoCalculated)
{
- // new way of indicating autocalculated annotation -
+ // new way of indicating autocalculated annotation -
an.setAutoCalculated(aa[i].autoCalculated);
- // write a stub for this annotation - indicate presence of autocalc rows
+ // write a stub for this annotation - indicate presence of autocalc
+ // rows
an.setLabel(aa[i].label);
an.setGraph(true);
vamsasSet.addAnnotation(an);
.getGroups().elementAt(i);
groups[i].setStart(sg.getStartRes());
groups[i].setEnd(sg.getEndRes());
- groups[i].setName(sg.getName());
- if (groupRefs.containsKey(sg)) {
- // group has references so set it's ID field
+ groups[i].setName(sg.getName());
+ if (groupRefs.containsKey(sg))
+ {
+ // group has references so set it's ID field
groups[i].setId(groupRefs.get(sg).toString());
}
if (sg.cs != null)
groups[i].setTextCol1(sg.textColour.getRGB());
groups[i].setTextCol2(sg.textColour2.getRGB());
groups[i].setTextColThreshold(sg.thresholdTextColour);
- groups[i].setShowUnconserved(sg.getShowunconserved());
+ groups[i].setShowUnconserved(sg.getShowNonconserved());
groups[i].setIgnoreGapsinConsensus(sg.getIgnoreGapsConsensus());
groups[i].setShowConsensusHistogram(sg.isShowConsensusHistogram());
- groups[i].setShowConsensusProfile(sg.isIncludeAllConsSymbols());
+ groups[i].setShowSequenceLogo(sg.isShowSequenceLogo());
for (int s = 0; s < sg.getSize(); s++)
{
jalview.datamodel.Sequence seq = (jalview.datamodel.Sequence) sg
view.setTextCol2(av.textColour2.getRGB());
view.setTextColThreshold(av.thresholdTextColour);
view.setShowConsensusHistogram(av.isShowConsensusHistogram());
- view.setShowConsensusProfile(av.isShowConsensusProfile());
+ view.setShowSequenceLogo(av.isShowSequenceLogo());
view.setShowGroupConsensus(av.isShowGroupConsensus());
view.setShowGroupConservation(av.isShowGroupConservation());
view.setShowNPfeatureTooltip(av.isShowNpFeats());
String[] renderOrder = ap.seqPanel.seqCanvas.getFeatureRenderer().renderOrder;
Vector settingsAdded = new Vector();
- Object gstyle=null;
- GraduatedColor gcol = null;
+ Object gstyle = null;
+ GraduatedColor gcol = null;
for (int ro = 0; ro < renderOrder.length; ro++)
{
- gstyle = ap.seqPanel.seqCanvas.getFeatureRenderer().getFeatureStyle(renderOrder[ro]);
+ gstyle = ap.seqPanel.seqCanvas.getFeatureRenderer()
+ .getFeatureStyle(renderOrder[ro]);
Setting setting = new Setting();
setting.setType(renderOrder[ro]);
- if (gstyle instanceof GraduatedColor) {
- gcol = (GraduatedColor) gstyle;
+ if (gstyle instanceof GraduatedColor)
+ {
+ gcol = (GraduatedColor) gstyle;
setting.setColour(gcol.getMaxColor().getRGB());
setting.setMincolour(gcol.getMinColor().getRGB());
setting.setMin(gcol.getMin());
setting.setAutoScale(gcol.isAutoScale());
setting.setThreshold(gcol.getThresh());
setting.setThreshstate(gcol.getThreshType());
- } else {
- setting.setColour(ap.seqPanel.seqCanvas.getFeatureRenderer() .getColour(renderOrder[ro]).getRGB());
}
-
+ else
+ {
+ setting.setColour(ap.seqPanel.seqCanvas.getFeatureRenderer()
+ .getColour(renderOrder[ro]).getRGB());
+ }
+
setting.setDisplay(av.featuresDisplayed
.containsKey(renderOrder[ro]));
float rorder = ap.seqPanel.seqCanvas.getFeatureRenderer().getOrder(
{
String id = null;
jalview.schemes.UserColourScheme ucs = (jalview.schemes.UserColourScheme) cs;
- boolean newucs=false;
+ boolean newucs = false;
if (!userColours.contains(ucs))
{
userColours.add(ucs);
- newucs=true;
+ newucs = true;
}
id = "ucs" + userColours.indexOf(ucs);
- if (newucs) {
+ if (newucs)
+ {
// actually create the scheme's entry in the XML model
java.awt.Color[] colours = ucs.getColours();
jalview.schemabinding.version2.UserColours uc = new jalview.schemabinding.version2.UserColours();
{
hideConsensus = false;
continue;
- }
+ }
// set visiblity for other annotation in this view
if (an[i].getId() != null
&& annotationIds.containsKey(an[i].getId()))
}
}
// and make a note of any group association
- if (an[i].getGroupRef()!=null && an[i].getGroupRef().length()>0)
+ if (an[i].getGroupRef() != null && an[i].getGroupRef().length() > 0)
{
- groupAnnotRefs.put(an[i].getGroupRef(),jaa);
+ groupAnnotRefs.put(an[i].getGroupRef(), jaa);
}
if (an[i].hasScore())
}
if (an[i].hasVisible())
jaa.visible = an[i].getVisible();
-
+
if (an[i].hasCentreColLabels())
jaa.centreColLabels = an[i].getCentreColLabels();
-
+
if (an[i].hasScaleColLabels())
{
jaa.scaleColLabel = an[i].getScaleColLabels();
}
if (an[i].hasAutoCalculated() && an[i].isAutoCalculated())
{
- // newer files have an 'autoCalculated' flag and store calculation state in viewport properties
- jaa.autoCalculated = true; // means annotation will be marked for update at end of load.
+ // newer files have an 'autoCalculated' flag and store calculation
+ // state in viewport properties
+ jaa.autoCalculated = true; // means annotation will be marked for
+ // update at end of load.
}
al.addAnnotation(jaa);
}
sg.textColour = new java.awt.Color(groups[i].getTextCol1());
sg.textColour2 = new java.awt.Color(groups[i].getTextCol2());
- sg.setShowunconserved(groups[i].hasShowUnconserved() ? groups[i]
+ sg.setShowNonconserved(groups[i].hasShowUnconserved() ? groups[i]
.isShowUnconserved() : false);
sg.thresholdTextColour = groups[i].getTextColThreshold();
- if (groups[i].hasShowConsensusHistogram()) {
- sg.setShowConsensusHistogram(groups[i].isShowConsensusHistogram());
- };
- if (groups[i].hasShowConsensusProfile()) {
- sg.setIncludeAllConsSymbols(groups[i].isShowConsensusProfile());
+ if (groups[i].hasShowConsensusHistogram())
+ {
+ sg
+ .setShowConsensusHistogram(groups[i]
+ .isShowConsensusHistogram());
+ }
+ ;
+ if (groups[i].hasShowSequenceLogo())
+ {
+ sg.setshowSequenceLogo(groups[i].isShowSequenceLogo());
}
if (groups[i].hasIgnoreGapsinConsensus())
{
c.verdict(false, 25);
sg.cs.setConservation(c);
}
-
- if (groups[i].getId()!=null
- && groupAnnotRefs.size()>0)
+
+ if (groups[i].getId() != null && groupAnnotRefs.size() > 0)
{
// re-instate unique group/annotation row reference
- jalview.datamodel.AlignmentAnnotation jaa = (jalview.datamodel.AlignmentAnnotation) groupAnnotRefs.get(groups[i].getId());
- if (jaa!=null)
+ jalview.datamodel.AlignmentAnnotation jaa = (jalview.datamodel.AlignmentAnnotation) groupAnnotRefs
+ .get(groups[i].getId());
+ if (jaa != null)
{
jaa.groupRef = sg;
}
}
al.addGroup(sg);
-
+
}
}
else if (view.getBgColour().startsWith("Annotation"))
{
// int find annotation
- for (int i = 0; i < af.viewport.alignment.getAlignmentAnnotation().length; i++)
+ if (af.viewport.alignment.getAlignmentAnnotation() != null)
{
- if (af.viewport.alignment.getAlignmentAnnotation()[i].label
- .equals(view.getAnnotationColours().getAnnotation()))
+ for (int i = 0; i < af.viewport.alignment
+ .getAlignmentAnnotation().length; i++)
{
- if (af.viewport.alignment.getAlignmentAnnotation()[i]
- .getThreshold() == null)
+ if (af.viewport.alignment.getAlignmentAnnotation()[i].label
+ .equals(view.getAnnotationColours().getAnnotation()))
{
- af.viewport.alignment.getAlignmentAnnotation()[i]
- .setThreshold(new jalview.datamodel.GraphLine(view
- .getAnnotationColours().getThreshold(),
- "Threshold", java.awt.Color.black)
-
- );
- }
+ if (af.viewport.alignment.getAlignmentAnnotation()[i]
+ .getThreshold() == null)
+ {
+ af.viewport.alignment.getAlignmentAnnotation()[i]
+ .setThreshold(new jalview.datamodel.GraphLine(view
+ .getAnnotationColours().getThreshold(),
+ "Threshold", java.awt.Color.black)
- if (view.getAnnotationColours().getColourScheme()
- .equals("None"))
- {
- cs = new AnnotationColourGradient(af.viewport.alignment
- .getAlignmentAnnotation()[i], new java.awt.Color(view
- .getAnnotationColours().getMinColour()),
- new java.awt.Color(view.getAnnotationColours()
- .getMaxColour()), view.getAnnotationColours()
- .getAboveThreshold());
- }
- else if (view.getAnnotationColours().getColourScheme()
- .startsWith("ucs"))
- {
- cs = new AnnotationColourGradient(af.viewport.alignment
- .getAlignmentAnnotation()[i], GetUserColourScheme(
- jms, view.getAnnotationColours().getColourScheme()),
- view.getAnnotationColours().getAboveThreshold());
- }
- else
- {
- cs = new AnnotationColourGradient(af.viewport.alignment
- .getAlignmentAnnotation()[i], ColourSchemeProperty
- .getColour(al, view.getAnnotationColours()
- .getColourScheme()), view
- .getAnnotationColours().getAboveThreshold());
- }
+ );
+ }
- // Also use these settings for all the groups
- if (al.getGroups() != null)
- {
- for (int g = 0; g < al.getGroups().size(); g++)
+ if (view.getAnnotationColours().getColourScheme().equals(
+ "None"))
+ {
+ cs = new AnnotationColourGradient(af.viewport.alignment
+ .getAlignmentAnnotation()[i], new java.awt.Color(
+ view.getAnnotationColours().getMinColour()),
+ new java.awt.Color(view.getAnnotationColours()
+ .getMaxColour()), view
+ .getAnnotationColours().getAboveThreshold());
+ }
+ else if (view.getAnnotationColours().getColourScheme()
+ .startsWith("ucs"))
{
- jalview.datamodel.SequenceGroup sg = (jalview.datamodel.SequenceGroup) al
- .getGroups().elementAt(g);
+ cs = new AnnotationColourGradient(af.viewport.alignment
+ .getAlignmentAnnotation()[i],
+ GetUserColourScheme(jms, view
+ .getAnnotationColours().getColourScheme()),
+ view.getAnnotationColours().getAboveThreshold());
+ }
+ else
+ {
+ cs = new AnnotationColourGradient(af.viewport.alignment
+ .getAlignmentAnnotation()[i], ColourSchemeProperty
+ .getColour(al, view.getAnnotationColours()
+ .getColourScheme()), view
+ .getAnnotationColours().getAboveThreshold());
+ }
- if (sg.cs == null)
+ // Also use these settings for all the groups
+ if (al.getGroups() != null)
+ {
+ for (int g = 0; g < al.getGroups().size(); g++)
{
- continue;
- }
+ jalview.datamodel.SequenceGroup sg = (jalview.datamodel.SequenceGroup) al
+ .getGroups().elementAt(g);
- /*
- * if
- * (view.getAnnotationColours().getColourScheme().equals("None"
- * )) { sg.cs = new AnnotationColourGradient(
- * af.viewport.alignment.getAlignmentAnnotation()[i], new
- * java.awt.Color(view.getAnnotationColours(). getMinColour()),
- * new java.awt.Color(view.getAnnotationColours().
- * getMaxColour()),
- * view.getAnnotationColours().getAboveThreshold()); } else
- */
- {
- sg.cs = new AnnotationColourGradient(
- af.viewport.alignment.getAlignmentAnnotation()[i],
- sg.cs, view.getAnnotationColours()
- .getAboveThreshold());
- }
+ if (sg.cs == null)
+ {
+ continue;
+ }
+
+ /*
+ * if
+ * (view.getAnnotationColours().getColourScheme().equals("None"
+ * )) { sg.cs = new AnnotationColourGradient(
+ * af.viewport.alignment.getAlignmentAnnotation()[i], new
+ * java.awt.Color(view.getAnnotationColours().
+ * getMinColour()), new
+ * java.awt.Color(view.getAnnotationColours().
+ * getMaxColour()),
+ * view.getAnnotationColours().getAboveThreshold()); } else
+ */
+ {
+ sg.cs = new AnnotationColourGradient(
+ af.viewport.alignment.getAlignmentAnnotation()[i],
+ sg.cs, view.getAnnotationColours()
+ .getAboveThreshold());
+ }
+ }
}
+
+ break;
}
- break;
}
-
}
}
else
}
if (view.hasIgnoreGapsinConsensus())
{
- af.viewport.ignoreGapsInConsensusCalculation=view.getIgnoreGapsinConsensus();
+ af.viewport.ignoreGapsInConsensusCalculation = view
+ .getIgnoreGapsinConsensus();
}
if (view.hasFollowHighlight())
{
}
if (view.hasShowConsensusHistogram())
{
- af.viewport.setShowConsensusHistogram(view.getShowConsensusHistogram());
+ af.viewport.setShowConsensusHistogram(view
+ .getShowConsensusHistogram());
}
- if (view.hasShowConsensusProfile())
+ else
{
- af.viewport.setShowConsensusProfile(view.getShowConsensusProfile());
+ af.viewport.setShowConsensusHistogram(true);
+ }
+ if (view.hasShowSequenceLogo())
+ {
+ af.viewport.setShowSequenceLogo(view.getShowSequenceLogo());
+ }
+ else
+ {
+ af.viewport.setShowSequenceLogo(false);
}
if (view.hasShowDbRefTooltip())
{
{
af.viewport.setShowGroupConsensus(view.getShowGroupConsensus());
}
+ else
+ {
+ af.viewport.setShowGroupConsensus(false);
+ }
if (view.hasShowGroupConservation())
{
af.viewport.setShowGroupConservation(view.getShowGroupConservation());
}
-
+ else
+ {
+ af.viewport.setShowGroupConservation(false);
+ }
+
// recover featre settings
if (jms.getFeatureSettings() != null)
{
Setting setting = jms.getFeatureSettings().getSetting(fs);
if (setting.hasMincolour())
{
- GraduatedColor gc = setting.hasMin() ? new GraduatedColor(new java.awt.Color(setting
- .getMincolour()),
- new java.awt.Color(setting.getColour()), setting.getMin(), setting.getMax())
- : new GraduatedColor(new java.awt.Color(setting
- .getMincolour()),
- new java.awt.Color(setting.getColour()), 0,1);
+ GraduatedColor gc = setting.hasMin() ? new GraduatedColor(
+ new java.awt.Color(setting.getMincolour()),
+ new java.awt.Color(setting.getColour()),
+ setting.getMin(), setting.getMax()) : new GraduatedColor(
+ new java.awt.Color(setting.getMincolour()),
+ new java.awt.Color(setting.getColour()), 0, 1);
if (setting.hasThreshold())
{
gc.setThresh(setting.getThreshold());
gc.setColourByLabel(setting.getColourByLabel());
}
// and put in the feature colour table.
- af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(setting.getType(),gc);
+ af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setColour(
+ setting.getType(), gc);
}
else
{
}
af.setMenusFromViewport(af.viewport);
- af.alignPanel.updateAnnotation(false); // recompute any autoannotation
// TODO: we don't need to do this if the viewport is aready visible.
Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(), view
.getHeight());
+ af.alignPanel.updateAnnotation(false); // recompute any autoannotation
return af;
}
{
uniqueSetSuffix = "";
jm.getJalviewModelSequence().getViewport(0).setId(null); // we don't
- // overwrite the
- // view we just
- // copied
+ // overwrite the
+ // view we just
+ // copied
}
if (this.frefedSequence == null)
{