/*****************************************************************************
- * Copyright (c) 2007, 2014 Intel Corporation and others
+ * Copyright (c) 2007, 2015 Intel Corporation and others
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.eclipse.tracecompass.tmf.core.signal.TmfSignalManager;
+import org.eclipse.tracecompass.tmf.ui.signal.TmfTimeViewAlignmentInfo;
+import org.eclipse.tracecompass.tmf.ui.signal.TmfTimeViewAlignmentSignal;
+import org.eclipse.tracecompass.tmf.ui.views.ITmfTimeAligned;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.ITimeGraphColorListener;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider;
import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider2;
/**
* Time graph control implementation
*
- * @version 1.0
* @author Alvaro Sanchez-Leon
* @author Patrick Tasse
*/
MouseWheelListener, MouseTrackListener, TraverseListener, ISelectionProvider,
MenuDetectListener, ITmfTimeGraphDrawingHelper, ITimeGraphColorListener, Listener {
- /** Constant indicating that all levels of the time graph should be expanded
- * @since 3.1 */
+ /** Constant indicating that all levels of the time graph should be expanded */
public static final int ALL_LEVELS = AbstractTreeViewer.ALL_LEVELS;
private static final int DRAG_NONE = 0;
private static final int ARROW_HOVER_MAX_DIST = 5;
private static final int NO_STATUS = -1;
+ private static final int STATUS_WITHOUT_CURSOR_TIME = -2;
/** Resource manager */
private LocalResourceManager fResourceManager = new LocalResourceManager(JFaceResources.getResources());
private int fMinimumItemWidth = 0;
private int fTopIndex = 0;
private int fDragState = DRAG_NONE;
+ private boolean fDragBeginMarker = false;
private int fDragButton;
private int fDragX0 = 0;
private int fDragX = 0;
private int fBorderWidth = 0;
private int fHeaderHeight = 0;
- private MouseScrollNotifier fMouseScrollNotifier;
- private final Object fMouseScrollNotifierLock = new Object();
-
- private class MouseScrollNotifier extends Thread {
- private static final long DELAY = 400L;
- private static final long POLLING_INTERVAL = 10L;
- private long fLastScrollTime = Long.MAX_VALUE;
-
- @Override
- public void run() {
- while ((System.currentTimeMillis() - fLastScrollTime) < DELAY) {
- try {
- Thread.sleep(POLLING_INTERVAL);
- } catch (Exception e) {
- return;
- }
- }
- if (!isInterrupted()) {
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- if (isDisposed()) {
- return;
- }
- fTimeProvider.notifyStartFinishTime();
- }
- });
- }
- synchronized (fMouseScrollNotifierLock) {
- fMouseScrollNotifier = null;
- }
- }
-
- public void mouseScrolled() {
- fLastScrollTime = System.currentTimeMillis();
- }
- }
-
/**
* Standard constructor
*
* Gets the timegraph provider used by this timegraph viewer.
*
* @return the timegraph provider, or <code>null</code> if not set.
- * @since 3.0
*/
public ITimeGraphPresentationProvider getTimeGraphProvider() {
return fTimeGraphProvider;
* Gets the color map used by this timegraph viewer.
*
* @return a color map, or <code>null</code> if not set.
- * @since 3.0
*/
public Color[] getEventColorMap() {
return fEventColorMap;
*
* @param statusLineManager
* The status line manager, or null to disable status line messages
- * @since 2.1
*/
public void setStatusLineManager(IStatusLineManager statusLineManager) {
if (fStatusLineManager != null && statusLineManager == null) {
*
* @param timeGraphScale
* The time graph scale
- * @since 2.1
*/
public void setTimeGraphScale(TimeGraphScale timeGraphScale) {
fTimeGraphScale = timeGraphScale;
*
* @param listener
* The listener to add
- * @since 3.1
*/
public void addDragSelectionListener(ITimeGraphTimeListener listener) {
if (listener == null) {
*
* @param listener
* The listener to remove
- * @since 3.1
*/
public void removeDragSelectionListener(ITimeGraphTimeListener listener) {
if (null != fDragSelectionListeners) {
* Time interval start
* @param end
* Time interval end
- * @since 3.1
*/
public void fireDragSelectionChanged(long start, long end) {
// check for backward intervals
/**
* Refresh the links (arrows) of this widget
*
- * @param events The link events to refresh
- * @since 2.1
+ * @param events The link event list
*/
public void refreshArrows(List<ILinkEvent> events) {
fItemData.refreshArrows(events);
}
+ /**
+ * Get the links (arrows) of this widget
+ *
+ * @return The unmodifiable link event list
+ *
+ * @since 1.0
+ */
+ public List<ILinkEvent> getArrows() {
+ return Collections.unmodifiableList(fItemData.fLinks);
+ }
+
boolean ensureVisibleItem(int idx, boolean redraw) {
boolean changed = false;
int index = idx;
* @param level
* non-negative level, or <code>ALL_LEVELS</code> to expand all
* levels of the tree
- * @since 3.1
*/
public void setAutoExpandLevel(int level) {
fAutoExpandLevel = level;
* @return non-negative level, or <code>ALL_LEVELS</code> if all levels of
* the tree are expanded automatically
* @see #setAutoExpandLevel
- * @since 3.1
*/
public int getAutoExpandLevel() {
return fAutoExpandLevel;
/**
* Collapses all nodes of the viewer's tree, starting with the root.
- *
- * @since 2.0
*/
public void collapseAll() {
for (Item item : fItemData.fItems) {
/**
* Expands all nodes of the viewer's tree, starting with the root.
- *
- * @since 2.0
*/
public void expandAll() {
for (Item item : fItemData.fItems) {
/**
* Add a menu listener on {@link ITimeGraphEntry}s
+ *
* @param listener
* The listener to add
- * @since 1.2
*/
public void addTimeGraphEntryMenuListener(MenuDetectListener listener) {
if (!fTimeGraphEntryMenuListeners.contains(listener)) {
*
* @param listener
* The listener to remove
- * @since 1.2
*/
public void removeTimeGraphEntryMenuListener(MenuDetectListener listener) {
if (fTimeGraphEntryMenuListeners.contains(listener)) {
*
* @param listener
* The listener to add
- * @since 1.2
*/
public void addTimeEventMenuListener(MenuDetectListener listener) {
if (!fTimeEventMenuListeners.contains(listener)) {
*
* @param listener
* The listener to remove
- * @since 1.2
*/
public void removeTimeEventMenuListener(MenuDetectListener listener) {
if (fTimeEventMenuListeners.contains(listener)) {
*
* @param n
* 1 for next event, -1 for previous event
+ * @param extend
+ * true to extend selection range, false for single selection
+ * @since 1.0
*/
- public void selectEvent(int n) {
+ public void selectEvent(int n, boolean extend) {
if (null == fTimeProvider) {
return;
}
if (trace == null) {
return;
}
- long selectedTime = fTimeProvider.getSelectionBegin();
- long endTime = fTimeProvider.getEndTime();
+ long selectedTime = fTimeProvider.getSelectionEnd();
+ long endTime = fTimeProvider.getMaxTime();
ITimeEvent nextEvent;
- if (-1 == n && selectedTime > endTime) {
+ if (n == -1 && selectedTime > endTime) {
nextEvent = Utils.findEvent(trace, selectedTime, 0);
} else {
nextEvent = Utils.findEvent(trace, selectedTime, n);
}
- if (null == nextEvent && -1 == n) {
+ if (null == nextEvent && n == -1) {
nextEvent = Utils.getFirstEvent(trace);
}
if (null != nextEvent) {
// for previous event go to its end time unless we were already there
nextTime = nextEvent.getTime() + nextEvent.getDuration();
}
- fTimeProvider.setSelectedTimeNotify(nextTime, true);
+ if (extend) {
+ fTimeProvider.setSelectionRangeNotify(fTimeProvider.getSelectionBegin(), nextTime);
+ } else {
+ fTimeProvider.setSelectedTimeNotify(nextTime, true);
+ }
fireSelectionChanged();
- } else if (1 == n) {
- fTimeProvider.setSelectedTimeNotify(endTime, true);
+ } else if (n == 1) {
+ if (extend) {
+ fTimeProvider.setSelectionRangeNotify(fTimeProvider.getSelectionBegin(), endTime);
+ } else {
+ fTimeProvider.setSelectedTimeNotify(endTime, true);
+ }
fireSelectionChanged();
}
+ updateStatusLine(STATUS_WITHOUT_CURSOR_TIME);
}
/**
* Select the next event
+ *
+ * @param extend
+ * true to extend selection range, false for single selection
+ * @since 1.0
*/
- public void selectNextEvent() {
- selectEvent(1);
+ public void selectNextEvent(boolean extend) {
+ selectEvent(1, extend);
// Notify if visible time window has been adjusted
fTimeProvider.setStartFinishTimeNotify(fTimeProvider.getTime0(), fTimeProvider.getTime1());
}
/**
* Select the previous event
+ *
+ * @param extend
+ * true to extend selection range, false for single selection
+ * @since 1.0
*/
- public void selectPrevEvent() {
- selectEvent(-1);
+ public void selectPrevEvent(boolean extend) {
+ selectEvent(-1, extend);
// Notify if visible time window has been adjusted
fTimeProvider.setStartFinishTimeNotify(fTimeProvider.getTime0(), fTimeProvider.getTime1());
}
*
* @param left
* true to scroll left, false to scroll right
- *
- * @since 3.2
*/
public void horizontalScroll(boolean left) {
long time0 = fTimeProvider.getTime0();
long center = time0 + Math.round(((double) (xPos - nameSpace) / timeSpace * interval));
long newTime0 = center - Math.round((double) newInterval * (center - time0) / interval);
long newTime1 = newTime0 + newInterval;
- fTimeProvider.setStartFinishTime(newTime0, newTime1);
- synchronized (fMouseScrollNotifierLock) {
- if (fMouseScrollNotifier == null) {
- fMouseScrollNotifier = new MouseScrollNotifier();
- fMouseScrollNotifier.start();
- }
- fMouseScrollNotifier.mouseScrolled();
- }
+ fTimeProvider.setStartFinishTimeNotify(newTime0, newTime1);
}
/**
* Hide arrows
*
* @param hideArrows true to hide arrows
- *
- * @since 2.1
*/
public void hideArrows(boolean hideArrows) {
fHideArrows = hideArrows;
/**
* Follow the arrow forward
*
- * @since 2.1
+ * @param extend
+ * true to extend selection range, false for single selection
+ * @since 1.0
*/
- public void followArrowFwd() {
+ public void followArrowFwd(boolean extend) {
ITimeGraphEntry trace = getSelectedTrace();
if (trace == null) {
return;
}
- long selectedTime = fTimeProvider.getSelectionBegin();
+ long selectedTime = fTimeProvider.getSelectionEnd();
for (ILinkEvent link : fItemData.fLinks) {
if (link.getEntry() == trace && link.getTime() == selectedTime) {
selectItem(link.getDestinationEntry(), false);
if (link.getDuration() != 0) {
- fTimeProvider.setSelectedTimeNotify(link.getTime() + link.getDuration(), true);
+ if (extend) {
+ fTimeProvider.setSelectionRangeNotify(fTimeProvider.getSelectionBegin(), link.getTime() + link.getDuration());
+ } else {
+ fTimeProvider.setSelectedTimeNotify(link.getTime() + link.getDuration(), true);
+ }
// Notify if visible time window has been adjusted
fTimeProvider.setStartFinishTimeNotify(fTimeProvider.getTime0(), fTimeProvider.getTime1());
}
fireSelectionChanged();
+ updateStatusLine(STATUS_WITHOUT_CURSOR_TIME);
return;
}
}
- selectNextEvent();
+ selectNextEvent(extend);
}
/**
* Follow the arrow backward
*
- * @since 2.1
+ * @param extend
+ * true to extend selection range, false for single selection
+ * @since 1.0
*/
- public void followArrowBwd() {
+ public void followArrowBwd(boolean extend) {
ITimeGraphEntry trace = getSelectedTrace();
if (trace == null) {
return;
}
- long selectedTime = fTimeProvider.getSelectionBegin();
+ long selectedTime = fTimeProvider.getSelectionEnd();
for (ILinkEvent link : fItemData.fLinks) {
if (link.getDestinationEntry() == trace && link.getTime() + link.getDuration() == selectedTime) {
selectItem(link.getEntry(), false);
if (link.getDuration() != 0) {
- fTimeProvider.setSelectedTimeNotify(link.getTime(), true);
+ if (extend) {
+ fTimeProvider.setSelectionRangeNotify(fTimeProvider.getSelectionBegin(), link.getTime());
+ } else {
+ fTimeProvider.setSelectedTimeNotify(link.getTime(), true);
+ }
// Notify if visible time window has been adjusted
fTimeProvider.setStartFinishTimeNotify(fTimeProvider.getTime0(), fTimeProvider.getTime1());
}
fireSelectionChanged();
+ updateStatusLine(STATUS_WITHOUT_CURSOR_TIME);
return;
}
}
- selectPrevEvent();
+ selectPrevEvent(extend);
}
/**
* @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) {
* 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);
* @param pt
* a point in the widget
* @return The closest arrow event, or null if there is none close enough.
- * @since 3.2
*/
protected ILinkEvent getArrow(Point pt) {
if (fHideArrows) {
return null;
}
- /**
- * @since 2.0
- */
@Override
public int getXForTime(long time) {
if (null == fTimeProvider) {
return x;
}
- /**
- * @since 2.0
- */
@Override
public long getTimeAtX(int coord) {
if (null == fTimeProvider) {
ITimeGraphEntry entry = item.fEntry;
long time0 = timeProvider.getTime0();
long time1 = timeProvider.getTime1();
- long selectedTime = fTimeProvider.getSelectionBegin();
+ long selectedTime = fTimeProvider.getSelectionEnd();
Rectangle nameRect = getNameRect(bounds, i, nameSpace);
if (nameRect.y >= bounds.y + bounds.height) {
* The width reserved for the names
* @param gc
* Reference to the SWT GC object
- * @since 2.1
*/
public void drawLinks(Rectangle bounds, ITimeDataProvider timeProvider,
List<ILinkEvent> links, int nameSpace, GC gc) {
* the name space
* @param gc
* Graphics context
- * @since 2.1
*/
protected void drawLink(ILinkEvent event, Rectangle bounds, ITimeDataProvider timeProvider, int nameSpace, GC gc) {
drawArrow(getColorScheme(), event, getArrowRectangle(bounds, event), gc);
* @param gc
* Graphics context
* @return true if the state was drawn
- * @since 2.1
*/
protected boolean drawArrow(TimeGraphColorScheme colors, ITimeEvent event,
Rectangle rect, GC gc) {
* @param timeSelected
* Is the timestamp currently selected
* @return true if the state was drawn
- * @since 2.0
*/
protected boolean drawState(TimeGraphColorScheme colors, ITimeEvent event,
Rectangle rect, GC gc, boolean selected, boolean timeSelected) {
} else if (idx > 0) {
idx--;
}
- } else if (SWT.ARROW_LEFT == e.keyCode) {
- selectPrevEvent();
- } else if (SWT.ARROW_RIGHT == e.keyCode) {
- selectNextEvent();
+ } else if (SWT.ARROW_LEFT == e.keyCode && fDragState == DRAG_NONE) {
+ boolean extend = (e.stateMask & SWT.SHIFT) != 0;
+ selectPrevEvent(extend);
+ } else if (SWT.ARROW_RIGHT == e.keyCode && fDragState == DRAG_NONE) {
+ boolean extend = (e.stateMask & SWT.SHIFT) != 0;
+ selectNextEvent(extend);
} else if (SWT.PAGE_DOWN == e.keyCode) {
int page = countPerPage();
idx = getSelectedIndex();
public void focusGained(FocusEvent e) {
fIsInFocus = true;
redraw();
- updateStatusLine(NO_STATUS);
+ updateStatusLine(STATUS_WITHOUT_CURSOR_TIME);
}
@Override
TimeFormat tf = tdp.getTimeFormat();
Resolution res = Resolution.NANOSEC;
StringBuilder message = new StringBuilder();
- if (x >= 0 && fDragState == DRAG_NONE) {
- long time = getTimeAtX(x);
- if (time >= 0) {
- if (tdp instanceof ITimeDataProviderConverter) {
- time = ((ITimeDataProviderConverter) tdp).convertTime(time);
- }
- long selectionBegin = tdp.getSelectionBegin();
- long selectionEnd = tdp.getSelectionEnd();
- message.append(NLS.bind("T: {0}{1} T1: {2}{3}", //$NON-NLS-1$
- new Object[] {
- tf == TimeFormat.CALENDAR ? Utils.formatDate(time) + ' ' : "", //$NON-NLS-1$
- Utils.formatTime(time, tf, res),
- tf == TimeFormat.CALENDAR ? Utils.formatDate(Math.min(selectionBegin, selectionEnd)) + ' ' : "", //$NON-NLS-1$
- Utils.formatTime(Math.min(selectionBegin, selectionEnd), tf, res)
- }));
- if (selectionBegin != selectionEnd) {
- message.append(NLS.bind(" T2: {0}{1} \u0394: {2}", //$NON-NLS-1$
+ if ((x >= 0 || x == STATUS_WITHOUT_CURSOR_TIME) && fDragState == DRAG_NONE) {
+ if (x != STATUS_WITHOUT_CURSOR_TIME) {
+ long time = getTimeAtX(x);
+ if (time >= 0) {
+ if (tdp instanceof ITimeDataProviderConverter) {
+ time = ((ITimeDataProviderConverter) tdp).convertTime(time);
+ }
+ message.append(NLS.bind("T: {0}{1} ", //$NON-NLS-1$
new Object[] {
- tf == TimeFormat.CALENDAR ? Utils.formatDate(Math.max(selectionBegin, selectionEnd)) + ' ' : "", //$NON-NLS-1$
- Utils.formatTime(Math.max(selectionBegin, selectionEnd), tf, res),
- Utils.formatDelta(Math.abs(selectionBegin - selectionEnd), tf, res)
+ tf == TimeFormat.CALENDAR ? Utils.formatDate(time) + ' ' : "", //$NON-NLS-1$
+ Utils.formatTime(time, tf, res)
}));
}
}
+ long selectionBegin = tdp.getSelectionBegin();
+ long selectionEnd = tdp.getSelectionEnd();
+ message.append(NLS.bind("T1: {0}{1}", //$NON-NLS-1$
+ new Object[] {
+ tf == TimeFormat.CALENDAR ? Utils.formatDate(selectionBegin) + ' ' : "", //$NON-NLS-1$
+ Utils.formatTime(selectionBegin, tf, res)
+ }));
+ if (selectionBegin != selectionEnd) {
+ message.append(NLS.bind(" T2: {0}{1} \u0394: {2}", //$NON-NLS-1$
+ new Object[] {
+ tf == TimeFormat.CALENDAR ? Utils.formatDate(selectionEnd) + ' ' : "", //$NON-NLS-1$
+ Utils.formatTime(selectionEnd, tf, res),
+ Utils.formatDelta(selectionEnd - selectionBegin, tf, res)
+ }));
+ }
} else if (fDragState == DRAG_SELECTION || fDragState == DRAG_ZOOM) {
- long time0 = fDragTime0;
- long time = getTimeAtX(fDragX);
+ long time0 = fDragBeginMarker ? getTimeAtX(fDragX0) : fDragTime0;
+ long time = fDragBeginMarker ? fDragTime0 : getTimeAtX(fDragX);
if (tdp instanceof ITimeDataProviderConverter) {
time0 = ((ITimeDataProviderConverter) tdp).convertTime(time0);
time = ((ITimeDataProviderConverter) tdp).convertTime(time);
}
message.append(NLS.bind("T1: {0}{1} T2: {2}{3} \u0394: {4}", //$NON-NLS-1$
new Object[] {
- tf == TimeFormat.CALENDAR ? Utils.formatDate(Math.min(time, time0)) + ' ' : "", //$NON-NLS-1$
- Utils.formatTime(Math.min(time, time0), tf, res),
- tf == TimeFormat.CALENDAR ? Utils.formatDate(Math.max(time, time0)) + ' ' : "", //$NON-NLS-1$
- Utils.formatTime(Math.max(time, time0), tf, res),
- Utils.formatDelta(Math.abs(time - time0), tf, res)
+ tf == TimeFormat.CALENDAR ? Utils.formatDate(time0) + ' ' : "", //$NON-NLS-1$
+ Utils.formatTime(time0, tf, res),
+ tf == TimeFormat.CALENDAR ? Utils.formatDate(time) + ' ' : "", //$NON-NLS-1$
+ Utils.formatTime(time, tf, res),
+ Utils.formatDelta(time - time0, tf, res)
}));
}
fStatusLineManager.setMessage(message.toString());
time0 = fTimeProvider.getMinTime();
time1 = time0 + (fTime1bak - fTime0bak);
}
- fTimeProvider.setStartFinishTime(time0, time1);
+ fTimeProvider.setStartFinishTimeNotify(time0, time1);
}
} else if (DRAG_SPLIT_LINE == fDragState) {
fDragX = e.x;
fTimeProvider.setNameSpace(e.x);
+ TmfSignalManager.dispatchSignal(new TmfTimeViewAlignmentSignal(this, getTimeViewAlignmentInfo()));
} else if (DRAG_SELECTION == fDragState) {
- fDragX = Math.min(Math.max(e.x, fTimeProvider.getNameSpace()), size.x - RIGHT_MARGIN);
+ if (fDragBeginMarker) {
+ fDragX0 = Math.min(Math.max(e.x, fTimeProvider.getNameSpace()), size.x - RIGHT_MARGIN);
+ } else {
+ fDragX = Math.min(Math.max(e.x, fTimeProvider.getNameSpace()), size.x - RIGHT_MARGIN);
+ }
redraw();
fTimeGraphScale.setDragRange(fDragX0, fDragX);
fireDragSelectionChanged(getTimeAtX(fDragX0), getTimeAtX(fDragX));
redraw();
}
fMouseOverSplitLine = mouseOverSplitLine;
+ TmfSignalManager.dispatchSignal(new TmfTimeViewAlignmentSignal(this, getTimeViewAlignmentInfo()));
return;
}
int idx = getItemIndexAtY(e.y);
setCapture(true);
fDragState = DRAG_SELECTION;
+ fDragBeginMarker = false;
fDragButton = e.button;
fDragX = e.x;
fDragX0 = fDragX;
if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.SHIFT) {
long time = getTimeAtX(e.x);
if (Math.abs(time - selectionBegin) < Math.abs(time - selectionEnd)) {
- fDragX0 = xEnd;
+ fDragBeginMarker = true;
+ fDragX = xEnd;
+ fDragX0 = e.x;
fDragTime0 = selectionEnd;
} else {
fDragX0 = xBegin;
} else {
long time = getTimeAtX(e.x);
if (Math.abs(e.x - xBegin) < SNAP_WIDTH && Math.abs(time - selectionBegin) <= Math.abs(time - selectionEnd)) {
- fDragX0 = xEnd;
+ fDragBeginMarker = true;
+ fDragX = xEnd;
+ fDragX0 = e.x;
fDragTime0 = selectionEnd;
} else if (Math.abs(e.x - xEnd) < SNAP_WIDTH && Math.abs(time - selectionEnd) <= Math.abs(time - selectionBegin)) {
fDragX0 = xBegin;
long time = getTimeAtX(e.x);
fTimeProvider.setSelectedTimeNotify(time, false);
} else {
- long time0 = fDragTime0;
- long time1 = getTimeAtX(fDragX);
- if (time0 <= time1) {
- fTimeProvider.setSelectionRangeNotify(time0, time1);
- } else {
- fTimeProvider.setSelectionRangeNotify(time1, time0);
- }
+ long time0 = fDragBeginMarker ? getTimeAtX(fDragX0) : fDragTime0;
+ long time1 = fDragBeginMarker ? fDragTime0 : getTimeAtX(fDragX);
+ fTimeProvider.setSelectionRangeNotify(time0, time1);
}
fDragState = DRAG_NONE;
redraw();
fMouseOverSplitLine = false;
redraw();
}
- updateStatusLine(NO_STATUS);
+ updateStatusLine(STATUS_WITHOUT_CURSOR_TIME);
}
@Override
* @param rowHeight
* The height
* @return true if the height is successfully stored, false otherwise
- *
- * @since 2.1
*/
public boolean setItemHeight(ITimeGraphEntry entry, int rowHeight) {
Item item = fItemData.findItem(entry);
/**
* @return The entries that are currently filtered out
- *
- * @since 2.0
*/
public List<ITimeGraphEntry> getFilteredOut() {
return fItemData.getFilteredOut();
/**
* @param filter The filter object to be attached to the view
- * @since 2.0
*/
public void addFilter(ViewerFilter filter) {
if (!fFilters.contains(filter)) {
/**
* @param filter The filter object to be attached to the view
- * @since 2.0
*/
public void removeFilter(ViewerFilter filter) {
fFilters.remove(filter);
}
- /**
- * @since 3.0
- */
@Override
public void colorSettingsChanged(StateItem[] stateItems) {
/* Destroy previous colors from the resource manager */
}
}
- /**
- * @since 1.2
- */
@Override
public void menuDetected(MenuDetectEvent e) {
if (null == fTimeProvider) {
}
}
+ /**
+ * Perform the alignment operation.
+ *
+ * @param offset
+ * the alignment offset
+ *
+ * @see ITmfTimeAligned
+ *
+ * @since 1.0
+ */
+ public void performAlign(int offset) {
+ fTimeProvider.setNameSpace(offset);
+ }
+
+ /**
+ * Return the time alignment information
+ *
+ * @return the time alignment information
+ *
+ * @see ITmfTimeAligned
+ *
+ * @since 1.0
+ */
+ public TmfTimeViewAlignmentInfo getTimeViewAlignmentInfo() {
+ return new TmfTimeViewAlignmentInfo(getShell(), toDisplay(0, 0), fTimeProvider.getNameSpace());
+ }
}