Skip to content
Snippets Groups Projects
Commit cf3ecd2a authored by tcarver's avatar tcarver
Browse files

optionally read labels from header of base position plots

parent f7203b97
No related branches found
No related tags found
No related merge requests found
......@@ -579,7 +579,8 @@ public class UserDataAlgorithm extends BaseAlgorithm
while ((line = reader.readLine()) != null)
{
if((line.indexOf("colour") == -1 &&
line.indexOf("color") == -1 ) ||
line.indexOf("color") == -1 &&
line.indexOf("label ") == -1) ||
line.startsWith("track"))
{
if(line.startsWith("track "))
......@@ -591,17 +592,31 @@ public class UserDataAlgorithm extends BaseAlgorithm
continue;
}
int index = line.indexOf("colour");
if (index == -1)
index = line.indexOf("color");
int idx = line.indexOf("colour");
if (idx == -1)
idx = line.indexOf("color");
index = line.indexOf(" ", index + 1);
line = line.substring(index).trim();
String rgbValues[] = line.split(" ");
if (idx != -1)
{
idx = line.indexOf(" ", idx + 1);
line = line.substring(idx).trim();
String rgbValues[] = line.split(" ");
lines = new LineAttributes[rgbValues.length];
for (int j = 0; j < rgbValues.length; j++)
lines[j] = new LineAttributes(LineAttributes.parse(rgbValues[j]));
lines = new LineAttributes[rgbValues.length];
for (int j = 0; j < rgbValues.length; j++)
lines[j] = new LineAttributes(LineAttributes.parse(rgbValues[j]));
}
else if(lines != null)
{
idx = line.indexOf("label ");
if (idx != -1)
{
line = line.substring(idx+6).trim();
String labels[] = line.split(" ");
for (int j = 0; j < labels.length; j++)
lines[j].setLabel(labels[j]);
}
}
}
}
catch (NumberFormatException e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment