/[eiffelstudio]/branches/eth/eve/Src/library/memory_analyzer/ma_draw_histogram.e
ViewVC logotype

Contents of /branches/eth/eve/Src/library/memory_analyzer/ma_draw_histogram.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 83441 - (show annotations)
Sat Jun 5 13:52:53 2010 UTC (9 years, 7 months ago) by jasonw
File size: 2735 byte(s)
Renamed branch eve3 to eve. The eve branch serves as the new branch for the EVE project.
1 note
2 description: "Draw the histogram of the memory useage at a time."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date: "$Date$"
6 revision: "$Revision$"
7
8 class
9 MA_DRAW_HISTOGRAM
10
11 inherit
12 MA_DRAW_STATISTIC
13 redefine
14 draw_text
15 end
16 create
17 make_default
18
19 feature {NONE}-- Initlization
20
21 make_default
22 -- creation method
23 do
24 graph_height := 80
25 graph_width := 120
26 right_interval := 40
27 bottom_interval := 30
28 create internal_pixmap.make_with_size (graph_width, graph_height)
29 internal_pixmap.set_background_color (graph_pixmap_background_color)
30
31 end
32 feature -- Command
33
34 draw_graph (a_used_percent, a_overhead_percent: DOUBLE)
35 -- Do draw_pixmap.
36 do
37 internal_pixmap.set_foreground_color (graph_pixmap_background_color)
38 internal_pixmap.fill_rectangle (0, 0, internal_pixmap.width, internal_pixmap.height)
39 draw_histogram (a_used_percent, a_overhead_percent)
40 end
41
42 draw_text (a_info: STRING)
43 -- draw the text which is a number of current statistic
44 do
45 internal_pixmap.set_foreground_color (graph_text_color)
46 internal_pixmap.draw_text (0, graph_height - bottom_interval + internal_pixmap.font.height, a_info)
47 end
48
49 feature {NONE} -- Implementation
50
51 draw_histogram (used_percent, overhead_percent: DOUBLE)
52 -- Draw the graph for eiffel/c/total memory useage.
53 require
54 used_percent_valid: used_percent >= 0 and used_percent <= 1
55 overhead_percent_valid: overhead_percent >= 0 and overhead_percent <= 1
56 local
57 test: INTEGER
58 do
59 -- eiffel_mem_percent := eiffel_mem_info.total/total_mem_info.total--whether show the graph base on the percent?
60 --draw background color
61 internal_pixmap.set_foreground_color (graph_inner_background_color)
62 internal_pixmap.fill_rectangle (left_top_x, left_top_y, inner_graph_width, inner_graph_height)
63
64 --draw used
65 internal_pixmap.set_foreground_color (graph_used_color)
66 test := inner_graph_draw_height_y (used_percent)
67 internal_pixmap.fill_rectangle (left_top_x, inner_graph_draw_height_y (used_percent), inner_graph_width, inner_graph_draw_height(used_percent))
68
69 --draw overhead
70 internal_pixmap.set_foreground_color (graph_overhead_color)
71 internal_pixmap.fill_rectangle (left_top_x, inner_graph_draw_height_y (overhead_percent), inner_graph_width, inner_graph_draw_height(overhead_percent))
72
73 end
74
75 note
76 copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
77 license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
78 source: "[
79 Eiffel Software
80 356 Storke Road, Goleta, CA 93117 USA
81 Telephone 805-685-1006, Fax 805-685-6869
82 Website http://www.eiffel.com
83 Customer support http://support.eiffel.com
84 ]"
85
86
87
88
89 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23