protected void CreateClassHier( int x, int y, int w, int h) { MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h); //clip.Object = chain; // Back rectangle clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h); // Dots MovieClip dots = clip.CreateSubMovieClip(74, 0, w, h); //dots.Graphics.FillRectangle( Brushes.Wheat, 0, 0, w/4, h ); for (int d = 0; d < 7; d++) { // extra spacing in between disconnected chains? MovieClip dot = dots.CreateSubMovieClip(0, 0, 6, 6); if (d > 1) { dot.Graphics.DrawEllipse(Pens.LightGreen, 0, 0, 5, 5); } else { dot.Graphics.FillEllipse(Brushes.LightGreen, 0, 0, 5, 5); } } Space(2, 5, dots.Children, dots.Width); // Text MovieClip text = clip.CreateSubMovieClip(0, 0, w, h); //text.LeftString( "string name (31): +(17) .Split(\",\")(14)", Brushes.White); //text.LeftString( "string name (31): +(17) .Split(\",\")(14)", Brushes.White); text.LeftString("CalculateTaxes( , , , , , , )", Brushes.White); }
protected void RefusedBequest(int x, int y, int w, int h) { MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h); //clip.Object = chain; // Back rectangle clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h); // Dots Pen p = new Pen(Brushes.LightBlue, 3); Pen b = new Pen(Brushes.LightCoral, 3); int l = 10; for (int d = 0; d < 18; d++) { MovieClip dot = clip.CreateSubMovieClip(0, 0, l, 6); if (d % 4 == 0) { dot.Graphics.DrawLine(p, 0, 0, l - 1, 0); } else { dot.Graphics.DrawLine(b, 0, 0, l - 1, 0); } } Space(10, 18, 10, 2, clip.Children, w); clip.LeftString("StorageDB", Brushes.White); }
protected void DrawSessionGraph(MovieClip sessions, int w, int h) { MovieClip sessionBar = sessions.CreateSubMovieClip(0, h / 3, w, h - (h / 3)); // Date MovieClip dateBar = sessionBar.CreateSubMovieClip(0, sessionBar.Height / 2, w, sessionBar.Height / 2); MovieClip dateFront = dateBar.CreateSubMovieClip(0, 0, dateBar.Width / 2, dateBar.Height); dateFront.LeftString("10/10/05", Brushes.White); MovieClip dateEnd = dateBar.CreateSubMovieClip(dateBar.Width / 2, 0, dateBar.Width / 2, dateBar.Height); dateEnd.AlignedString("12/03/05", Brushes.White, StringAlignment.Far); //dateBar.Graphics.DrawRectangle(Pens.Sienna, 0, 0, dateBar.Width-1, dateBar.Height-1 ); //sessionBar.Graphics.DrawRectangle( Pens.Sienna, 0, 0, sessionBar.Width -1 , sessionBar.Height - 1); Pen wideGray = new Pen(Brushes.Gray, 2); sessionBar.Graphics.DrawLine(wideGray, 0, sessionBar.Height / 2, sessionBar.Width, sessionBar.Height / 2); wideGray.Dispose(); MovieClip sessionThumbs = sessionBar.CreateSubMovieClip(0, 0, sessionBar.Width, sessionBar.Height); for (int sIndex = 0; sIndex < 5; sIndex++) { MovieClip session = sessionThumbs.CreateSubMovieClip(0, 0, 10, 10); session.Graphics.FillRectangle(Brushes.Yellow, 0, 0, 9, 9); } Space(3, 2, sessionThumbs.Children, sessionThumbs.Width); MovieClip xx = sessionThumbs.Children[3]; xx.X += 30; }
protected void CreateMethodClip(MessageChainComponent chain, int x, int y, int w, int h) { MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h); clip.Object = chain; // Back rectangle clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h); // Dots MovieClip dots = clip.CreateSubMovieClip(0, 0, w / 4, h); //dots.Graphics.FillRectangle( Brushes.Wheat, 0, 0, w/4, h ); for (int d = 0; d < chain.Length; d++) { // extra spacing in between disconnected chains? MovieClip dot = dots.CreateSubMovieClip(0, 0, 10, 10); dot.Graphics.FillEllipse(Brushes.LightGreen, 0, 0, 9, 9); } Space(3, 3, dots.Children, dots.Width); // Text MovieClip text = clip.CreateSubMovieClip(dots.Width, 0, w - dots.Width, h); text.LeftString("(" + chain.Count + ") " + chain.MessageChain, Brushes.White); }
protected void CreateInInt(int x, int y, int w, int h) { MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h); //clip.Object = chain; // Back rectangle clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h); // Dots MovieClip dots = clip.CreateSubMovieClip(w / 2, 0, w, h / 2); MovieClip uptext = clip.CreateSubMovieClip(0, 0, w / 2, h / 2); for (int d = 0; d < 5; d++) { MovieClip dot = dots.CreateSubMovieClip(0, 0, 6, 6); dot.Graphics.FillEllipse(Brushes.LightBlue, 0, 0, 5, 5); } MovieClip others = clip.CreateSubMovieClip(w / 2, h / 2, w, h / 2); MovieClip downtext = clip.CreateSubMovieClip(0, h / 2, w / 2, h / 2); for (int d = 0; d < 7; d++) { MovieClip dot = others.CreateSubMovieClip(0, 0, 6, 6); dot.Graphics.FillEllipse(Brushes.LightGreen, 0, 0, 5, 5); } LineTo(clip, 1, 0, w, h, Pens.White); LineTo(clip, 0, 2, w, h, Pens.Yellow); LineTo(clip, 1, 3, w, h, Pens.White); LineTo(clip, 2, 3, w, h, Pens.White); LineTo(clip, 0, 6, w, h, Pens.Yellow); LineTo(clip, 2, 2, w, h, Pens.White); LineTo(clip, 3, 5, w, h, Pens.White); LineTo(clip, 4, 1, w, h, Pens.Yellow); LineTo(clip, 3, 4, w, h, Pens.White); LineTo(clip, 4, 2, w, h, Pens.White); Space(3, 3, dots.Children, dots.Width); Space(3, 3, others.Children, others.Width); uptext.LeftString("TreeView", Brushes.White); downtext.LeftString("TreeNode", Brushes.White); }
protected void CreateClassHier(MovieClip parent, string pre, string[] baseCls, int x, int y, int w, int h) { MovieClip clip = parent.CreateSubMovieClip(x, y, w, h); //clip.Object = chain; // Back rectangle clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h); // Parent Class MovieClip par = clip.CreateSubMovieClip(0, 0, w, h / 2); MovieClip dot = par.CreateSubMovieClip(w / 2, h / 4, 10, 10); dot.Graphics.FillEllipse(Brushes.White, 0, 0, 9, 9); par.LeftString(pre, Brushes.White); // Children MovieClip dots = clip.CreateSubMovieClip(0, h / 2, w, h / 2); //dots.Graphics.FillRectangle( Brushes.Wheat, 0, 0, w/4, h ); int centerHack = 29; Brush[] brushes = new Brush[] { Brushes.LightGreen, Brushes.LightBlue, Brushes.LightPink }; for (int d = 0; d < baseCls.Length; d++) { // extra spacing in between disconnected chains? MovieClip dd = dots.CreateSubMovieClip(0, 0, 10, 10); dd.Graphics.FillEllipse(brushes[d], 0, 0, 9, 9); clip.Graphics.DrawLine(Pens.White, w / 2 + 4, h / 4 + 3, (centerHack - 2) + ((1 + d) * 10), h / 2 + 5); } Space(centerHack, 3, 3, 3, dots.Children, dots.Width); // Text //MovieClip text = clip.CreateSubMovieClip( dots.Width, 0, w - dots.Width, h ); //text.LeftString( "(" + chain.Count +") " + chain.MessageChain, Brushes.White); }
protected void CreateMethodClip(SwitchStatementComponent swtch, int x, int y, int w, int h) { MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h); clip.Object = swtch.MethodComponent; // Back rectangle clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h); // Dots MovieClip dots = clip.CreateSubMovieClip((3 * w) / 4, 0, w / 4, h); dots.Object = swtch.MethodComponent; for (int d = 0; d < swtch.CaseCount; d++) { // extra spacing in between disconnected chains? MovieClip dot = dots.CreateSubMovieClip(0, 0, 4, 4); dot.Graphics.FillEllipse(Brushes.Yellow, 0, 0, 3, 3); } Space(2, 2, dots.Children, dots.Width); // Text clip.LeftString(swtch.Name + " (" + swtch.Count + ")", Brushes.White); }
protected void DoGraphics(ArrayList chains) { m_panelClip.Graphics.FillRectangle(Brushes.Black, m_panelClip.Rect); int w = 350; int h = 50; m_backBrush = new SolidBrush(Color.FromArgb(60, 60, 60)); string[] prefix = new string[] { "LongMethod", "TemporaryField", "MessageChains" }; string[] baseCls = new string[] { "Detector", "Visualization", "Component", "Comparer" }; int i = 0; MovieClip clip = m_panelClip.CreateSubMovieClip(0, 0, w, h); foreach (string bass in baseCls) { CreateClassHier(clip, bass, prefix, 0, 0, w / 4, h); i++; } MovieClip legend = clip.CreateSubMovieClip((3 * w) / 4, 0, w / 4, h); Brush[] brushes = new Brush[] { Brushes.LightGreen, Brushes.LightBlue, Brushes.LightPink }; for (int d = 0; d < prefix.Length; d++) { // extra spacing in between disconnected chains? MovieClip index = legend.CreateSubMovieClip(0, 0, w / 4, h / 3); MovieClip dot = index.CreateSubMovieClip(0, 0, 10, 10); dot.Graphics.FillEllipse(brushes[d], 0, 0, 9, 9); MovieClip text = index.CreateSubMovieClip(10, 0, w / 4 - 10, h / 3); text.LeftString(prefix[d], Brushes.White); } Space(4, 1, legend.Children, w / 4); Space(10, 10, clip.Children, this.Width); }