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;
}
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;
}
}
/**
- * 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;
}