/*
- * 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)
+ * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
*
* 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
import java.awt.event.*;
-import jalview.appletgui.FeatureSettings.MyCheckbox;
import jalview.datamodel.*;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.GraduatedColor;
+import jalview.util.MessageManager;
/**
* DOCUMENT ME!
featureGroups = fr.featureGroups;
featureColours = fr.featureColours;
transparency = fr.transparency;
- if (av!=null && fr.av!=null && fr.av!=av)
+ if (av != null && fr.av != null && fr.av != av)
{
- if (fr.av.featuresDisplayed!=null)
+ if (fr.av.featuresDisplayed != null)
{
- if (av.featuresDisplayed==null)
+ if (av.featuresDisplayed == null)
{
av.featuresDisplayed = new Hashtable();
- } else {
+ }
+ else
+ {
av.featuresDisplayed.clear();
}
- Enumeration en=fr.av.featuresDisplayed.keys();
+ Enumeration en = fr.av.featuresDisplayed.keys();
while (en.hasMoreElements())
{
av.featuresDisplayed.put(en.nextElement(), Boolean.TRUE);
g.setColor(Color.black);
Font f = new Font("Verdana", Font.PLAIN, 10);
g.setFont(f);
- g.drawString("Label", 0, 0);
+ g.drawString(MessageManager.getString("label.label"), 0, 0);
}
else
{
}
else
{
- dialog.ok.setLabel("Amend");
+ dialog.ok.setLabel(MessageManager.getString("label.amend"));
dialog.buttonPanel.add(deleteButton, 1);
deleteButton.addActionListener(new ActionListener()
{
av.featuresDisplayed = new Hashtable();
Vector allfeatures = new Vector();
minmax = new Hashtable();
-
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment = av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- SequenceFeature[] features = av.alignment.getSequenceAt(i)
+ SequenceFeature[] features = alignment.getSequenceAt(i)
.getSequenceFeatures();
if (features == null)
for (int i = 0; i < toset.length; i++)
{
Object st = featureGroups.get(toset[i]);
+ featureGroups.put(toset[i], new Boolean(visible));
if (st != null)
{
- featureGroups.put(toset[i], new Boolean(visible));
rdrw = rdrw || (visible != ((Boolean) st).booleanValue());
}
}
}
}
+ ArrayList<String> hiddenGroups = new ArrayList<String>();
+
/**
* analyse alignment for groups and hash tables (used to be embedded in
* FeatureSettings.setTableData)
{
featureGroups = new Hashtable();
}
- Vector allFeatures = new Vector();
- Vector allGroups = new Vector();
+ hiddenGroups = new ArrayList<String>();
+ hiddenGroups.addAll(featureGroups.keySet());
+ ArrayList allFeatures = new ArrayList();
+ ArrayList allGroups = new ArrayList();
SequenceFeature[] tmpfeatures;
String group;
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment = av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+ if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
{
continue;
}
alignmentHasFeatures = true;
- tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+ tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
int index = 0;
while (index < tmpfeatures.length)
{
if (tmpfeatures[index].getFeatureGroup() != null)
{
group = tmpfeatures[index].featureGroup;
+ // Remove group from the hiddenGroup list
+ hiddenGroups.remove(group);
if (!allGroups.contains(group))
{
- allGroups.addElement(group);
+ allGroups.add(group);
boolean visible = true;
if (featureGroups.containsKey(group))
if (!allFeatures.contains(tmpfeatures[index].getType()))
{
- allFeatures.addElement(tmpfeatures[index].getType());
+ allFeatures.add(tmpfeatures[index].getType());
}
index++;
}
Vector allFeatures = new Vector();
SequenceFeature[] tmpfeatures;
String group;
- for (int i = 0; i < av.alignment.getHeight(); i++)
+ AlignmentI alignment = av.getAlignment();
+ for (int i = 0; i < alignment.getHeight(); i++)
{
- if (av.alignment.getSequenceAt(i).getSequenceFeatures() == null)
+ if (alignment.getSequenceAt(i).getSequenceFeatures() == null)
{
continue;
}
alignmentHasFeatures = true;
- tmpfeatures = av.alignment.getSequenceAt(i).getSequenceFeatures();
+ tmpfeatures = alignment.getSequenceAt(i).getSequenceFeatures();
int index = 0;
while (index < tmpfeatures.length)
{