git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' of https://source.jalview.org/git/jalview into develop
[jalview.git]
/
src
/
jalview
/
io
/
AnnotationFile.java
diff --git
a/src/jalview/io/AnnotationFile.java
b/src/jalview/io/AnnotationFile.java
index
1097617
..
ef903e3
100755
(executable)
--- a/
src/jalview/io/AnnotationFile.java
+++ b/
src/jalview/io/AnnotationFile.java
@@
-32,7
+32,6
@@
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
import jalview.datamodel.SequenceI;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
-import jalview.schemes.UserColourScheme;
import jalview.util.ColorUtils;
import java.awt.Color;
import jalview.util.ColorUtils;
import java.awt.Color;
@@
-110,23
+109,24
@@
public class AnnotationFile
*/
public class ViewDef
{
*/
public class ViewDef
{
- public String viewname;
+ // TODO this class is not used - remove?
+ public final String viewname;
- public HiddenSequences hidseqs;
+ public final HiddenSequences hidseqs;
- public ColumnSelection hiddencols;
+ public final ColumnSelection hiddencols;
- public Vector visibleGroups;
+ // public final Vector visibleGroups;
- public Hashtable hiddenRepSeqs;
+ public final Hashtable hiddenRepSeqs;
- public ViewDef(String viewname, HiddenSequences hidseqs,
- ColumnSelection hiddencols, Hashtable hiddenRepSeqs)
+ public ViewDef(String vname, HiddenSequences hseqs,
+ ColumnSelection hcols, Hashtable hRepSeqs)
{
{
- this.viewname = viewname;
- this.hidseqs = hidseqs;
- this.hiddencols = hiddencols;
- this.hiddenRepSeqs = hiddenRepSeqs;
+ this.viewname = vname;
+ this.hidseqs = hseqs;
+ this.hiddencols = hcols;
+ this.hiddenRepSeqs = hRepSeqs;
}
}
}
}
@@
-152,7
+152,7
@@
public class AnnotationFile
}
if (list == null)
{
}
if (list == null)
{
- list = view.visibleGroups;
+ // list = view.visibleGroups;
}
if (cs == null)
{
}
if (cs == null)
{
@@
-537,7
+537,7
@@
public class AnnotationFile
return false;
}
return false;
}
- public void printGroups(List<SequenceGroup> list)
+ protected void printGroups(List<SequenceGroup> list)
{
SequenceI seqrep = null;
for (SequenceGroup sg : list)
{
SequenceI seqrep = null;
for (SequenceGroup sg : list)
@@
-583,7
+583,8
@@
public class AnnotationFile
if (sg.cs != null)
{
text.append("colour=");
if (sg.cs != null)
{
text.append("colour=");
- text.append(sg.cs.toString());
+ text.append(ColourSchemeProperty.getColourName(sg.cs
+ .getColourScheme()));
text.append("\t");
if (sg.cs.getThreshold() != 0)
{
text.append("\t");
if (sg.cs.getThreshold() != 0)
{
@@
-1430,7
+1431,7
@@
public class AnnotationFile
value = Float.valueOf(nextToken);
} catch (NumberFormatException e)
{
value = Float.valueOf(nextToken);
} catch (NumberFormatException e)
{
- System.err.println("Threshold '" + nextToken
+ System.err.println("line " + nlinesread + ": Threshold '" + nextToken
+ "' invalid, setting to zero");
}
String label = st.hasMoreTokens() ? st.nextToken() : null;
+ "' invalid, setting to zero");
}
String label = st.hasMoreTokens() ? st.nextToken() : null;
@@
-1610,8
+1611,7
@@
public class AnnotationFile
if (sg != null)
{
String keyValue, key, value;
if (sg != null)
{
String keyValue, key, value;
- ColourSchemeI def = sg.cs;
- sg.cs = null;
+ ColourSchemeI def = sg.getColourScheme();
while (st.hasMoreTokens())
{
keyValue = st.nextToken();
while (st.hasMoreTokens())
{
keyValue = st.nextToken();
@@
-1624,7
+1624,8
@@
public class AnnotationFile
}
else if (key.equalsIgnoreCase("colour"))
{
}
else if (key.equalsIgnoreCase("colour"))
{
- sg.cs = ColourSchemeProperty.getColour(al, value);
+ sg.cs.setColourScheme(ColourSchemeProperty
+ .getColourScheme(al, value));
}
else if (key.equalsIgnoreCase("pidThreshold"))
{
}
else if (key.equalsIgnoreCase("pidThreshold"))
{
@@
-1677,9
+1678,8
@@
public class AnnotationFile
}
else if (key.equalsIgnoreCase("idColour"))
{
}
else if (key.equalsIgnoreCase("idColour"))
{
- // consider warning if colour doesn't resolve to a real colour
- def = new UserColourScheme(value);
- sg.setIdColour(def.findColour());
+ Color idColour = ColorUtils.parseColourString(value);
+ sg.setIdColour(idColour == null ? Color.black : idColour);
}
else if (key.equalsIgnoreCase("hide"))
{
}
else if (key.equalsIgnoreCase("hide"))
{
@@
-1693,9
+1693,9
@@
public class AnnotationFile
}
sg.recalcConservation();
}
}
sg.recalcConservation();
}
- if (sg.cs == null)
+ if (sg.getColourScheme() == null)
{
{
- sg.cs = def;
+ sg.setColourScheme(def);
}
}
}
}
}
}