[TMF] Increase visibility of some package protected methods
authorXavier Raynaud <xavier.raynaud@kalray.eu>
Fri, 28 Mar 2014 11:34:52 +0000 (12:34 +0100)
committerXavier Raynaud <xavier.raynaud@kalray.eu>
Mon, 31 Mar 2014 07:40:20 +0000 (03:40 -0400)
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
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphControl.java
org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/Utils.java

index c8f6afdd1d4461df68bc1501c0bff74fbd72f6c6..e38fd420e4d695094e370224388385275e73b9a5 100644 (file)
@@ -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;
     }
index 005c1c4135393bc7dda567c8ba3cb27a477419ce..a75c5d9fe3ccb0dd3c5c857d3be5208e51a85d7d 100644 (file)
@@ -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;
         }
This page took 0.027314 seconds and 5 git commands to generate.