package interactivefeaturelocator.model;

import interactivefeaturelocator.views.GUIUtil;

import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.zest.core.widgets.GraphNode;
import org.eclipse.zest.core.widgets.IContainer;
import org.ntlab.trace.MethodExecution;

public class CallTreeGraphNode extends GraphNode {
	private boolean current = false;
	private boolean focus = false;

	public CallTreeGraphNode(IContainer graphModel, int style, String text) {
		super(graphModel, style, text);
		// TODO Auto-generated constructor stub
	}
	
	public CallTreeGraphNode(IContainer graphModel, int style, MethodExecution method) {
		super(graphModel, style, method.getMethodName(), method);
//		setSize(20.0, 5.0);
	}
		
	public void highlight() {
		this.focus = true;
		System.out.println(this.getSize().height() + ", " + this.getSize().width());
		GUIUtil.openEditor(this.getMethodExecution());
	}
	
	public MethodExecution getMethodExecution() {
		return (MethodExecution)this.getData();
	}
	
}
