void drawThreadDestroy(Graphics g, MethodData d, float startY, float endY) { String threadID = d.methodEvent.ThreadID; float x = d.getColumnLeftX() + methodBodyWidth * zoomScale * 0.25f; Pen pen = new Pen(getThreadColor(threadID), 2 * zoomScale); Brush brush = new SolidBrush(getThreadColor(threadID)); float[] dashValues = { 4, 1 }; pen.DashPattern = dashValues; float arrowWidth = 5 * zoomScale; g.DrawLine(pen, x, startY, x, endY); g.DrawLine(pen, 0, endY, x, endY); g.DrawLine(pen, 0, endY, arrowWidth, endY - arrowWidth); g.DrawLine(pen, 0, endY, arrowWidth, endY + arrowWidth); }
void drawStartArrow(Graphics g, MethodData d1, MethodData d2, float y, String title) { Pen p = new Pen(getThreadColor(d1.methodEvent.ThreadID), 2 * zoomScale); if (d1.classData == d2.classData) { float arrowWidth = 5 * zoomScale; g.DrawLine(p, d1.getColumnRightX(), y + 8 * zoomScale, d1.getColumnRightX() + 20 * zoomScale, y + 8 * zoomScale); g.DrawLine(p, d1.getColumnRightX() + 20 * zoomScale, y + 8 * zoomScale, d1.getColumnRightX() + 20 * zoomScale, y - 8 * zoomScale); g.DrawLine(p, d1.getColumnRightX() + 20 * zoomScale, y - 8 * zoomScale, d2.getColumnRightX(), y - 8 * zoomScale); g.DrawLine(p, d1.getColumnRightX() + arrowWidth, y + 3 * zoomScale, d1.getColumnRightX(), y + 8 * zoomScale); g.DrawLine(p, d1.getColumnRightX() + arrowWidth, y + 13 * zoomScale, d1.getColumnRightX(), y + 8 * zoomScale); if (zoomScale >= 0.6) g.DrawString(title, new Font("Tahoma", 7 * zoomScale), Brushes.Black, d2.getColumnRightX() + 5 * zoomScale, y - 23 * zoomScale); return; } else { y += 5 * zoomScale; float x2 = d1.getColumnLeftX(); float x1 = d2.getColumnRightX(); g.DrawLine(p, x1, y, x2, y); float arrowWidth = 5 * zoomScale; if (x1 < x2) { g.DrawLine(p, x2 - arrowWidth, y - arrowWidth, x2, y); g.DrawLine(p, x2 - arrowWidth, y + arrowWidth, x2, y); if (zoomScale >= 0.6) g.DrawString(title, new Font("Tahoma", 7 * zoomScale), Brushes.Black, x1 + arrowWidth, y - 15 * zoomScale); } else { g.DrawLine(p, x2 + arrowWidth, y - arrowWidth, x2, y); g.DrawLine(p, x2 + arrowWidth, y + arrowWidth, x2, y); if (zoomScale >= 0.6) g.DrawString(title, new Font("Tahoma", 7 * zoomScale), Brushes.Black, x1 - arrowWidth, y - 15 * zoomScale); } } }
void drawThreadCreate(Graphics g, MethodData d, float startY, float endY) { String threadID = d.methodEvent.ThreadID; float x = d.getColumnLeftX() + methodBodyWidth * zoomScale * 0.25f; Pen pen = new Pen(getThreadColor(threadID), 2 * zoomScale); g.DrawLine(pen, 0, startY, x, startY); g.DrawLine(pen, x, startY, x, endY); }
void drawReturnArrow(Graphics g, MethodData d1, MethodData d2, float y) { if (d1.classData == d2.classData) { return; } y -= 5 * zoomScale; Pen p = new Pen(getThreadColor(d1.methodEvent.ThreadID), 2 * zoomScale); float x1 = d1.getColumnLeftX(); float x2 = d2.getColumnRightX(); float[] dashValues = { 4, 1 }; p.DashPattern = dashValues; g.DrawLine(p, x1, y, x2, y); float arrowWidth = 5 * zoomScale; if (x1 < x2) { g.DrawLine(p, x2 - arrowWidth, y - arrowWidth, x2, y); g.DrawLine(p, x2 - arrowWidth, y + arrowWidth, x2, y); } else { g.DrawLine(p, x2 + arrowWidth, y - arrowWidth, x2, y); g.DrawLine(p, x2 + arrowWidth, y + arrowWidth, x2, y); } }
void drawMethodLeave(Graphics g, MethodData d, float startY) { Pen pen = new Pen(getThreadColor(d.methodEvent.ThreadID)); float leftX = d.getColumnLeftX(); float rightX = d.getColumnRightX(); g.DrawLine(pen, leftX, startY, rightX, startY); if (d.callerMethodData != null) { drawReturnArrow(g, d, d.callerMethodData, startY); } }
void drawMethodEnter(Graphics g, MethodData d, float startY) { Pen pen = new Pen(getThreadColor(d.methodEvent.ThreadID)); float leftX = d.getColumnLeftX(); float rightX = d.getColumnRightX(); g.DrawLine(pen, leftX, startY, rightX, startY); if (d.callerMethodData != null) { drawStartArrow(g, d, d.callerMethodData, startY, d.methodEvent.MethodInfo.MethodName + "()"); } }
void drawMethodData(Graphics g, MethodData d, float startY, float endY) { Pen pen = new Pen(getThreadColor(d.methodEvent.ThreadID)); float leftX = d.getColumnLeftX(); float rightX = d.getColumnRightX(); //g.DrawRectangle(pen, leftX, startY, rightX - leftX, endY - startY); g.DrawLine(pen, leftX, startY, leftX, endY); g.DrawLine(pen, rightX, startY, rightX, endY); }
void drawThreadCreate(Graphics g, MethodData d, float startY, float endY) { String threadID = d.methodEvent.ThreadID; float x = d.getColumnLeftX() + methodBodyWidth * zoomScale * 0.25f; Pen pen = new Pen(getThreadColor(threadID), 2 * zoomScale); Brush brush = new SolidBrush(getThreadColor(threadID)); float dotWidth = 5 * zoomScale; g.FillEllipse(brush, 0, startY - dotWidth * 0.5f, dotWidth, dotWidth); g.DrawLine(pen, 0, startY, x, startY); g.DrawLine(pen, x, startY, x, endY); }