1 /*****************************************************************************
2 * Copyright (c) 2007, 2014 Intel Corporation, Ericsson, others
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Intel Corporation - Initial API and implementation
10 * Ruslan A. Scherbakov, Intel - Initial API and implementation
11 * Alexander N. Alexeev, Intel - Add monitors statistics support
12 * Alvaro Sanchez-Leon - Adapted for TMF
13 * Patrick Tasse - Refactoring
14 * Geneviève Bastien - Add event links between entries
15 *****************************************************************************/
17 package org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
;
19 import java
.util
.ArrayList
;
20 import java
.util
.List
;
22 import org
.eclipse
.jface
.action
.Action
;
23 import org
.eclipse
.jface
.action
.IAction
;
24 import org
.eclipse
.jface
.dialogs
.IDialogSettings
;
25 import org
.eclipse
.jface
.viewers
.AbstractTreeViewer
;
26 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
27 import org
.eclipse
.jface
.viewers
.ViewerFilter
;
28 import org
.eclipse
.swt
.SWT
;
29 import org
.eclipse
.swt
.events
.ControlAdapter
;
30 import org
.eclipse
.swt
.events
.ControlEvent
;
31 import org
.eclipse
.swt
.events
.KeyAdapter
;
32 import org
.eclipse
.swt
.events
.KeyEvent
;
33 import org
.eclipse
.swt
.events
.MenuDetectListener
;
34 import org
.eclipse
.swt
.events
.MouseEvent
;
35 import org
.eclipse
.swt
.events
.MouseWheelListener
;
36 import org
.eclipse
.swt
.events
.SelectionAdapter
;
37 import org
.eclipse
.swt
.events
.SelectionEvent
;
38 import org
.eclipse
.swt
.events
.SelectionListener
;
39 import org
.eclipse
.swt
.graphics
.Rectangle
;
40 import org
.eclipse
.swt
.layout
.FillLayout
;
41 import org
.eclipse
.swt
.layout
.GridData
;
42 import org
.eclipse
.swt
.layout
.GridLayout
;
43 import org
.eclipse
.swt
.widgets
.Composite
;
44 import org
.eclipse
.swt
.widgets
.Control
;
45 import org
.eclipse
.swt
.widgets
.ScrollBar
;
46 import org
.eclipse
.swt
.widgets
.Slider
;
47 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.Activator
;
48 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.ITmfImageConstants
;
49 import org
.eclipse
.tracecompass
.internal
.tmf
.ui
.Messages
;
50 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.dialogs
.TimeGraphLegend
;
51 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.ILinkEvent
;
52 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
53 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
54 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.ITimeDataProvider
;
55 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.TimeDataProviderCyclesConverter
;
56 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.TimeGraphColorScheme
;
57 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.TimeGraphControl
;
58 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.TimeGraphScale
;
59 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.TimeGraphTooltipHandler
;
60 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.Utils
;
61 import org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
.widgets
.Utils
.TimeFormat
;
64 * Generic time graph viewer implementation
67 * @author Patrick Tasse, and others
69 public class TimeGraphViewer
implements ITimeDataProvider
, SelectionListener
{
71 /** Constant indicating that all levels of the time graph should be expanded
73 public static final int ALL_LEVELS
= AbstractTreeViewer
.ALL_LEVELS
;
75 private static final int DEFAULT_NAME_WIDTH
= 200;
76 private static final int MIN_NAME_WIDTH
= 6;
77 private static final int MAX_NAME_WIDTH
= 1000;
78 private static final int DEFAULT_HEIGHT
= 22;
79 private static final long RECENTERING_MARGIN_FACTOR
= 50;
80 private static final String HIDE_ARROWS_KEY
= "hide.arrows"; //$NON-NLS-1$
81 private static final long DEFAULT_FREQUENCY
= 1000000000L;
83 private long fMinTimeInterval
;
84 private ITimeGraphEntry fSelectedEntry
;
85 private long fBeginTime
;
86 private long fEndTime
;
89 private long fSelectionBegin
= 0;
90 private long fSelectionEnd
= 0;
91 private long fTime0Bound
;
92 private long fTime1Bound
;
93 private long fTime0ExtSynch
= 0;
94 private long fTime1ExtSynch
= 0;
95 private boolean fTimeRangeFixed
;
96 private int fNameWidthPref
= DEFAULT_NAME_WIDTH
;
97 private int fMinNameWidth
= MIN_NAME_WIDTH
;
98 private int fNameWidth
;
99 private Composite fDataViewer
;
101 private TimeGraphControl fTimeGraphCtrl
;
102 private TimeGraphScale fTimeScaleCtrl
;
103 private Slider fVerticalScrollBar
;
104 private TimeGraphColorScheme fColorScheme
;
105 private Object fInputElement
;
106 private ITimeGraphContentProvider fTimeGraphContentProvider
;
107 private ITimeGraphPresentationProvider fTimeGraphProvider
;
108 private ITimeDataProvider fTimeDataProvider
= this;
109 private TimeGraphTooltipHandler fToolTipHandler
;
111 private List
<ITimeGraphSelectionListener
> fSelectionListeners
= new ArrayList
<>();
112 private List
<ITimeGraphTimeListener
> fTimeListeners
= new ArrayList
<>();
113 private List
<ITimeGraphRangeListener
> fRangeListeners
= new ArrayList
<>();
115 // Time format, using Epoch reference, Relative time format(default),
117 private TimeFormat fTimeFormat
= TimeFormat
.RELATIVE
;
118 // Clock frequency to use for Cycles time format
119 private long fClockFrequency
= DEFAULT_FREQUENCY
;
120 private int fBorderWidth
= 0;
121 private int fTimeScaleHeight
= DEFAULT_HEIGHT
;
123 private Action fResetScaleAction
;
124 private Action fShowLegendAction
;
125 private Action fNextEventAction
;
126 private Action fPrevEventAction
;
127 private Action fNextItemAction
;
128 private Action fPreviousItemAction
;
129 private Action fZoomInAction
;
130 private Action fZoomOutAction
;
131 private Action fHideArrowsAction
;
132 private Action fFollowArrowFwdAction
;
133 private Action fFollowArrowBwdAction
;
136 * Standard constructor.
138 * The default timegraph content provider accepts an ITimeGraphEntry[] as input element.
141 * The parent UI composite object
145 public TimeGraphViewer(Composite parent
, int style
) {
146 createDataViewer(parent
, style
);
147 fTimeGraphContentProvider
= new ITimeGraphContentProvider() {
149 public ITimeGraphEntry
[] getElements(Object inputElement
) {
150 if (inputElement
instanceof ITimeGraphEntry
[]) {
151 return (ITimeGraphEntry
[]) inputElement
;
153 return new ITimeGraphEntry
[0];
159 * Sets the timegraph content provider used by this timegraph viewer.
161 * @param timeGraphContentProvider
162 * the timegraph content provider
166 public void setTimeGraphContentProvider(ITimeGraphContentProvider timeGraphContentProvider
) {
167 fTimeGraphContentProvider
= timeGraphContentProvider
;
171 * Gets the timegraph content provider used by this timegraph viewer.
173 * @return the timegraph content provider
177 public ITimeGraphContentProvider
getTimeGraphContentProvider() {
178 return fTimeGraphContentProvider
;
182 * Sets the timegraph presentation provider used by this timegraph viewer.
184 * @param timeGraphProvider
185 * the timegraph provider
187 public void setTimeGraphProvider(ITimeGraphPresentationProvider timeGraphProvider
) {
188 fTimeGraphProvider
= timeGraphProvider
;
189 fTimeGraphCtrl
.setTimeGraphProvider(timeGraphProvider
);
190 fToolTipHandler
= new TimeGraphTooltipHandler(fTimeGraphProvider
, fTimeDataProvider
);
191 fToolTipHandler
.activateHoverHelp(fTimeGraphCtrl
);
195 * Sets or clears the input for this time graph viewer.
197 * @param inputElement
198 * The input of this time graph viewer, or <code>null</code> if
203 public void setInput(Object inputElement
) {
204 fInputElement
= inputElement
;
205 ITimeGraphEntry
[] input
= fTimeGraphContentProvider
.getElements(inputElement
);
207 if (fTimeGraphCtrl
!= null) {
209 fVerticalScrollBar
.setEnabled(true);
213 fSelectedEntry
= null;
214 refreshAllData(input
);
219 * Gets the input for this time graph viewer.
221 * @return The input of this time graph viewer, or <code>null</code> if none
225 public Object
getInput() {
226 return fInputElement
;
230 * Sets (or clears if null) the list of links to display on this combo
233 * the links to display in this time graph combo
236 public void setLinks(List
<ILinkEvent
> links
) {
237 if (fTimeGraphCtrl
!= null) {
238 fTimeGraphCtrl
.refreshArrows(links
);
245 public void refresh() {
246 ITimeGraphEntry
[] input
= fTimeGraphContentProvider
.getElements(fInputElement
);
248 fVerticalScrollBar
.setEnabled(true);
249 refreshAllData(input
);
253 * Callback for when the control is moved
258 public void controlMoved(ControlEvent e
) {
262 * Callback for when the control is resized
267 public void controlResized(ControlEvent e
) {
272 * Handler for when the model is updated. Called from the display order in
276 * The traces in the model
281 * @param updateTimeBounds
282 * Should we updated the time bounds too
284 public void modelUpdate(ITimeGraphEntry
[] traces
, long start
,
285 long end
, boolean updateTimeBounds
) {
286 if (null != fTimeGraphCtrl
) {
287 updateInternalData(traces
, start
, end
);
288 if (updateTimeBounds
) {
289 fTimeRangeFixed
= true;
290 // set window to match limits
291 setStartFinishTime(fTime0Bound
, fTime1Bound
);
293 fTimeGraphCtrl
.redraw();
294 fTimeScaleCtrl
.redraw();
300 * @return The string representing the view type
302 protected String
getViewTypeStr() {
303 return "viewoption.threads"; //$NON-NLS-1$
306 int getMarginWidth() {
310 int getMarginHeight() {
315 fMinTimeInterval
= 1;
316 fSelectionBegin
= -1;
318 fNameWidth
= Utils
.loadIntOption(getPreferenceString("namewidth"), //$NON-NLS-1$
319 fNameWidthPref
, fMinNameWidth
, MAX_NAME_WIDTH
);
323 Utils
.saveIntOption(getPreferenceString("namewidth"), fNameWidth
); //$NON-NLS-1$
327 * Create a data viewer.
333 * @return The new data viewer
335 protected Control
createDataViewer(Composite parent
, int style
) {
337 fColorScheme
= new TimeGraphColorScheme();
338 fDataViewer
= new Composite(parent
, style
) {
340 public void redraw() {
341 fTimeScaleCtrl
.redraw();
342 fTimeGraphCtrl
.redraw();
346 GridLayout gl
= new GridLayout(2, false);
347 gl
.marginHeight
= fBorderWidth
;
349 gl
.verticalSpacing
= 0;
350 gl
.horizontalSpacing
= 0;
351 fDataViewer
.setLayout(gl
);
353 fTimeScaleCtrl
= new TimeGraphScale(fDataViewer
, fColorScheme
);
354 fTimeScaleCtrl
.setTimeProvider(fTimeDataProvider
);
355 fTimeScaleCtrl
.setLayoutData(new GridData(SWT
.FILL
, SWT
.DEFAULT
, true, false));
356 fTimeScaleCtrl
.setHeight(fTimeScaleHeight
);
358 fVerticalScrollBar
= new Slider(fDataViewer
, SWT
.VERTICAL
| SWT
.NO_FOCUS
);
359 fVerticalScrollBar
.setLayoutData(new GridData(SWT
.DEFAULT
, SWT
.FILL
, false, true, 1, 2));
360 fVerticalScrollBar
.addSelectionListener(new SelectionAdapter() {
362 public void widgetSelected(SelectionEvent e
) {
363 setTopIndex(fVerticalScrollBar
.getSelection());
366 fVerticalScrollBar
.setEnabled(false);
368 fTimeGraphCtrl
= createTimeGraphControl(fDataViewer
, fColorScheme
);
370 fTimeGraphCtrl
.setTimeProvider(this);
371 fTimeGraphCtrl
.setTimeGraphScale(fTimeScaleCtrl
);
372 fTimeGraphCtrl
.addSelectionListener(this);
373 fTimeGraphCtrl
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, true, 1, 2));
374 fTimeGraphCtrl
.addMouseWheelListener(new MouseWheelListener() {
376 public void mouseScrolled(MouseEvent e
) {
377 adjustVerticalScrollBar();
380 fTimeGraphCtrl
.addKeyListener(new KeyAdapter() {
382 public void keyPressed(KeyEvent e
) {
383 if (e
.character
== '+') {
385 } else if (e
.character
== '-') {
388 adjustVerticalScrollBar();
392 Composite filler
= new Composite(fDataViewer
, SWT
.NONE
);
393 GridData gd
= new GridData(SWT
.DEFAULT
, SWT
.DEFAULT
, false, false);
394 gd
.heightHint
= fTimeGraphCtrl
.getHorizontalBar().getSize().y
;
395 filler
.setLayoutData(gd
);
396 filler
.setLayout(new FillLayout());
398 fTimeGraphCtrl
.addControlListener(new ControlAdapter() {
400 public void controlResized(ControlEvent event
) {
405 fDataViewer
.update();
406 adjustVerticalScrollBar();
413 public void dispose() {
415 fTimeGraphCtrl
.dispose();
416 fDataViewer
.dispose();
417 fColorScheme
.dispose();
421 * Create a new time graph control.
424 * The parent composite
427 * @return The new TimeGraphControl
430 protected TimeGraphControl
createTimeGraphControl(Composite parent
,
431 TimeGraphColorScheme colors
) {
432 return new TimeGraphControl(parent
, colors
);
436 * Resize the controls
438 public void resizeControls() {
439 Rectangle r
= fDataViewer
.getClientArea();
445 if (fNameWidth
> width
- fMinNameWidth
) {
446 fNameWidth
= width
- fMinNameWidth
;
448 if (fNameWidth
< fMinNameWidth
) {
449 fNameWidth
= fMinNameWidth
;
451 adjustVerticalScrollBar();
455 * Try to set most convenient time range for display.
458 * The traces in the model
460 public void setTimeRange(ITimeGraphEntry traces
[]) {
463 for (int i
= 0; i
< traces
.length
; i
++) {
464 ITimeGraphEntry entry
= traces
[i
];
465 if (entry
.getEndTime() >= entry
.getStartTime() && entry
.getEndTime() > 0) {
466 if (fBeginTime
< 0 || entry
.getStartTime() < fBeginTime
) {
467 fBeginTime
= entry
.getStartTime();
469 if (entry
.getEndTime() > fEndTime
) {
470 fEndTime
= entry
.getEndTime();
475 if (fBeginTime
< 0) {
481 * Recalculate the time bounds
483 public void setTimeBounds() {
484 fTime0Bound
= fBeginTime
;
485 if (fTime0Bound
< 0) {
488 fTime1Bound
= fEndTime
;
489 if (!fTimeRangeFixed
) {
490 fTime0
= fTime0Bound
;
491 fTime1
= fTime1Bound
;
493 fTime0
= Math
.max(fTime0Bound
, Math
.min(fTime0
, fTime1Bound
));
494 fTime1
= Math
.max(fTime0Bound
, Math
.min(fTime1
, fTime1Bound
));
495 if (fTime1
- fTime0
< fMinTimeInterval
) {
496 fTime1
= Math
.min(fTime1Bound
, fTime0
+ fMinTimeInterval
);
505 void updateInternalData(ITimeGraphEntry
[] traces
, long start
, long end
) {
506 ITimeGraphEntry
[] realTraces
= traces
;
508 if (null == realTraces
) {
509 realTraces
= new ITimeGraphEntry
[0];
511 if ((start
== 0 && end
== 0) || start
< 0 || end
< 0) {
512 // Start and end time are unspecified and need to be determined from
513 // individual processes
514 setTimeRange(realTraces
);
520 refreshAllData(realTraces
);
526 private void refreshAllData(ITimeGraphEntry
[] traces
) {
528 if (fSelectionBegin
< fBeginTime
) {
529 fSelectionBegin
= fBeginTime
;
530 } else if (fSelectionBegin
> fEndTime
) {
531 fSelectionBegin
= fEndTime
;
533 if (fSelectionEnd
< fBeginTime
) {
534 fSelectionEnd
= fBeginTime
;
535 } else if (fSelectionEnd
> fEndTime
) {
536 fSelectionEnd
= fEndTime
;
538 fTimeGraphCtrl
.refreshData(traces
);
539 fTimeScaleCtrl
.redraw();
540 adjustVerticalScrollBar();
544 * Callback for when this view is focused
546 public void setFocus() {
547 if (null != fTimeGraphCtrl
) {
548 fTimeGraphCtrl
.setFocus();
553 * Get the current focus status of this view.
555 * @return If the view is currently focused, or not
557 public boolean isInFocus() {
558 return fTimeGraphCtrl
.isInFocus();
562 * Get the view's current selection
564 * @return The entry that is selected
566 public ITimeGraphEntry
getSelection() {
567 return fTimeGraphCtrl
.getSelectedTrace();
571 * Get the index of the current selection
575 public int getSelectionIndex() {
576 return fTimeGraphCtrl
.getSelectedIndex();
580 public long getTime0() {
585 public long getTime1() {
590 public long getMinTimeInterval() {
591 return fMinTimeInterval
;
595 public int getNameSpace() {
600 public void setNameSpace(int width
) {
602 int w
= fTimeGraphCtrl
.getClientArea().width
;
603 if (fNameWidth
> w
- MIN_NAME_WIDTH
) {
604 fNameWidth
= w
- MIN_NAME_WIDTH
;
606 if (fNameWidth
< MIN_NAME_WIDTH
) {
607 fNameWidth
= MIN_NAME_WIDTH
;
609 fTimeGraphCtrl
.adjustScrolls();
610 fTimeGraphCtrl
.redraw();
611 fTimeScaleCtrl
.redraw();
615 public int getTimeSpace() {
616 int w
= fTimeGraphCtrl
.getClientArea().width
;
617 return w
- fNameWidth
;
621 public long getBeginTime() {
626 public long getEndTime() {
631 public long getMaxTime() {
636 public long getMinTime() {
644 public long getSelectionBegin() {
645 return fSelectionBegin
;
652 public long getSelectionEnd() {
653 return fSelectionEnd
;
657 public void setStartFinishTimeNotify(long time0
, long time1
) {
658 setStartFinishTime(time0
, time1
);
659 notifyRangeListeners(fTime0
, fTime1
);
663 public void notifyStartFinishTime() {
664 notifyRangeListeners(fTime0
, fTime1
);
668 public void setStartFinishTime(long time0
, long time1
) {
670 if (fTime0
< fTime0Bound
) {
671 fTime0
= fTime0Bound
;
673 if (fTime0
> fTime1Bound
) {
674 fTime0
= fTime1Bound
;
677 if (fTime1
< fTime0Bound
) {
678 fTime1
= fTime0Bound
;
680 if (fTime1
> fTime1Bound
) {
681 fTime1
= fTime1Bound
;
683 if (fTime1
- fTime0
< fMinTimeInterval
) {
684 fTime1
= Math
.min(fTime1Bound
, fTime0
+ fMinTimeInterval
);
686 fTimeRangeFixed
= true;
687 fTimeGraphCtrl
.adjustScrolls();
688 fTimeGraphCtrl
.redraw();
689 fTimeScaleCtrl
.redraw();
693 * Set the time bounds to the provided values
696 * The start time of the window
700 public void setTimeBounds(long beginTime
, long endTime
) {
701 if (endTime
>= beginTime
) {
702 fBeginTime
= beginTime
;
704 fTime0Bound
= beginTime
;
705 fTime1Bound
= endTime
;
712 fTimeGraphCtrl
.adjustScrolls();
716 public void resetStartFinishTime() {
717 setStartFinishTime(fTime0Bound
, fTime1Bound
);
718 fTimeRangeFixed
= false;
722 public void setSelectedTimeNotify(long time
, boolean ensureVisible
) {
723 setSelectedTimeInt(time
, ensureVisible
, true);
727 public void setSelectedTime(long time
, boolean ensureVisible
) {
728 setSelectedTimeInt(time
, ensureVisible
, false);
735 public void setSelectionRangeNotify(long beginTime
, long endTime
) {
736 boolean changed
= (beginTime
!= fSelectionBegin
|| endTime
!= fSelectionEnd
);
737 fSelectionBegin
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, beginTime
));
738 fSelectionEnd
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, endTime
));
739 fTimeGraphCtrl
.redraw();
740 fTimeScaleCtrl
.redraw();
742 notifyTimeListeners(fSelectionBegin
, fSelectionEnd
);
750 public void setSelectionRange(long beginTime
, long endTime
) {
751 fSelectionBegin
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, beginTime
));
752 fSelectionEnd
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, endTime
));
753 fTimeGraphCtrl
.redraw();
754 fTimeScaleCtrl
.redraw();
757 private void setSelectedTimeInt(long time
, boolean ensureVisible
, boolean doNotify
) {
761 long timeSpace
= (fTime1
- fTime0
) / RECENTERING_MARGIN_FACTOR
;
762 long timeMid
= (fTime1
- fTime0
) / 2;
763 if (time
< fTime0
+ timeSpace
) {
764 long dt
= fTime0
- time
+ timeMid
;
767 } else if (time
> fTime1
- timeSpace
) {
768 long dt
= time
- fTime1
+ timeMid
;
772 if (fTime0
< fTime0Bound
) {
773 fTime1
= Math
.min(fTime1Bound
, fTime1
+ (fTime0Bound
- fTime0
));
774 fTime0
= fTime0Bound
;
775 } else if (fTime1
> fTime1Bound
) {
776 fTime0
= Math
.max(fTime0Bound
, fTime0
- (fTime1
- fTime1Bound
));
777 fTime1
= fTime1Bound
;
780 if (fTime1
- fTime0
< fMinTimeInterval
) {
781 fTime1
= Math
.min(fTime1Bound
, fTime0
+ fMinTimeInterval
);
783 fTimeGraphCtrl
.adjustScrolls();
784 fTimeGraphCtrl
.redraw();
785 fTimeScaleCtrl
.redraw();
787 boolean notifySelectedTime
= (time
!= fSelectionBegin
|| time
!= fSelectionEnd
);
788 fSelectionBegin
= time
;
789 fSelectionEnd
= time
;
791 if (doNotify
&& ((time0
!= fTime0
) || (time1
!= fTime1
))) {
792 notifyRangeListeners(fTime0
, fTime1
);
795 if (doNotify
&& notifySelectedTime
) {
796 notifyTimeListeners(fSelectionBegin
, fSelectionEnd
);
801 public void widgetDefaultSelected(SelectionEvent e
) {
802 if (fSelectedEntry
!= getSelection()) {
803 fSelectedEntry
= getSelection();
804 notifySelectionListeners(fSelectedEntry
);
809 public void widgetSelected(SelectionEvent e
) {
810 if (fSelectedEntry
!= getSelection()) {
811 fSelectedEntry
= getSelection();
812 notifySelectionListeners(fSelectedEntry
);
817 * Callback for when the next event is selected
819 public void selectNextEvent() {
820 fTimeGraphCtrl
.selectNextEvent();
821 adjustVerticalScrollBar();
825 * Callback for when the previous event is selected
827 public void selectPrevEvent() {
828 fTimeGraphCtrl
.selectPrevEvent();
829 adjustVerticalScrollBar();
833 * Callback for when the next item is selected
835 public void selectNextItem() {
836 fTimeGraphCtrl
.selectNextTrace();
837 adjustVerticalScrollBar();
841 * Callback for when the previous item is selected
843 public void selectPrevItem() {
844 fTimeGraphCtrl
.selectPrevTrace();
845 adjustVerticalScrollBar();
849 * Callback for the show legend action
851 public void showLegend() {
852 if (fDataViewer
== null || fDataViewer
.isDisposed()) {
856 TimeGraphLegend
.open(fDataViewer
.getShell(), fTimeGraphProvider
);
860 * Callback for the Zoom In action
862 public void zoomIn() {
863 fTimeGraphCtrl
.zoomIn();
867 * Callback for the Zoom Out action
869 public void zoomOut() {
870 fTimeGraphCtrl
.zoomOut();
873 private String
getPreferenceString(String string
) {
874 return getViewTypeStr() + "." + string
; //$NON-NLS-1$
878 * Add a selection listener
881 * The listener to add
883 public void addSelectionListener(ITimeGraphSelectionListener listener
) {
884 fSelectionListeners
.add(listener
);
888 * Remove a selection listener
891 * The listener to remove
893 public void removeSelectionListener(ITimeGraphSelectionListener listener
) {
894 fSelectionListeners
.remove(listener
);
897 private void notifySelectionListeners(ITimeGraphEntry selection
) {
898 TimeGraphSelectionEvent event
= new TimeGraphSelectionEvent(this, selection
);
900 for (ITimeGraphSelectionListener listener
: fSelectionListeners
) {
901 listener
.selectionChanged(event
);
906 * Add a time listener
909 * The listener to add
911 public void addTimeListener(ITimeGraphTimeListener listener
) {
912 fTimeListeners
.add(listener
);
916 * Remove a time listener
919 * The listener to remove
921 public void removeTimeListener(ITimeGraphTimeListener listener
) {
922 fTimeListeners
.remove(listener
);
925 private void notifyTimeListeners(long startTime
, long endTime
) {
926 TimeGraphTimeEvent event
= new TimeGraphTimeEvent(this, startTime
, endTime
);
928 for (ITimeGraphTimeListener listener
: fTimeListeners
) {
929 listener
.timeSelected(event
);
934 * Add a range listener
937 * The listener to add
939 public void addRangeListener(ITimeGraphRangeListener listener
) {
940 fRangeListeners
.add(listener
);
944 * Remove a range listener
947 * The listener to remove
949 public void removeRangeListener(ITimeGraphRangeListener listener
) {
950 fRangeListeners
.remove(listener
);
953 private void notifyRangeListeners(long startTime
, long endTime
) {
954 // Check if the time has actually changed from last notification
955 if (startTime
!= fTime0ExtSynch
|| endTime
!= fTime1ExtSynch
) {
956 // Notify Time Scale Selection Listeners
957 TimeGraphRangeUpdateEvent event
= new TimeGraphRangeUpdateEvent(this, startTime
, endTime
);
959 for (ITimeGraphRangeListener listener
: fRangeListeners
) {
960 listener
.timeRangeUpdated(event
);
963 // update external synch timers
964 updateExtSynchTimers();
969 * Callback to set a selected event in the view
972 * The event that was selected
974 * The source of this selection event
976 public void setSelectedEvent(ITimeEvent event
, Object source
) {
977 if (event
== null || source
== this) {
980 fSelectedEntry
= event
.getEntry();
981 fTimeGraphCtrl
.selectItem(fSelectedEntry
, false);
983 setSelectedTimeInt(event
.getTime(), true, true);
984 adjustVerticalScrollBar();
988 * Set the seeked time of a trace
991 * The trace that was seeked
995 * The source of this seek event
997 public void setSelectedTraceTime(ITimeGraphEntry trace
, long time
, Object source
) {
998 if (trace
== null || source
== this) {
1001 fSelectedEntry
= trace
;
1002 fTimeGraphCtrl
.selectItem(trace
, false);
1004 setSelectedTimeInt(time
, true, true);
1008 * Callback for a trace selection
1011 * The trace that was selected
1013 public void setSelection(ITimeGraphEntry trace
) {
1014 fSelectedEntry
= trace
;
1015 fTimeGraphCtrl
.selectItem(trace
, false);
1016 adjustVerticalScrollBar();
1020 * Callback for a time window selection
1023 * Start time of the range
1025 * End time of the range
1027 * Source of the event
1029 public void setSelectVisTimeWindow(long time0
, long time1
, Object source
) {
1030 if (source
== this) {
1034 setStartFinishTime(time0
, time1
);
1036 // update notification time values since we are now in synch with the
1037 // external application
1038 updateExtSynchTimers();
1042 * update the cache timers used to identify the need to send a time window
1043 * update to external registered listeners
1045 private void updateExtSynchTimers() {
1046 // last time notification cache
1047 fTime0ExtSynch
= fTime0
;
1048 fTime1ExtSynch
= fTime1
;
1055 public TimeFormat
getTimeFormat() {
1061 * the {@link TimeFormat} used to display timestamps
1064 public void setTimeFormat(TimeFormat tf
) {
1065 this.fTimeFormat
= tf
;
1066 if (tf
== TimeFormat
.CYCLES
) {
1067 fTimeDataProvider
= new TimeDataProviderCyclesConverter(this, fClockFrequency
);
1069 fTimeDataProvider
= this;
1071 fTimeScaleCtrl
.setTimeProvider(fTimeDataProvider
);
1072 if (fToolTipHandler
!= null) {
1073 fToolTipHandler
.setTimeProvider(fTimeDataProvider
);
1078 * Sets the clock frequency. Used when the time format is set to CYCLES.
1080 * @param clockFrequency
1081 * the clock frequency in Hz
1084 public void setClockFrequency(long clockFrequency
) {
1085 fClockFrequency
= clockFrequency
;
1086 if (fTimeFormat
== TimeFormat
.CYCLES
) {
1087 fTimeDataProvider
= new TimeDataProviderCyclesConverter(this, fClockFrequency
);
1088 fTimeScaleCtrl
.setTimeProvider(fTimeDataProvider
);
1089 if (fToolTipHandler
!= null) {
1090 fToolTipHandler
.setTimeProvider(fTimeDataProvider
);
1096 * Retrieve the border width
1100 public int getBorderWidth() {
1101 return fBorderWidth
;
1105 * Set the border width
1107 * @param borderWidth
1110 public void setBorderWidth(int borderWidth
) {
1111 if (borderWidth
> -1) {
1112 this.fBorderWidth
= borderWidth
;
1113 GridLayout gl
= (GridLayout
) fDataViewer
.getLayout();
1114 gl
.marginHeight
= borderWidth
;
1119 * Retrieve the height of the header
1121 * @return The height
1123 public int getHeaderHeight() {
1124 return fTimeScaleHeight
;
1128 * Set the height of the header
1130 * @param headerHeight
1133 public void setHeaderHeight(int headerHeight
) {
1134 if (headerHeight
> -1) {
1135 this.fTimeScaleHeight
= headerHeight
;
1136 fTimeScaleCtrl
.setHeight(headerHeight
);
1141 * Retrieve the height of an item row
1143 * @return The height
1145 public int getItemHeight() {
1146 if (fTimeGraphCtrl
!= null) {
1147 return fTimeGraphCtrl
.getItemHeight();
1153 * Set the height of an item row
1158 public void setItemHeight(int rowHeight
) {
1159 if (fTimeGraphCtrl
!= null) {
1160 fTimeGraphCtrl
.setItemHeight(rowHeight
);
1165 * Set the minimum item width
1170 public void setMinimumItemWidth(int width
) {
1171 if (fTimeGraphCtrl
!= null) {
1172 fTimeGraphCtrl
.setMinimumItemWidth(width
);
1177 * Set the width for the name column
1182 public void setNameWidthPref(int width
) {
1183 fNameWidthPref
= width
;
1191 * Retrieve the configure width for the name column
1197 public int getNameWidthPref(int width
) {
1198 return fNameWidthPref
;
1202 * Returns the primary control associated with this viewer.
1204 * @return the SWT control which displays this viewer's content
1206 public Control
getControl() {
1211 * Returns the time graph control associated with this viewer.
1213 * @return the time graph control
1216 public TimeGraphControl
getTimeGraphControl() {
1217 return fTimeGraphCtrl
;
1221 * Returns the time graph scale associated with this viewer.
1223 * @return the time graph scale
1226 public TimeGraphScale
getTimeGraphScale() {
1227 return fTimeScaleCtrl
;
1231 * Return the x coordinate corresponding to a time
1235 * @return the x coordinate corresponding to the time
1239 public int getXForTime(long time
) {
1240 return fTimeGraphCtrl
.getXForTime(time
);
1244 * Return the time corresponding to an x coordinate
1248 * @return the time corresponding to the x coordinate
1252 public long getTimeAtX(int x
) {
1253 return fTimeGraphCtrl
.getTimeAtX(x
);
1257 * Get the selection provider
1259 * @return the selection provider
1261 public ISelectionProvider
getSelectionProvider() {
1262 return fTimeGraphCtrl
;
1266 * Wait for the cursor
1269 * Wait indefinitely?
1271 public void waitCursor(boolean waitInd
) {
1272 fTimeGraphCtrl
.waitCursor(waitInd
);
1276 * Get the horizontal scroll bar object
1278 * @return The scroll bar
1280 public ScrollBar
getHorizontalBar() {
1281 return fTimeGraphCtrl
.getHorizontalBar();
1285 * Get the vertical scroll bar object
1287 * @return The scroll bar
1289 public Slider
getVerticalBar() {
1290 return fVerticalScrollBar
;
1294 * Set the given index as the top one
1297 * The index that will go to the top
1299 public void setTopIndex(int index
) {
1300 fTimeGraphCtrl
.setTopIndex(index
);
1301 adjustVerticalScrollBar();
1305 * Retrieve the current top index
1307 * @return The top index
1309 public int getTopIndex() {
1310 return fTimeGraphCtrl
.getTopIndex();
1314 * Sets the auto-expand level to be used when the input of the viewer is set
1315 * using {@link #setInput(Object)}. The value 0 means that there is no
1316 * auto-expand; 1 means that top-level elements are expanded, but not their
1317 * children; 2 means that top-level elements are expanded, and their
1318 * children, but not grand-children; and so on.
1320 * The value {@link #ALL_LEVELS} means that all subtrees should be expanded.
1323 * non-negative level, or <code>ALL_LEVELS</code> to expand all
1324 * levels of the tree
1327 public void setAutoExpandLevel(int level
) {
1328 fTimeGraphCtrl
.setAutoExpandLevel(level
);
1332 * Returns the auto-expand level.
1334 * @return non-negative level, or <code>ALL_LEVELS</code> if all levels of
1335 * the tree are expanded automatically
1336 * @see #setAutoExpandLevel
1339 public int getAutoExpandLevel() {
1340 return fTimeGraphCtrl
.getAutoExpandLevel();
1344 * Set the expanded state of an entry
1347 * The entry to expand/collapse
1349 * True for expanded, false for collapsed
1351 public void setExpandedState(ITimeGraphEntry entry
, boolean expanded
) {
1352 fTimeGraphCtrl
.setExpandedState(entry
, expanded
);
1353 adjustVerticalScrollBar();
1357 * Collapses all nodes of the viewer's tree, starting with the root.
1361 public void collapseAll() {
1362 fTimeGraphCtrl
.collapseAll();
1363 adjustVerticalScrollBar();
1367 * Expands all nodes of the viewer's tree, starting with the root.
1371 public void expandAll() {
1372 fTimeGraphCtrl
.expandAll();
1373 adjustVerticalScrollBar();
1377 * Get the number of sub-elements when expanded
1379 * @return The element count
1381 public int getExpandedElementCount() {
1382 return fTimeGraphCtrl
.getExpandedElementCount();
1386 * Get the sub-elements
1388 * @return The array of entries that are below this one
1390 public ITimeGraphEntry
[] getExpandedElements() {
1391 return fTimeGraphCtrl
.getExpandedElements();
1395 * Add a tree listener
1398 * The listener to add
1400 public void addTreeListener(ITimeGraphTreeListener listener
) {
1401 fTimeGraphCtrl
.addTreeListener(listener
);
1405 * Remove a tree listener
1408 * The listener to remove
1410 public void removeTreeListener(ITimeGraphTreeListener listener
) {
1411 fTimeGraphCtrl
.removeTreeListener(listener
);
1415 * Get the reset scale action.
1417 * @return The Action object
1419 public Action
getResetScaleAction() {
1420 if (fResetScaleAction
== null) {
1422 fResetScaleAction
= new Action() {
1425 resetStartFinishTime();
1426 notifyStartFinishTime();
1429 fResetScaleAction
.setText(Messages
.TmfTimeGraphViewer_ResetScaleActionNameText
);
1430 fResetScaleAction
.setToolTipText(Messages
.TmfTimeGraphViewer_ResetScaleActionToolTipText
);
1431 fResetScaleAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_HOME_MENU
));
1433 return fResetScaleAction
;
1437 * Get the show legend action.
1439 * @return The Action object
1441 public Action
getShowLegendAction() {
1442 if (fShowLegendAction
== null) {
1444 fShowLegendAction
= new Action() {
1450 fShowLegendAction
.setText(Messages
.TmfTimeGraphViewer_LegendActionNameText
);
1451 fShowLegendAction
.setToolTipText(Messages
.TmfTimeGraphViewer_LegendActionToolTipText
);
1452 fShowLegendAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_SHOW_LEGEND
));
1455 return fShowLegendAction
;
1459 * Get the the next event action.
1461 * @return The action object
1463 public Action
getNextEventAction() {
1464 if (fNextEventAction
== null) {
1465 fNextEventAction
= new Action() {
1472 fNextEventAction
.setText(Messages
.TmfTimeGraphViewer_NextEventActionNameText
);
1473 fNextEventAction
.setToolTipText(Messages
.TmfTimeGraphViewer_NextEventActionToolTipText
);
1474 fNextEventAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_NEXT_EVENT
));
1477 return fNextEventAction
;
1481 * Get the previous event action.
1483 * @return The Action object
1485 public Action
getPreviousEventAction() {
1486 if (fPrevEventAction
== null) {
1487 fPrevEventAction
= new Action() {
1494 fPrevEventAction
.setText(Messages
.TmfTimeGraphViewer_PreviousEventActionNameText
);
1495 fPrevEventAction
.setToolTipText(Messages
.TmfTimeGraphViewer_PreviousEventActionToolTipText
);
1496 fPrevEventAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_PREV_EVENT
));
1499 return fPrevEventAction
;
1503 * Get the next item action.
1505 * @return The Action object
1507 public Action
getNextItemAction() {
1508 if (fNextItemAction
== null) {
1510 fNextItemAction
= new Action() {
1516 fNextItemAction
.setText(Messages
.TmfTimeGraphViewer_NextItemActionNameText
);
1517 fNextItemAction
.setToolTipText(Messages
.TmfTimeGraphViewer_NextItemActionToolTipText
);
1518 fNextItemAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_NEXT_ITEM
));
1520 return fNextItemAction
;
1524 * Get the previous item action.
1526 * @return The Action object
1528 public Action
getPreviousItemAction() {
1529 if (fPreviousItemAction
== null) {
1531 fPreviousItemAction
= new Action() {
1537 fPreviousItemAction
.setText(Messages
.TmfTimeGraphViewer_PreviousItemActionNameText
);
1538 fPreviousItemAction
.setToolTipText(Messages
.TmfTimeGraphViewer_PreviousItemActionToolTipText
);
1539 fPreviousItemAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_PREV_ITEM
));
1541 return fPreviousItemAction
;
1545 * Get the zoom in action
1547 * @return The Action object
1549 public Action
getZoomInAction() {
1550 if (fZoomInAction
== null) {
1551 fZoomInAction
= new Action() {
1557 fZoomInAction
.setText(Messages
.TmfTimeGraphViewer_ZoomInActionNameText
);
1558 fZoomInAction
.setToolTipText(Messages
.TmfTimeGraphViewer_ZoomInActionToolTipText
);
1559 fZoomInAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_ZOOM_IN_MENU
));
1561 return fZoomInAction
;
1565 * Get the zoom out action
1567 * @return The Action object
1569 public Action
getZoomOutAction() {
1570 if (fZoomOutAction
== null) {
1571 fZoomOutAction
= new Action() {
1577 fZoomOutAction
.setText(Messages
.TmfTimeGraphViewer_ZoomOutActionNameText
);
1578 fZoomOutAction
.setToolTipText(Messages
.TmfTimeGraphViewer_ZoomOutActionToolTipText
);
1579 fZoomOutAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_ZOOM_OUT_MENU
));
1581 return fZoomOutAction
;
1585 * Get the hide arrows action
1587 * @param dialogSettings
1588 * The dialog settings section where the state should be stored,
1591 * @return The Action object
1595 public Action
getHideArrowsAction(final IDialogSettings dialogSettings
) {
1596 if (fHideArrowsAction
== null) {
1597 fHideArrowsAction
= new Action(Messages
.TmfTimeGraphViewer_HideArrowsActionNameText
, IAction
.AS_CHECK_BOX
) {
1600 boolean hideArrows
= fHideArrowsAction
.isChecked();
1601 fTimeGraphCtrl
.hideArrows(hideArrows
);
1603 if (dialogSettings
!= null) {
1604 dialogSettings
.put(HIDE_ARROWS_KEY
, hideArrows
);
1606 if (fFollowArrowFwdAction
!= null) {
1607 fFollowArrowFwdAction
.setEnabled(!hideArrows
);
1609 if (fFollowArrowBwdAction
!= null) {
1610 fFollowArrowBwdAction
.setEnabled(!hideArrows
);
1614 fHideArrowsAction
.setToolTipText(Messages
.TmfTimeGraphViewer_HideArrowsActionToolTipText
);
1615 fHideArrowsAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_HIDE_ARROWS
));
1616 if (dialogSettings
!= null) {
1617 boolean hideArrows
= dialogSettings
.getBoolean(HIDE_ARROWS_KEY
);
1618 fTimeGraphCtrl
.hideArrows(hideArrows
);
1619 fHideArrowsAction
.setChecked(hideArrows
);
1620 if (fFollowArrowFwdAction
!= null) {
1621 fFollowArrowFwdAction
.setEnabled(!hideArrows
);
1623 if (fFollowArrowBwdAction
!= null) {
1624 fFollowArrowBwdAction
.setEnabled(!hideArrows
);
1628 return fHideArrowsAction
;
1632 * Get the follow arrow forward action.
1634 * @return The Action object
1638 public Action
getFollowArrowFwdAction() {
1639 if (fFollowArrowFwdAction
== null) {
1640 fFollowArrowFwdAction
= new Action() {
1643 fTimeGraphCtrl
.followArrowFwd();
1644 adjustVerticalScrollBar();
1647 fFollowArrowFwdAction
.setText(Messages
.TmfTimeGraphViewer_FollowArrowForwardActionNameText
);
1648 fFollowArrowFwdAction
.setToolTipText(Messages
.TmfTimeGraphViewer_FollowArrowForwardActionToolTipText
);
1649 fFollowArrowFwdAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_FOLLOW_ARROW_FORWARD
));
1650 if (fHideArrowsAction
!= null) {
1651 fFollowArrowFwdAction
.setEnabled(!fHideArrowsAction
.isChecked());
1654 return fFollowArrowFwdAction
;
1658 * Get the follow arrow backward action.
1660 * @return The Action object
1664 public Action
getFollowArrowBwdAction() {
1665 if (fFollowArrowBwdAction
== null) {
1666 fFollowArrowBwdAction
= new Action() {
1669 fTimeGraphCtrl
.followArrowBwd();
1670 adjustVerticalScrollBar();
1673 fFollowArrowBwdAction
.setText(Messages
.TmfTimeGraphViewer_FollowArrowBackwardActionNameText
);
1674 fFollowArrowBwdAction
.setToolTipText(Messages
.TmfTimeGraphViewer_FollowArrowBackwardActionToolTipText
);
1675 fFollowArrowBwdAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_FOLLOW_ARROW_BACKWARD
));
1676 if (fHideArrowsAction
!= null) {
1677 fFollowArrowBwdAction
.setEnabled(!fHideArrowsAction
.isChecked());
1680 return fFollowArrowBwdAction
;
1683 private void adjustVerticalScrollBar() {
1684 int topIndex
= fTimeGraphCtrl
.getTopIndex();
1685 int countPerPage
= fTimeGraphCtrl
.countPerPage();
1686 int expandedElementCount
= fTimeGraphCtrl
.getExpandedElementCount();
1687 if (topIndex
+ countPerPage
> expandedElementCount
) {
1688 fTimeGraphCtrl
.setTopIndex(Math
.max(0, expandedElementCount
- countPerPage
));
1691 int selection
= fTimeGraphCtrl
.getTopIndex();
1693 int max
= Math
.max(1, expandedElementCount
- 1);
1694 int thumb
= Math
.min(max
, Math
.max(1, countPerPage
- 1));
1696 int pageIncrement
= Math
.max(1, countPerPage
);
1697 fVerticalScrollBar
.setValues(selection
, min
, max
, thumb
, increment
, pageIncrement
);
1702 * a {@link MenuDetectListener}
1703 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#addTimeGraphEntryMenuListener(org.eclipse.swt.events.MenuDetectListener)
1706 public void addTimeGraphEntryMenuListener(MenuDetectListener listener
) {
1707 fTimeGraphCtrl
.addTimeGraphEntryMenuListener(listener
);
1712 * a {@link MenuDetectListener}
1713 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#removeTimeGraphEntryMenuListener(org.eclipse.swt.events.MenuDetectListener)
1716 public void removeTimeGraphEntryMenuListener(MenuDetectListener listener
) {
1717 fTimeGraphCtrl
.removeTimeGraphEntryMenuListener(listener
);
1722 * a {@link MenuDetectListener}
1723 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#addTimeEventMenuListener(org.eclipse.swt.events.MenuDetectListener)
1726 public void addTimeEventMenuListener(MenuDetectListener listener
) {
1727 fTimeGraphCtrl
.addTimeEventMenuListener(listener
);
1732 * a {@link MenuDetectListener}
1733 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#removeTimeEventMenuListener(org.eclipse.swt.events.MenuDetectListener)
1736 public void removeTimeEventMenuListener(MenuDetectListener listener
) {
1737 fTimeGraphCtrl
.removeTimeEventMenuListener(listener
);
1742 * The filter object to be attached to the view
1745 public void addFilter(ViewerFilter filter
) {
1746 fTimeGraphCtrl
.addFilter(filter
);
1752 * The filter object to be attached to the view
1755 public void removeFilter(ViewerFilter filter
) {
1756 fTimeGraphCtrl
.removeFilter(filter
);