/*
- * 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)
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.setShowunconserved(groups[i].hasShowUnconserved() ? groups[i]
.isShowUnconserved() : false);
sg.thresholdTextColour = groups[i].getTextColThreshold();
- if (groups[i].hasShowConsensusHistogram()) {
- sg.setShowConsensusHistogram(groups[i].isShowConsensusHistogram());
- };
- if (groups[i].hasShowSequenceLogo()) {
+ if (groups[i].hasShowConsensusHistogram())
+ {
+ sg
+ .setShowConsensusHistogram(groups[i]
+ .isShowConsensusHistogram());
+ }
+ ;
+ if (groups[i].hasShowSequenceLogo())
+ {
sg.setIncludeAllConsSymbols(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);
-
+
}
}
}
if (view.hasIgnoreGapsinConsensus())
{
- af.viewport.ignoreGapsInConsensusCalculation=view.getIgnoreGapsinConsensus();
+ af.viewport.ignoreGapsInConsensusCalculation = view
+ .getIgnoreGapsinConsensus();
}
if (view.hasFollowHighlight())
{
}
if (view.hasShowConsensusHistogram())
{
- af.viewport.setShowConsensusHistogram(view.getShowConsensusHistogram());
- } else {
+ af.viewport.setShowConsensusHistogram(view
+ .getShowConsensusHistogram());
+ }
+ else
+ {
af.viewport.setShowConsensusHistogram(true);
}
if (view.hasShowSequenceLogo())
{
af.viewport.setShowSequenceLogo(view.getShowSequenceLogo());
- } else {
+ }
+ else
+ {
af.viewport.setShowSequenceLogo(false);
}
if (view.hasShowDbRefTooltip())
if (view.hasShowGroupConsensus())
{
af.viewport.setShowGroupConsensus(view.getShowGroupConsensus());
- } else {
+ }
+ else
+ {
af.viewport.setShowGroupConsensus(false);
}
if (view.hasShowGroupConservation())
{
af.viewport.setShowGroupConservation(view.getShowGroupConservation());
- } else {
+ }
+ 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
{
{
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)
{