package pt.inm.smartgwt_tester.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.types.Cursor;
import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.drawing.DrawPane;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class SmartGWT_Tester implements EntryPoint {

	public void onModuleLoad() {

		Canvas canvas = new Canvas();
		canvas.setBackgroundColor("#D9D9D9");
		canvas.setHeight100();
		canvas.setWidth100();
		
		DrawPane drawPane = new DrawPane();
		drawPane.setHeight100();
		drawPane.setWidth100();
		drawPane.setShowEdges(true);
		drawPane.setEdgeSize(2);
		drawPane.setBackgroundColor("papayawhip");
		drawPane.setOverflow(Overflow.HIDDEN);
		drawPane.setCursor(Cursor.AUTO);
		
		Component c1 = new Component(300, 300, ComponentType.Start);
		Component c2 = new Component(200, 100, ComponentType.Action);
		Component c3 = new Component(100, 350, ComponentType.Action);
		
		canvas.addChild(c1);
		canvas.addChild(c2);
		canvas.addChild(c3);
		
		canvas.addChild(drawPane);
		
		Edge e1 = new Edge(drawPane, c1, c2);
		Edge e2 = new Edge(drawPane, c1, c3);
		
		canvas.draw();
	}

}
