DESCRIPTION

TMF: Add vertical events (links) to time graph view

Add the isLink method to ITimeEvent, for events that occur between two entries
instead of in one entry only.
Add the getLinkList method to AbstractTimeGraphView to get the links for a
given zoom level and other methods to propagate those changes to the time graph
control

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


COMMENTS

author: Annalise Jimenez
date: 2013-08-01 16:20:27.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2013-08-01 16:20:32.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2013-08-01 16:34:49.000000000

Patch Set 2: Verified+1

Build Successful 

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

-------------------------------------
author: Luciana Barry
date: 2013-08-01 18:31:38.000000000

Patch Set 2: Code-Review-1

(20 comments)

Line:351, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> if it's called refresh I would expect a UI update, otherwise it should be set or store...

Line:1139, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> postDrawControl should be moved here, after both events and arrows have been drawn

Line:1187, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> should be moved to paint method

Line:1249, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Unnecessary, there should be no links in the event list.

Line:1293, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> potentially, use ILinkEvent instead of TimeLinkEvent

Line:1294, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> add a null check here if you implement my other comments about letting the array be null...

Line:1324, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> the method getXForTime could be used here

Line:1329, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> why not the obvious / 2 ?

Line:1331, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> should add half of destination height. each item could potentially have its own custom height

Line:1354, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> this transparent stuff is mainly for handling drawing of states that end up on the same pixel. I think we can treat all < 0 as non-drawable arrows.

Line:1357, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> this would hide perfectly vertical and horizontal arrows...

Line:167, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java -> oh, Sonar...

Line:171, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java -> bah, just leave it be null

Line:464, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/TimeGraphViewer.java -> just put that line in setLinks ;)

Line:106, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java -> Is there a compelling reason to have the link events ordered? This will slow down building the list.
Anyways, should the link list be managed by the subclass?

Line:312, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java -> these 3 methods not really necessary, subclass just has to implement getLinkList and manage the list itself

Line:482, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java -> why unnecessary transforming of list to array? should stick with one collection for performance reasons.

Line:815, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java -> could just return null by default

Line:21, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/model/TimeLinkEvent.java -> Could create a new interface ILinkEvent that extends ITimeEvent, with the getDestination method. This class could implement it as well as extending TimeEvent.

Line:12, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/model/ITimeEvent.java -> Not sure that the these updates to ITimeEvent are really necessary. If they can be avoided, the patch could be made against master branch for 2.1.

-------------------------------------
author: Annalise Jimenez
date: 2013-08-01 19:29:24.000000000

Patch Set 2:

(6 comments)

Indeed now that linkEvent are managed differently than other events, they can implement two different (disjoint?) interfaces.  Making them disjoint would forbid EventLinks to be added to entries, which may be desirable.

Line:1249, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> "Should" but nothing forbids it...  Though if the isLink method goes away, another check might be necessary.  Unless it becomes somehow forbidden...

Line:1329, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> Good question! ;-)

Line:1331, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> good point

Line:1357, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> It,s a &&.  It would hide only arrows to self.

Line:482, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java -> I took it from the setInput() as called in the refresh() method.  I figured there must be a good reason for that there as well...

Line:815, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java -> I hate having to do null checks afterwards... It's easier this way

-------------------------------------
author: Luciana Barry
date: 2013-08-02 14:49:48.000000000

Patch Set 2:

(3 comments)

You can make the interfaces disjoint but if LinkEvent extends TimeEvent they become joined again.

In any case, as long as ITimeEvent is not changed then this doesn't have to go in luna...

Line:1249, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> If ILinkEvent extends ITimeEvent, then if someone puts an ILinkEvent in the time event list, tough luck... it has a time, it has a duration, we draw it ;)

Line:1357, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java -> oops, true... it also prevents an arithmetic exception in the next method...

Line:482, lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/views/timegraph/AbstractTimeGraphView.java -> For the entries, it was because when we build the entry list we don't know the size in advance (so we use an ArrayList) but TreeViewer needs an array as input. But (normally) the entries size should not be as 'potentially unlimited' as the events or links size could be.

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