using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections;
using System.Configuration.Assemblies;

using CategoryTheory;
using DiagramUI;

namespace DataPerformerUI
{
	public class ObjectPanel : System.Windows.Forms.Panel
	{
		private IObjectLabel theObject;
		public ObjectPanel(IObjectLabel theObject)
		{
			this.theObject = theObject;
			initialize();
		}
		

		/// <summary>
		/// Initialization
		/// </summary>
		private void initialize()
		{
			PictureBox box = new PictureBox();
			box.Left = 20;
			box.Top =  10;
			Image im = NamedComponent.GetImage(theObject);
			box.Width = im.Width;
			box.Height = im.Height;
			box.Image = im;
			Controls.Add(box);
			Label label = new Label();
			label.Top = box.Top;
			label.Left = box.Left + box.Width + 20;
			label.Text = theObject.RootName;//NamedComponent.GetText(theObject);
			Controls.Add(label);
			Name = label.Text + "";
			Height = box.Top + box.Height + 20;
		}
	}
}
