public static void RepertoryImage(Graphics drawDestination, MscStyle style) { StringFormat itemStringFormat = new StringFormat(); RectangleF itemBox = new RectangleF(10, 20, 60, 20); float[] pattern = {4f,4f}; Pen rPen = new Pen(Color.Black); rPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom; rPen.DashPattern = pattern; itemStringFormat.Alignment = StringAlignment.Center; itemStringFormat.LineAlignment = StringAlignment.Center; drawDestination.DrawLine(Pens.LightGray,10,10,10,70); drawDestination.DrawLine(Pens.LightGray,55,50,55,70); drawDestination.DrawLine(Pens.Black,10,45,40,45); if (style==MscStyle.SDL){ PointF[] messagePolygon = new PointF[3]; messagePolygon[0] = new PointF(40, 45); messagePolygon[1] = new PointF(40-8, 45-4); messagePolygon[2] = new PointF(40-8, 45+4); drawDestination.FillPolygon(Brushes.Black,messagePolygon); } else if (style==MscStyle.UML2){ drawDestination.DrawLine(Pens.Black,40, 45,40-8, 45-4); drawDestination.DrawLine(Pens.Black,40, 45,40-8, 45+4); } drawDestination.DrawRectangle(Pens.Black, 40,40,30,10); drawDestination.DrawString("Create",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); rPen.Dispose(); itemStringFormat.Dispose(); }
public static void RepertoryImage(Graphics drawDestination, MessageStyle style, MscStyle style2) { StringFormat itemStringFormat = new StringFormat(); RectangleF itemBox = new RectangleF(10, 28, 60, 15); Pen pen = new Pen(Color.Black); float[] pattern = {3f,3f}; itemStringFormat.Alignment = StringAlignment.Center; drawDestination.DrawString("Message",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); drawDestination.DrawLine(Pens.DarkGray,5,10,5,70); drawDestination.DrawLine(Pens.DarkGray,75,10,75,70); if (style2 == MscStyle.SDL){ if((style == MessageStyle.Normal)||(style == MessageStyle.Synchron)){ drawDestination.DrawLine(Pens.Black,5,40,75,40); PointF[] messagePolygon = new PointF[3]; messagePolygon[0] = new PointF(5, 40); messagePolygon[1] = new PointF(5+8, 40-4); messagePolygon[2] = new PointF(5+8, 40+4); drawDestination.FillPolygon(Brushes.Black,messagePolygon); } else if (style == MessageStyle.Dashed){ pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom; pen.DashPattern = pattern; drawDestination.DrawLine(pen,5,40,75,40); PointF[] messagePolygon = new PointF[3]; messagePolygon[0] = new PointF(5, 40); messagePolygon[1] = new PointF(5+8, 40-4); messagePolygon[2] = new PointF(5+8, 40+4); drawDestination.FillPolygon(Brushes.Black,messagePolygon); pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; } } else if(style2 == MscStyle.UML2){ if( style == MessageStyle.Normal){ drawDestination.DrawLine(Pens.Black,5,40,75,40); drawDestination.DrawLine(Pens.Black,5,40,5+8, 40-4); drawDestination.DrawLine(Pens.Black,5,40,5+8, 40+4); } else if( style == MessageStyle.Dashed){ pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom; pen.DashPattern = pattern; drawDestination.DrawLine(pen,5,40,75,40); pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; drawDestination.DrawLine(Pens.Black,5,40,5+8, 40-4); drawDestination.DrawLine(Pens.Black,5,40,5+8, 40+4); } else if( style == MessageStyle.Synchron){ drawDestination.DrawLine(Pens.Black,5,40,75,40); PointF[] messagePolygon = new PointF[3]; messagePolygon[0] = new PointF(5, 40); messagePolygon[1] = new PointF(5+8, 40-4); messagePolygon[2] = new PointF(5+8, 40+4); drawDestination.FillPolygon(Brushes.Black,messagePolygon); } } pen.Dispose(); itemStringFormat.Dispose(); }
public static void RepertoryImage(Graphics drawDestination, StateStyle style, MscStyle style2) { StringFormat itemStringFormat = new StringFormat(); RectangleF itemBox = new RectangleF(15, 30, 50, 20); itemStringFormat.Alignment = StringAlignment.Center; itemStringFormat.LineAlignment = StringAlignment.Center; drawDestination.DrawLine(Pens.DarkGray,40,10,40,70); if (style2 == MscStyle.SDL){ if (style == StateStyle.Box){ PointF[] statePolygon = new PointF[6]; statePolygon[0] = new PointF(5,40); statePolygon[1] = new PointF(15,30); statePolygon[2] = new PointF(65,30); statePolygon[3] = new PointF(75,40); statePolygon[4] = new PointF(65,50); statePolygon[5] = new PointF(15,50); drawDestination.FillPolygon(Brushes.White,statePolygon); drawDestination.DrawString("State",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); drawDestination.DrawPolygon(Pens.Black,statePolygon); } else if(style == StateStyle.Bracket){ drawDestination.FillRectangle(Brushes.White,itemBox); drawDestination.DrawString("{State}",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } else if(style2 == MscStyle.UML2){ if (style == StateStyle.Box){ drawDestination.FillRectangle(Brushes.White,itemBox); drawDestination.FillEllipse(Brushes.White,5,30,20,20); drawDestination.FillEllipse(Brushes.White,55,30,20,20); drawDestination.DrawLine(Pens.Black,15,30,65,30); drawDestination.DrawLine(Pens.Black,15,50,65,50); drawDestination.DrawArc(Pens.Black,5,30,20,20,90,180); drawDestination.DrawArc(Pens.Black,55,30,20,20,270,180); drawDestination.DrawString("State",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == StateStyle.Bracket){ drawDestination.FillRectangle(Brushes.White,itemBox); drawDestination.DrawString("{State}",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } itemStringFormat.Dispose(); }
public static void RepertoryImage(Graphics drawDestination, ProcessStyle style, MscStyle style2) { float[] pattern = new float[2]{5f,5f}; Pen pen = new Pen(Color.Black); drawDestination.DrawLine(Pens.DarkGray,40,10,40,20); drawDestination.DrawLine(Pens.DarkGray,40,60,40,70); drawDestination.DrawLine(Pens.Black,35,20,45,20); drawDestination.DrawLine(Pens.Black,35,60,45,60); switch(style){ case ProcessStyle.Activation: drawDestination.FillRectangle(Brushes.DarkGray,35, 20, 10, 40); drawDestination.DrawLine(Pens.Black,35,20, 35,60); drawDestination.DrawLine(Pens.Black,45,20, 45,60); break; case ProcessStyle.Suspension: pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom; pen.DashPattern = pattern; drawDestination.DrawLine(pen,35,20, 35,60); drawDestination.DrawLine(pen,45,20, 45,60); pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; break; case ProcessStyle.Coregion: pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Custom; pen.DashPattern = pattern; drawDestination.DrawLine(pen,40,20, 40,60); if (style2 == MscStyle.UML2){ drawDestination.DrawLine(Pens.Black,35,20, 35,25); drawDestination.DrawLine(Pens.Black,45,20, 45,25); drawDestination.DrawLine(Pens.Black,35,60, 35,55); drawDestination.DrawLine(Pens.Black,45,60, 45,55); } pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; break; } drawDestination.DrawLine(Pens.Black,35,20,45,20); drawDestination.DrawLine(Pens.Black,35,60,45,60); pen.Dispose(); }
public virtual void DiagramStyleChanged(MscStyle newStyle) { if(newStyle == MscStyle.SDL){ this.optStyleSDL.Checked = true; } else if (newStyle == MscStyle.UML2){ this.optStyleUML.Checked = true; } }
public override void DiagramStyleChanged(MscStyle newStyle) { base.DiagramStyleChanged(newStyle); DrawPropertyImage(); }
public override void DiagramStyleChanged(MscStyle newStyle) { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MessageBeginProp)); ResourceManager strings = new ResourceManager ("nGenerator.strings", Assembly.GetAssembly(typeof(MessageBeginProp))); base.DiagramStyleChanged(newStyle); if (newStyle == MscStyle.SDL){ this.optType1.Text = strings.GetString("Message"); this.optType2.Text = resources.GetString("optType2.Text"); if(this.optType3.Checked == true) this.optType1.Checked = true; this.optType3.Visible = false; } else if (newStyle == MscStyle.UML2){ this.optType1.Text = resources.GetString("optType1.Text"); this.optType2.Text = resources.GetString("optType2.Text"); this.optType3.Text = resources.GetString("optType3.Text"); this.optType3.Visible = true; } DrawPropertyImage(); }
public static void RepertoryImage(Graphics drawDestination, MessagePos pos, MscStyle style) { StringFormat itemStringFormat = new StringFormat(); if (style == MscStyle.SDL){ if (pos == MessagePos.Right){ RectangleF itemBox = new RectangleF(10, 30, 42, 10); RectangleF itemBox2 = new RectangleF(60, 48, 10, 10); itemStringFormat.Alignment = StringAlignment.Center; itemStringFormat.LineAlignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,10,10,10,70); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(60, 40); capPolygon[1] = new PointF(52, 44); capPolygon[2] = new PointF(52, 36); drawDestination.FillPolygon(Brushes.Black,capPolygon); drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat); drawDestination.DrawLine(Pens.Black,10, 40, 60,40); drawDestination.FillEllipse(Brushes.Black, new RectangleF(60,35, 10,10)); } else { RectangleF itemBox = new RectangleF(28, 30, 42, 10); RectangleF itemBox2 = new RectangleF(10, 48, 10, 10); itemStringFormat.Alignment = StringAlignment.Center; itemStringFormat.LineAlignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,70,10,70,70); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(20, 40); capPolygon[1] = new PointF(28, 44); capPolygon[2] = new PointF(28, 36); drawDestination.FillPolygon(Brushes.Black,capPolygon); drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat); drawDestination.DrawLine(Pens.Black,20, 40, 70,40); drawDestination.FillEllipse(Brushes.Black, new RectangleF(10,35, 10,10)); } } else if(style == MscStyle.UML2){ if (pos == MessagePos.Right){ RectangleF itemBox = new RectangleF(10, 30, 42, 10); RectangleF itemBox2 = new RectangleF(60, 48, 10, 10); itemStringFormat.Alignment = StringAlignment.Center; itemStringFormat.LineAlignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,10,10,10,70); drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat); drawDestination.DrawLine(Pens.Black,10, 40, 60, 40); drawDestination.DrawLine(Pens.Black,60, 40, 52, 43); drawDestination.DrawLine(Pens.Black,60, 40, 52, 37); drawDestination.FillEllipse(Brushes.Black, new RectangleF(60,35, 10,10)); } else{ RectangleF itemBox = new RectangleF(28, 30, 42, 10); RectangleF itemBox2 = new RectangleF(10, 48, 10, 10); itemStringFormat.Alignment = StringAlignment.Center; itemStringFormat.LineAlignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,70,10,70,70); drawDestination.DrawString("Lost",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); drawDestination.DrawString("g",new Font("Arial",8),Brushes.Black,itemBox2,itemStringFormat); drawDestination.DrawLine(Pens.Black,20, 40, 28, 43); drawDestination.DrawLine(Pens.Black,20, 40, 28, 37); drawDestination.DrawLine(Pens.Black,20, 40, 70,40); drawDestination.FillEllipse(Brushes.Black, new RectangleF(10,35, 10,10)); } } itemStringFormat.Dispose(); }
public static void RepertoryImage(Graphics drawDestination, ItemPos pos, ItemStyle style, MscStyle style2) { StringFormat itemStringFormat = new StringFormat(); if (style2 == MscStyle.UML2){ if (pos == ItemPos.Left){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(10,27,65,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,70,20,85,20); drawDestination.DrawLine(Pens.Black,75,20,75,70); drawDestination.DrawLine(Pens.Black,75,21,72,27); drawDestination.DrawLine(Pens.Black,75,21,78,27); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(0,27,35,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,30,20,85,20); drawDestination.DrawLine(Pens.Black,35,20,35,70); drawDestination.DrawLine(Pens.Black,35,21,32,27); drawDestination.DrawLine(Pens.Black,35,21,38,27); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(36,27,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,30,20,85,20); drawDestination.DrawLine(Pens.Black,35,20,35,70); drawDestination.DrawLine(Pens.Black,35,21,32,27); drawDestination.DrawLine(Pens.Black,35,21,38,27); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } else if (pos == ItemPos.Right){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(25,27,65,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,20,30,20); drawDestination.DrawLine(Pens.Black,25,20,25,70); drawDestination.DrawLine(Pens.Black,25,21,22,27); drawDestination.DrawLine(Pens.Black,25,21,28,27); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(65,27,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,20,70,20); drawDestination.DrawLine(Pens.Black,65,20,65,70); drawDestination.DrawLine(Pens.Black,65,21,62,27); drawDestination.DrawLine(Pens.Black,65,21,68,27); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(0,27,65,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,20,70,20); drawDestination.DrawLine(Pens.Black,65,20,65,70); drawDestination.DrawLine(Pens.Black,65,21,62,27); drawDestination.DrawLine(Pens.Black,65,21,68,27); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } } else if (style2 == MscStyle.SDL){ if (pos == ItemPos.Left){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(20,12,65,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,75,30,85,30); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(75, 30); capPolygon[1] = new PointF(80, 25); capPolygon[2] = new PointF(70, 25); drawDestination.DrawPolygon(Pens.Black,capPolygon); capPolygon[0] = new PointF(75, 30); capPolygon[1] = new PointF(80, 35); capPolygon[2] = new PointF(70, 35); drawDestination.DrawPolygon(Pens.Black,capPolygon); drawDestination.DrawLine(Pens.Black,75,35,75,70); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(5,12,35,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,35,30,85,30); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(35, 30); capPolygon[1] = new PointF(40, 25); capPolygon[2] = new PointF(30, 25); drawDestination.DrawPolygon(Pens.Black,capPolygon); capPolygon[0] = new PointF(35, 30); capPolygon[1] = new PointF(40, 35); capPolygon[2] = new PointF(30, 35); drawDestination.DrawPolygon(Pens.Black,capPolygon); drawDestination.DrawLine(Pens.Black,35,35,35,70); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(35,12,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,35,30,85,30); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(35, 30); capPolygon[1] = new PointF(40, 25); capPolygon[2] = new PointF(30, 25); drawDestination.DrawPolygon(Pens.Black,capPolygon); capPolygon[0] = new PointF(35, 30); capPolygon[1] = new PointF(40, 35); capPolygon[2] = new PointF(30, 35); drawDestination.DrawPolygon(Pens.Black,capPolygon); drawDestination.DrawLine(Pens.Black,35,35,35,70); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } else if (pos == ItemPos.Right){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(16,12,65,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,30,25,30); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(25, 30); capPolygon[1] = new PointF(30, 25); capPolygon[2] = new PointF(20, 25); drawDestination.DrawPolygon(Pens.Black,capPolygon); capPolygon[0] = new PointF(25, 30); capPolygon[1] = new PointF(30, 35); capPolygon[2] = new PointF(20, 35); drawDestination.DrawPolygon(Pens.Black,capPolygon); drawDestination.DrawLine(Pens.Black,25,35,25,70); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(65,12,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,30,65,30); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(65, 30); capPolygon[1] = new PointF(70, 25); capPolygon[2] = new PointF(60, 25); drawDestination.DrawPolygon(Pens.Black,capPolygon); capPolygon[0] = new PointF(65, 30); capPolygon[1] = new PointF(70, 35); capPolygon[2] = new PointF(60, 35); drawDestination.DrawPolygon(Pens.Black,capPolygon); drawDestination.DrawLine(Pens.Black,65,35,65,70); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(15,12,50,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,30,65,30); PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(65, 30); capPolygon[1] = new PointF(70, 25); capPolygon[2] = new PointF(60, 25); drawDestination.DrawPolygon(Pens.Black,capPolygon); capPolygon[0] = new PointF(65, 30); capPolygon[1] = new PointF(70, 35); capPolygon[2] = new PointF(60, 35); drawDestination.DrawPolygon(Pens.Black,capPolygon); drawDestination.DrawLine(Pens.Black,65,35,65,70); drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } } itemStringFormat.Dispose(); }
public void AddRepertory() { if (oldRepertoryStyle == MSCItem.Style) return; // dont redraw if style not changed oldRepertoryStyle = MSCItem.Style; Image mscRepertoryImage = new Bitmap(80, 80); Graphics g = Graphics.FromImage(mscRepertoryImage); this.lstRepertory.Items.Clear(); // clear old image list this.lstRepertory.Width = 245; repertory.Clear(); // clear list of old image list pictures g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.ProcessLine.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.ProcessLine.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.ProcessLine.RepertoryImageActor(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.ProcessLine.RepertoryTextActor))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.Message.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.Message.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); State.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.State.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.Task.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.Task.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); // g.Clear(Color.LightYellow); // g.DrawRectangle(Pens.Black,0,0,80,80); // mscElements.Comment.RepertoryImage(g); // repertory.Add(new RepertoryItem(mscRepertoryImage,new AddText(mscElements.Comment.RepertoryText))); // add image list picture to array list // this.lstRepertory.Items.Add(""); // add image list picture to image list // System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.Comment.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.Comment.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.FoundMessage.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.FoundMessage.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.InLineBeginn.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.InLineBeginn.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.InLineSeparator.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.InLineSeparator.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.InLineText.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.InLineText.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.LineComment.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.LineComment.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.LostMessage.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.LostMessage.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.MeasureBeginn.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.MeasureBeginn.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.MeasureStart.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.MeasureStart.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.MeasureStop.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.MeasureStop.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.Mark.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.Mark.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.ProcessCreate.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.ProcessCreate.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.ProcessStop.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.ProcessStop.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.Reference.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.Reference.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.SetTimer.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.SetTimer.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.StopTimer.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.StopTimer.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.TimeOut.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.TimeOut.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.TimerEnd.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.TimeoutEnd.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Clear(Color.LightYellow); g.DrawRectangle(Pens.Black, 0, 0, 80, 80); mscElements.ProcessRegion.RepertoryImage(g); repertory.Add(new RepertoryItem(mscRepertoryImage, new AddText(mscElements.ProcessRegion.RepertoryText))); // add image list picture to array list this.lstRepertory.Items.Add(""); // add image list picture to image list System.GC.Collect(); g.Dispose(); }
public void SetMscStyle(MscStyle newStyle) { generator.SetMscStyle(newStyle); AddRepertory(); if (OptionsDialog.ActiveDialog != null) { ((Property)OptionsDialog.ActiveDialog).DiagramStyleChanged(newStyle); } }
public void SetMscStyle(MscStyle newStyle) { generator.SetMscStyle(newStyle); }
public static void RepertoryImage(Graphics drawDestination, ItemPos pos, ItemStyle style, MscStyle style2, TimerStyle tStyle) { StringFormat itemStringFormat = new StringFormat(); if (style2 == MscStyle.UML2){ if (pos == ItemPos.Left){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(10,40,65,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,70,60,85,60); drawDestination.DrawLine(Pens.Black,75,10,75,60); if (tStyle == TimerStyle.End){ drawDestination.DrawLine(Pens.Black,75,59,72,53); drawDestination.DrawLine(Pens.Black,75,59,78,53); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,70,55,80,65); drawDestination.DrawLine(Pens.Black,70,65,80,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(0,40,35,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,30,60,85,60); drawDestination.DrawLine(Pens.Black,35,10,35,60); if (tStyle == TimerStyle.End){ drawDestination.DrawLine(Pens.Black,35,59,32,53); drawDestination.DrawLine(Pens.Black,35,59,38,53); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,30,55,40,65); drawDestination.DrawLine(Pens.Black,30,65,40,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(36,40,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,30,60,85,60); drawDestination.DrawLine(Pens.Black,35,10,35,60); if (tStyle == TimerStyle.End){ drawDestination.DrawLine(Pens.Black,35,59,32,53); drawDestination.DrawLine(Pens.Black,35,59,38,53); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,30,55,40,65); drawDestination.DrawLine(Pens.Black,30,65,40,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } else if (pos == ItemPos.Right){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(25,40,65,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,60,30,60); drawDestination.DrawLine(Pens.Black,25,10,25,60); if (tStyle == TimerStyle.End){ drawDestination.DrawLine(Pens.Black,25,59,22,53); drawDestination.DrawLine(Pens.Black,25,59,28,53); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,20,55,30,65); drawDestination.DrawLine(Pens.Black,20,65,30,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(65,40,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,60,70,60); drawDestination.DrawLine(Pens.Black,65,10,65,60); if (tStyle == TimerStyle.End){ drawDestination.DrawLine(Pens.Black,65,59,62,53); drawDestination.DrawLine(Pens.Black,65,59,68,53); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,60,55,70,65); drawDestination.DrawLine(Pens.Black,60,65,70,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(0,40,65,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,60,70,60); drawDestination.DrawLine(Pens.Black,65,10,65,60); if (tStyle == TimerStyle.End){ drawDestination.DrawLine(Pens.Black,65,59,62,53); drawDestination.DrawLine(Pens.Black,65,59,68,53); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,60,55,70,65); drawDestination.DrawLine(Pens.Black,60,65,70,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } } else if (style2 == MscStyle.SDL){ if (pos == ItemPos.Left){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(10,40,65,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,75,60,85,60); drawDestination.DrawLine(Pens.Black,75,10,75,60); if (tStyle == TimerStyle.End){ PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(85, 60); capPolygon[1] = new PointF(79, 57); capPolygon[2] = new PointF(79, 63); drawDestination.FillPolygon(Brushes.Black,capPolygon); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,70,55,80,65); drawDestination.DrawLine(Pens.Black,70,65,80,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(0,40,35,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,35,60,85,60); drawDestination.DrawLine(Pens.Black,35,10,35,60); if (tStyle == TimerStyle.End){ PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(85, 60); capPolygon[1] = new PointF(79, 57); capPolygon[2] = new PointF(79, 63); drawDestination.FillPolygon(Brushes.Black,capPolygon); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,30,55,40,65); drawDestination.DrawLine(Pens.Black,30,65,40,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(36,40,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,85,10,85,70); drawDestination.DrawLine(Pens.Black,35,60,85,60); drawDestination.DrawLine(Pens.Black,35,10,35,60); if (tStyle == TimerStyle.End){ PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(85, 60); capPolygon[1] = new PointF(79, 57); capPolygon[2] = new PointF(79, 63); drawDestination.FillPolygon(Brushes.Black,capPolygon); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,30,55,40,65); drawDestination.DrawLine(Pens.Black,30,65,40,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } else if (pos == ItemPos.Right){ if(style == ItemStyle.Normal){ RectangleF itemBox = new RectangleF(25,40,65,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,60,25,60); drawDestination.DrawLine(Pens.Black,25,10,25,60); if (tStyle == TimerStyle.End){ PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(15, 60); capPolygon[1] = new PointF(21, 57); capPolygon[2] = new PointF(21, 63); drawDestination.FillPolygon(Brushes.Black,capPolygon); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,20,55,30,65); drawDestination.DrawLine(Pens.Black,20,65,30,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedOuter){ RectangleF itemBox = new RectangleF(65,40,35,20); itemStringFormat.Alignment = StringAlignment.Near; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,60,65,60); drawDestination.DrawLine(Pens.Black,65,10,65,60); if (tStyle == TimerStyle.End){ PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(15, 60); capPolygon[1] = new PointF(21, 57); capPolygon[2] = new PointF(21, 63); drawDestination.FillPolygon(Brushes.Black,capPolygon); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,60,55,70,65); drawDestination.DrawLine(Pens.Black,60,65,70,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } else if(style == ItemStyle.ExtendedInner){ RectangleF itemBox = new RectangleF(0,40,65,20); itemStringFormat.Alignment = StringAlignment.Far; drawDestination.DrawLine(Pens.DarkGray,15,10,15,70); drawDestination.DrawLine(Pens.Black,15,60,65,60); drawDestination.DrawLine(Pens.Black,65,10,65,60); if (tStyle == TimerStyle.End){ PointF[] capPolygon = new PointF[3]; capPolygon[0] = new PointF(15, 60); capPolygon[1] = new PointF(21, 57); capPolygon[2] = new PointF(21, 63); drawDestination.FillPolygon(Brushes.Black,capPolygon); } else if (tStyle == TimerStyle.Break){ drawDestination.DrawLine(Pens.Black,60,55,70,65); drawDestination.DrawLine(Pens.Black,60,65,70,55); } drawDestination.DrawString("Timer",new Font("Arial",8),Brushes.Black,itemBox,itemStringFormat); } } } itemStringFormat.Dispose(); }
public InterpretResult SetMscStyle(MscStyle style) { MSCItem.Style = style; return InterpretResult.Ok; }