Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Raynaud2014-03-28 11:34:52 +0000
committerXavier Raynaud2014-03-31 07:40:20 +0000
commitef9581790276bc1a66674b61e4b319294da44e96 (patch)
treec428c81f3b11cc24646522ec173083123acee2e9
parentdc7efcc6caf08fc8b38a21b5af1f52a6db77d641 (diff)
downloadorg.eclipse.linuxtools-ef9581790276bc1a66674b61e4b319294da44e96.tar.gz
org.eclipse.linuxtools-ef9581790276bc1a66674b61e4b319294da44e96.tar.xz
org.eclipse.linuxtools-ef9581790276bc1a66674b61e4b319294da44e96.zip
[TMF] Increase visibility of some package protected methods
Therefore, these methods can be used in subclasses and/or from other packages. Change-Id: Ie5ef3408dfc8add0d4da8279c18a7c6391381250 Signed-off-by: Xavier Raynaud <xavier.raynaud@kalray.eu> Reviewed-on: https://git.eclipse.org/r/24057 Reviewed-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im> IP-Clean: Alexandre Montplaisir <alexmonthy@voxpopuli.im> Tested-by: Hudson CI
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java21
-rw-r--r--lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java16
2 files changed, 30 insertions, 7 deletions
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
index c8f6afdd1d..e38fd420e4 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
@@ -1001,7 +1001,15 @@ public class TimeGraphControl extends TimeGraphBaseControl
return toggled;
}
- int getItemIndexAtY(int y) {
+ /**
+ * Gets the index of the item at the given location.
+ *
+ * @param y
+ * the y coordinate
+ * @return the index of the item at the given location, of -1 if none.
+ * @since 3.0
+ */
+ protected int getItemIndexAtY(int y) {
if (y < 0) {
return -1;
}
@@ -1023,7 +1031,16 @@ public class TimeGraphControl extends TimeGraphBaseControl
return Math.abs(x - nameWidth) < SNAP_WIDTH;
}
- ITimeGraphEntry getEntry(Point pt) {
+ /**
+ * Gets the {@link ITimeGraphEntry} at the given location.
+ *
+ * @param pt
+ * a point in the widget
+ * @return the {@link ITimeGraphEntry} at this point, or <code>null</code>
+ * if none.
+ * @since 3.0
+ */
+ protected ITimeGraphEntry getEntry(Point pt) {
int idx = getItemIndexAtY(pt.y);
return idx >= 0 ? fItemData.fExpandedItems[idx].fEntry : null;
}
diff --git a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java
index 005c1c4135..a75c5d9fe3 100644
--- a/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java
+++ b/lttng/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java
@@ -463,16 +463,22 @@ public class Utils {
}
/**
- * N means: <list> <li>-1: Previous Event</li> <li>0: Current Event</li> <li>
- * 1: Next Event</li> <li>2: Previous Event when located in a non Event Area
- * </list>
+ * Gets the {@link ITimeEvent} at the given time from the given
+ * {@link ITimeGraphEntry}.
*
* @param entry
+ * a {@link ITimeGraphEntry}
* @param time
+ * a timestamp
* @param n
- * @return
+ * this parameter means: <list> <li>-1: Previous Event</li> <li>
+ * 0: Current Event</li> <li>
+ * 1: Next Event</li> <li>2: Previous Event when located in a non
+ * Event Area </list>
+ * @return a {@link ITimeEvent}, or <code>null</code>.
+ * @since 3.0
*/
- static ITimeEvent findEvent(ITimeGraphEntry entry, long time, int n) {
+ public static ITimeEvent findEvent(ITimeGraphEntry entry, long time, int n) {
if (null == entry || ! entry.hasTimeEvents()) {
return null;
}

Back to the top