Map<Object, Rectangle> nameHash = new Hashtable<>();
- Map<SequenceNode, Rectangle> nodeHash = new Hashtable<>();
+ Map<BinaryNode, Rectangle> nodeHash = new Hashtable<>();
- SequenceNode highlightNode;
+ BinaryNode highlightNode;
boolean applyToAllViews = false;
tree.findHeight(tree.getTopNode());
// Now have to calculate longest name based on the leaves
- Vector<SequenceNode> leaves = tree.findLeaves(tree.getTopNode());
+ Vector<BinaryNode> leaves = tree.findLeaves(tree.getTopNode());
boolean has_placeholders = false;
longestName = "";
for (int i = 0; i < leaves.size(); i++)
{
- SequenceNode lf = leaves.elementAt(i);
+ BinaryNode lf = leaves.elementAt(i);
- if (lf.isPlaceholder())
+ if (lf instanceof SequenceNode && ((SequenceNode)lf).isPlaceholder())
{
has_placeholders = true;
}
* @param offy
* DOCUMENT ME!
*/
- public void drawNode(Graphics g, SequenceNode node, float chunk,
+ public void drawNode(Graphics g, BinaryNode node, float chunk,
double wscale, int width, int offx, int offy)
{
if (node == null)
g.drawString(nodeLabel, xstart + 2, ypos - 2);
}
- String name = (markPlaceholders && node.isPlaceholder())
+ String name = (markPlaceholders && ((node instanceof SequenceNode && ((SequenceNode)node).isPlaceholder())))
? (PLACEHOLDER + node.getName())
: node.getName();
}
else
{
- drawNode(g, (SequenceNode) node.left(), chunk, wscale, width, offx,
+ drawNode(g, (BinaryNode) node.left(), chunk, wscale, width, offx,
offy);
- drawNode(g, (SequenceNode) node.right(), chunk, wscale, width, offx,
+ drawNode(g, (BinaryNode) node.right(), chunk, wscale, width, offx,
offy);
double height = node.height;
}
}
- for (Entry<SequenceNode, Rectangle> entry : nodeHash.entrySet())
+ for (Entry<BinaryNode, Rectangle> entry : nodeHash.entrySet())
{
Rectangle rect = entry.getValue();
}
else
{
- Vector<SequenceNode> leaves = tree.findLeaves(highlightNode);
+ Vector<BinaryNode> leaves = tree.findLeaves(highlightNode);
for (int i = 0; i < leaves.size(); i++)
{
Object ob = findElement(evt.getX(), evt.getY());
- if (ob instanceof SequenceNode)
+ if (ob instanceof BinaryNode)
{
- highlightNode = (SequenceNode) ob;
+ highlightNode = (BinaryNode) ob;
this.setToolTipText(
"<html>" + MessageManager.getString("label.highlightnode"));
repaint();
av.sendSelection();
return;
}
- else if (!(ob instanceof SequenceNode))
+ else if (!(ob instanceof BinaryNode))
{
// Find threshold
if (tree.getMaxHeight() != 0)
threshold = (float) (x - offx)
/ (float) (getWidth() - labelLength - (2 * offx));
- List<SequenceNode> groups = tree.groupNodes(threshold);
+ List<BinaryNode> groups = tree.groupNodes(threshold);
setColor(tree.getTopNode(), Color.black);
AlignmentPanel[] aps = getAssociatedPanels();
}
- void colourGroups(List<SequenceNode> groups)
+ void colourGroups(List<BinaryNode> groups)
{
AlignmentPanel[] aps = getAssociatedPanels();
for (int i = 0; i < groups.size(); i++)
(int) (Math.random() * 255), (int) (Math.random() * 255));
setColor(groups.get(i), col.brighter());
- Vector<SequenceNode> l = tree.findLeaves(groups.get(i));
+ Vector<BinaryNode> l = tree.findLeaves(groups.get(i));
Vector<SequenceI> sequences = new Vector<>();