DESCRIPTION

tmf: Add percentage on Statistics view

Change-Id: I70a565611e230330bc147bb92575d6606aa89311
Signed-off-by: Itzel Singleton xxx@xxx.xxx
Signed-off-by: Braxton Mccarthy xxx@xxx.xxx


COMMENTS

author: Itzel Singleton
date: 2014-05-14 16:56:17.000000000

Uploaded patch set 15.

-------------------------------------
author: Brenden Conley
date: 2014-05-14 16:56:22.000000000

Patch Set 15:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/7012/

-------------------------------------
author: Brenden Conley
date: 2014-05-14 17:33:48.000000000

Patch Set 15: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/7012/ : SUCCESS

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-14 17:57:51.000000000

Patch Set 15:

In answer to Patrick's comments:    

We "inspired" ourselves from VisualVM, which shows the % in the same column as the value, in parentheses. We tried with a completely separate column, it bloats the view a bit more.

> When the time selection has no event, there is no percentage displayed, is this intended?

You mean, if there is no value displayed at all, there is no percentage either? Yeah, I think that's the idea.

About the display "bug" (which I don't think it's really a bug, just a different behaviour), I think the problem shows up now because we align the text to the right in this patch (it used to be aligned to left before). So the column takes all the available space in the table.

I don't think making the column non-resizeable is a good idea. If somebody has a different theme, font size, etc., they might not see all the informmation, and would be unable to resize.

-------------------------------------
author: Itzel Singleton
date: 2014-05-14 18:03:45.000000000

Patch Set 15:

To Patrick:

    The event count alignment seems visually unappealing to me when the percentage has different number of digits (>9.9%). Have you considered putting the percentage in its own column?

One of the first modifications of the code had a dedicated column for the percentage. However, this was really odd looking and we decided to put both the absolute number and the percentage in the same column. One of the problem we encountered was that we couldn't align the percentage and the absolute data, even with padding strings with spaces. This is due to the font used in the cell, and each character doesn't have the same width. By right-aligning all the text, it looks better (as you can see now) but it is not perfect. We could pad the percentage with 0s, to have a constant string length for the percentage (ex: 9.9% -> 009.9%). However, I think it looks weirder. 

Ideally, I would like it to look like the Time column in this image. http://blog.itplace.cz/wp-content/uploads/visualvm2.png
Do you have any suggestion to improve this?



    When the time selection has no event, there is no percentage displayed, is this intended?

This is intended. There is no point to getting the percentage when there is no event selected. As such it is useless information that, in my opinion, should not be displayed.



    Not sure what the GTK display bug is, but have you checked if setVisible(false) on the dummy column still fixes the display bug? Otherwise, perhaps setWidth(0) and setResizable(false)?

I will try and update the code if it works. Thanks for the suggestion! The GTK bug is that the last column fill all the remaining space instead of respecting the size that was set with the in TmfBaseColumnDataProvider.

-------------------------------------
author: Braxton Mccarthy
date: 2014-05-14 18:20:02.000000000

Patch Set 15:

Just a thought, we can probably use a StyledString (like Geneviève does in her patch https://git.eclipse.org/r/#/c/26293/ ), to make the percentage a paler color?

I would put that particular tweak in a separate patch though.

-------------------------------------
author: Luciana Barry
date: 2014-05-14 18:45:46.000000000

Patch Set 15:

I think we could set the column text to the count only, and draw the percentage separately using gc.drawText() in the same EraseItem listener that draws the background bars. Then you can even use a different color!

Unless there's a way to add a margin, you might need to add padding spaces to the item text to leave room for the drawn text, maybe need to use gc.stringExtent("99.9%") / gc.stringExtent(" ") to figure out how many spaces you need, or something similar...

Or, you leave the item text to the count right-aligned and draw the percentage to the left of the count (but at which pixel position?.) Maybe optionally only if the column is wide enough.

RE: my initial comments, I meant when it draws "0" without percentage, not when the text is blank. That would be nicer if the percentage is to the left of the count... so the count doesn't change position depending on the selection. And setResizable(false) only for on the dummy column.

-------------------------------------
