protected void CreateMethodClip(TemporaryFieldComponent temp,
                                        int x, int y, int w, int h)
        {
            MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h);

            clip.Object = temp.ClassComponent;
            // Back rectangle
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);

            // Dots
            MovieClip dots = clip.CreateSubMovieClip(0, 0, w, h / 2);

            dots.Object = temp.ClassComponent;
            for (int d = 0; d < temp.Uses.Count; d++)
            {               // extra spacing in between disconnected chains?
                MovieClip dot = dots.CreateSubMovieClip(0, 0, 10, 10);
                dot.Graphics.FillEllipse(Brushes.Yellow, 0, 0, 9, 9);
            }
            Space(3, 3, dots.Children, dots.Width);

            // Dots 2
            MovieClip dots2 = clip.CreateSubMovieClip(0, h / 2, w, h / 2);

            dots2.Object = temp.ClassComponent;
            for (int d = 0; d < temp.Defs.Count; d++)
            {               // extra spacing in between disconnected chains?
                MovieClip dot = dots2.CreateSubMovieClip(0, 0, 10, 10);
                dot.Graphics.FillEllipse(Brushes.LightBlue, 0, 0, 9, 9);
                //Brushes.LemonChiffon
            }
            Space(3, 3, dots2.Children, dots2.Width);

            // Text
            clip.CenteredString(temp.Name);
        }
Example #2
0
        protected void CreateMethodClip(MethodComponent method, int maxLength,
                                        int x, int y, int w, int h)
        {
            MovieClip clip = m_panelClip.CreateSubMovieClip(x, y, w, h);

            clip.Object = method;
            // Back rectangle
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);

            double length      = method.Lines.Count;
            double smell_width = w * (length / maxLength);

            // Smell rectangle
            clip.Graphics.FillRectangle(m_smellBrush, 0, 0, (int)smell_width, h);

            // Iteration/Conditional/Comment markings
            int lineCount = 0;

            foreach (LineModel model in method.Lines)
            {
                Pen pen = GetPen(model);
                // Hack
                if (pen != null)
                {
                    double ratio  = lineCount / length;
                    int    mark_x = (int)(ratio * smell_width);
                    clip.Graphics.DrawLine(pen, mark_x, 0, mark_x, h);
                }
                lineCount++;
            }
            clip.CenteredString(method.Name + "() " + method.Lines.Count);
        }
        protected void TaskSummary(MovieClip clip, int w, int h)
        {
            clip.Graphics.FillRectangle(m_backBrush, 0, 0, w, h);
            clip.Graphics.DrawRectangle(Pens.SlateGray, 0, 0, w - 1, h - 1);

            // ID Zone
            MovieClip idLabel = clip.CreateSubMovieClip(0, 0, w / 12, h);

            AlignedString(idLabel, "T1", Brushes.White, StringAlignment.Center);
            MovieClip editNav = clip.CreateSubMovieClip(w / 12, 0, w / 12, h);
            MovieClip edit    = editNav.CreateSubMovieClip(0, 0, w / 24, h);
            MovieClip nav     = editNav.CreateSubMovieClip(w / 24, 0, w / 24, h);

            //edit.Graphics.DrawRectangle( Pens.Sienna, 0, 0, edit.Width-1, edit.Height-1 );
            //nav.Graphics.DrawRectangle( Pens.Sienna, 0, 0, nav.Width-1, nav.Height-1 );

            int eb_h = (int)(h * .45);
            int eb_w = (int)(h * .45);

            GradientPainter.Fill3DSphere(edit, Color.Green, Color.White, edit.Width / 2 - eb_w / 2, edit.Height / 2 - eb_h / 2, eb_w, eb_h);
            edit.CenteredString("33", Brushes.White);
            edit.Graphics.DrawEllipse(Pens.DarkGreen, edit.Width / 2 - eb_w / 2, edit.Height / 2 - eb_h / 2, eb_w, eb_h);

            GradientPainter.Fill3DSphere(nav, Color.Blue, Color.White, nav.Width / 2 - eb_w / 2, nav.Height / 2 - eb_h / 2, eb_w, eb_h);
            nav.CenteredString("15", Brushes.White);
            nav.Graphics.DrawEllipse(Pens.DarkGreen, nav.Width / 2 - eb_w / 2, nav.Height / 2 - eb_h / 2, eb_w, eb_h);

            // TAG CLOUD
            MovieClip tagCloud = clip.CreateSubMovieClip(w / 6, 0, w / 2, h);

            //tagCloud.LeftString( "lock(3) DB(2)", Brushes.White );
            AlignedString(tagCloud, "AUTOTAGS:", Brushes.LightGray, StringAlignment.Near, 7);
            AlignedString(tagCloud, "Lock(3), Oracle(2)", Brushes.White, StringAlignment.Center);

            MovieClip sessions = clip.CreateSubMovieClip(2 * w / 3, 0, w / 3, h);

            AlignedString(sessions, "SESSIONS:", Brushes.LightGray, StringAlignment.Near, 7);
            DrawSessionGraph(sessions, sessions.Width, sessions.Height);
        }