features = sq.getFeatures()
.getPositionalFeatures(labelClass);
for (SequenceFeature feature : features)
{
if (newname == null)
{
newname = feature.getDescription();
}
else
{
newname = newname + "; " + feature.getDescription();
}
}
}
}
if (newname != null)
{
// String oldname = ((SequenceNode) node).getName();
// TODO : save oldname in the undo object for this modification.
((SequenceNode) node).setName(newname);
}
}
}
});
}
/**
* Formats a localised title for the tree panel, like
*
* Neighbour Joining Using BLOSUM62
*
* For a tree loaded from file, just uses the file name
*
* @return
*/
public String getPanelTitle()
{
if (treeTitle != null)
{
return treeTitle;
}
/*
* i18n description of Neighbour Joining or Average Distance method
*/
String treecalcnm = MessageManager
.getString("label.tree_calc_" + treeType.toLowerCase());
/*
* short score model name (long description can be too long)
*/
String smn = scoreModelName;
/*
* put them together as Using
*/
final String ttl = MessageManager.formatMessage("label.calc_title",
treecalcnm, smn);
return ttl;
}
/**
* Builds an EPS image and writes it to the specified file.
*
* @param outFile
* @param textOption
* true for Text character rendering, false for Lineart
*/
protected void writeEpsFile(File outFile, boolean textOption)
{
try
{
int width = treeCanvas.getWidth();
int height = treeCanvas.getHeight();
FileOutputStream out = new FileOutputStream(
outFile);
EpsGraphics2D pg = new EpsGraphics2D("Tree", out, 0, 0, width,
height);
pg.setAccurateTextMode(!textOption);
treeCanvas.draw(pg, width, height);
pg.flush();
pg.close();
} catch (Exception ex)
{
System.err.println("Error writing tree as EPS");
ex.printStackTrace();
}
}
public AlignViewport getViewport()
{
return av;
}
public void setViewport(AlignViewport av)
{
this.av = av;
}
public TreeCanvas getTreeCanvas()
{
return treeCanvas;
}
}