DESCRIPTION

TMF: Introduce the AbstractBarChartView

This new view is a base view for all views using the TimeGraphCombo widget.
As a first step, the lttng2 kernel Control flow view and Resources view have
been modified to extend this abstract view.

Mostly all of the interface management code (build thread, zoom thread, signal
handling, etc) is in the base class.  Final views need only implement to code
to fill the entries' list and events.

This patch includes:
- The abstract view class that all new bar chart views may extend.  The default
   weight of each sash can be set in the constructor.
- A BarChartEntry class that can be used as is if the view does not require
  extra data of its entries
- A BarChartEvent class that can be used as is most of the time
- A BarChartPresentationProvider that present the mechanics of what the view's
  presentation provider should look like.  A view may or may not extend it.
- Added a ITimeGraphDrawingHelper interface to pass to the presentation
  providers to help them get the information they need to know where to draw
  some things (see ResourcesPresentationProvider)

It is a first step before adding new features to the bar chart views.  Some
more abstraction may need to be done as well as other reorganizing of the
code.

Change-Id: I73c9f1b4bf8ec265f1b02804fa7f819bd2b8dd7a
Signed-off-by: Aryana Jones xxx@xxx.xxx


COMMENTS

author: Annalise Jimenez
date: 2013-05-06 15:11:54.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2013-05-06 15:11:59.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/2190/ 

-------------------------------------
author: Annalise Jimenez
date: 2013-05-06 15:12:13.000000000

Patch Set 3:

Just rebased

-------------------------------------
author: Brenden Conley
date: 2013-05-06 15:47:58.000000000

Patch Set 3: Verified

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/2190/ : SUCCESS

-------------------------------------
author: Braxton Mccarthy
date: 2013-05-07 17:20:14.000000000

Patch Set 3: (14 inline comments)

Quick round of comments

Line:7, /COMMIT_MSG -> Maybe use a title like "Consolidate view code..." We're past feature freeze, so we shouldn't be "introducing" anything ;)

Line:77, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphPresentationProvider.java -> I haven't looked into the fine details, but should the extended classes implement these methods all the time? In that case, should the methods here be abstract?

Line:28, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/barchart/BarChartEntry.java -> empy line after

Line:115, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesPresentationProvider.java -> Isn't it possible to take a BarChartEvent as parameter?

Line:53, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java -> what is this for?

Line:136, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java -> ResourcesEntry.getTrace should return a LttngKernelTrace directly

Line:162, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java -> This is not very good practice (doing a "switch" on instance types)...

There should be a method implemented differently in ResourcesEntryCpu, ResourcesEntryIrq, etc. that is called here once.

Line:33, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/barchart/BarChartPresentationProvider.java -> should be private and use getters if needed

Line:83, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/barchart/BarChartEvent.java -> Should be "BarChartEvent"

But in fact you can use getClass().getSimpleName(), that way classes that extend it don't have to reimplement it.

Line:1, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeGraphDrawingHelper.java -> Missing copyright header

Line:3, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeGraphDrawingHelper.java -> Missing description

Line:6, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeGraphDrawingHelper.java -> Remove these empty lines xxx@xxx.xxx plz.

Line:8, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/ITimeGraphDrawingHelper.java -> This sounds like a possible standard Eclipse interface. Maybe use a ITmf... prefix, since this class is TMF-specific.

Line:558, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/barchart/AbstractBarChartView.java -> maybe not in the base abstract view. There is no concept of thread or CPU in TMF.

-------------------------------------
author: Braxton Mccarthy
date: 2013-05-07 17:20:29.000000000

Patch Set 3: I would prefer that you didn't submit this

-1 for "I looked at it" ;)

-------------------------------------
author: Annalise Jimenez
date: 2013-05-07 18:46:36.000000000

Patch Set 3: (3 inline comments)



Line:77, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphPresentationProvider.java -> No, just like the other methods with the same name, they should do nothing by default.  They should be overridden only if you have something to do after drawing.

Line:53, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java -> It's just to pass as parameter to the super constructor the list of columns which can be filtered.  I left it there just so it is obvious that you may at some point want to be able to filter columns.  But I guess I could remove this empty array.

Line:136, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java -> No because ResourceEntry does not re-implement the base BarChartEntry method getTrace() which returns a ITmfTrace.

I would need to re-implement it in sucessor classes then when we know what is the class of the trace.  

Or use generic for the view.  How would that sound?

-------------------------------------
author: Dax Sharp
date: 2013-05-07 19:24:59.000000000

Patch Set 3: (2 inline comments)

Hey, I left a couple of comments! Check them out :)

Line:111, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/controlflow/ControlFlowView.java -> Is it just me or does this function do absolutely nothing?

Line:53, lttng/org.eclipse.linuxtools.lttng2.kernel.ui/src/org/eclipse/linuxtools/internal/lttng2/kernel/ui/views/resources/ResourcesView.java -> Actually, if memory serves me right, this array was used to display the columns inside the filter dialog. They serve no purpose on the filtering per se. It was basically a way to limit the amount of columns inside the small dialog window.

Anyway, it's still pretty useless in this case ;)

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