DESCRIPTION

Systemtap: Allow labels for BarChart bars.

Allow non-numeric names to be used as labels for individual
bars drawn in a BarChart.

Change-Id: I642fa95f8c877535324300fee341f27ce7b00c59
Signed-off-by: Landon Wilkins xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2014-01-09 21:55:30.000000000

Patch Set 6:

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

-------------------------------------
author: Brenden Conley
date: 2014-01-09 22:47:51.000000000

Patch Set 6: Verified+1

Build Successful 

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

-------------------------------------
author: Kamila Nguyen
date: 2014-01-10 15:35:48.000000000

Patch Set 6: Code-Review-1 IP-Clean+1

(5 comments)

Line:55, systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/BarChartBuilder.java -> Why do you need to suspend the update ?
And why do you need two booleans ?
Also, wont suspendUpdate always equal false here ?

Line:60, systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/BarChartBuilder.java -> Could you add a comment about what the following code accomplishes ? I am finding it difficult to follow.
Try to avoid doing evaluations of assignment statements it makes code less readable.

Line:86, systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/BarChartBuilder.java -> this is a nitpick but Java naming convention is to use CamelCase except for constants which are all caps

Line:127, systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/BarChartBuilder.java -> Please add comments throughout this function as well

Line:37, systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/PieChartBuilder.java -> Try to add braces around single lined if and while statements wherever you find them. You can create an editor save action to do that automatically.

-------------------------------------
author: Landon Wilkins
date: 2014-01-10 16:12:12.000000000

Patch Set 6: Code-Review-1

(2 comments)

Line:55, systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/BarChartBuilder.java -> I suspend the update because xAxis.setCategorySeries(String[] arg0) triggers another update, and I wanted to prevent that. (Worse case scenario, an infinite loop happens; best case, updateLayout gets called one time extra.)

I would have used Chart's (public) suspendUpdate() method, but the build couldn't find it & failed. The version of swtchart on the Eclipse marketplace must be different than the one being used in the build.

Also, updates may be suspended before a call to updateLayout (suspending updates is a publicly-accessible feature). I used alreadySuspended to only restore updates once exiting this method if they weren't already suspended in the first place.

Line:60, systemtap/org.eclipse.linuxtools.systemtap.graphingapi.ui/src/org/eclipse/linuxtools/systemtap/graphingapi/ui/charts/BarChartBuilder.java -> Given the chart's width & its current number of bars, this code updates the chart's bar labels with trimmed titles that will fit the width of each label, instead of having the labels just get cut off.

Updates are only performed after the x-axis has been set up, to avoid NPEs. Also, updates happen only when at least one trimmed label name is different from its respective untrimmed name. I'll change this so that an update only happens when a trimmed name is different from what is already displayed on the x-axis.

I'll clean this up & add comments here to make this easier to read.

-------------------------------------
author: Landon Wilkins
date: 2014-01-10 22:55:45.000000000

Patch Set 6: Code-Review-2

Submitting a new patch that includes general chart improvements.

-------------------------------------
author: Kamila Nguyen
date: 2014-01-21 17:48:37.000000000

Patch Set 6:

Are you submitting a new patch in lieu of this one or abandonning it ?

-------------------------------------
author: Landon Wilkins
date: 2014-01-21 18:28:48.000000000

Abandoned

"Systemtap: Chart scrolling & BarChart labels" replaces this patch.

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