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
);
357 fTimeScaleCtrl
.addMouseWheelListener(new MouseWheelListener() {
359 public void mouseScrolled(MouseEvent e
) {
360 fTimeGraphCtrl
.zoom(e
.count
> 0);
364 fVerticalScrollBar
= new Slider(fDataViewer
, SWT
.VERTICAL
| SWT
.NO_FOCUS
);
365 fVerticalScrollBar
.setLayoutData(new GridData(SWT
.DEFAULT
, SWT
.FILL
, false, true, 1, 2));
366 fVerticalScrollBar
.addSelectionListener(new SelectionAdapter() {
368 public void widgetSelected(SelectionEvent e
) {
369 setTopIndex(fVerticalScrollBar
.getSelection());
372 fVerticalScrollBar
.setEnabled(false);
374 fTimeGraphCtrl
= createTimeGraphControl(fDataViewer
, fColorScheme
);
376 fTimeGraphCtrl
.setTimeProvider(this);
377 fTimeGraphCtrl
.setTimeGraphScale(fTimeScaleCtrl
);
378 fTimeGraphCtrl
.addSelectionListener(this);
379 fTimeGraphCtrl
.setLayoutData(new GridData(SWT
.FILL
, SWT
.FILL
, true, true, 1, 2));
380 fTimeGraphCtrl
.addMouseWheelListener(new MouseWheelListener() {
382 public void mouseScrolled(MouseEvent e
) {
383 adjustVerticalScrollBar();
386 fTimeGraphCtrl
.addKeyListener(new KeyAdapter() {
388 public void keyPressed(KeyEvent e
) {
389 if (e
.character
== '+') {
391 } else if (e
.character
== '-') {
394 adjustVerticalScrollBar();
398 Composite filler
= new Composite(fDataViewer
, SWT
.NONE
);
399 GridData gd
= new GridData(SWT
.DEFAULT
, SWT
.DEFAULT
, false, false);
400 gd
.heightHint
= fTimeGraphCtrl
.getHorizontalBar().getSize().y
;
401 filler
.setLayoutData(gd
);
402 filler
.setLayout(new FillLayout());
404 fTimeGraphCtrl
.addControlListener(new ControlAdapter() {
406 public void controlResized(ControlEvent event
) {
411 fDataViewer
.update();
412 adjustVerticalScrollBar();
419 public void dispose() {
421 fTimeGraphCtrl
.dispose();
422 fDataViewer
.dispose();
423 fColorScheme
.dispose();
427 * Create a new time graph control.
430 * The parent composite
433 * @return The new TimeGraphControl
436 protected TimeGraphControl
createTimeGraphControl(Composite parent
,
437 TimeGraphColorScheme colors
) {
438 return new TimeGraphControl(parent
, colors
);
442 * Resize the controls
444 public void resizeControls() {
445 Rectangle r
= fDataViewer
.getClientArea();
451 if (fNameWidth
> width
- fMinNameWidth
) {
452 fNameWidth
= width
- fMinNameWidth
;
454 if (fNameWidth
< fMinNameWidth
) {
455 fNameWidth
= fMinNameWidth
;
457 adjustVerticalScrollBar();
461 * Try to set most convenient time range for display.
464 * The traces in the model
466 public void setTimeRange(ITimeGraphEntry traces
[]) {
469 for (int i
= 0; i
< traces
.length
; i
++) {
470 ITimeGraphEntry entry
= traces
[i
];
471 if (entry
.getEndTime() >= entry
.getStartTime() && entry
.getEndTime() > 0) {
472 if (fBeginTime
< 0 || entry
.getStartTime() < fBeginTime
) {
473 fBeginTime
= entry
.getStartTime();
475 if (entry
.getEndTime() > fEndTime
) {
476 fEndTime
= entry
.getEndTime();
481 if (fBeginTime
< 0) {
487 * Recalculate the time bounds
489 public void setTimeBounds() {
490 fTime0Bound
= fBeginTime
;
491 if (fTime0Bound
< 0) {
494 fTime1Bound
= fEndTime
;
495 if (!fTimeRangeFixed
) {
496 fTime0
= fTime0Bound
;
497 fTime1
= fTime1Bound
;
499 fTime0
= Math
.max(fTime0Bound
, Math
.min(fTime0
, fTime1Bound
));
500 fTime1
= Math
.max(fTime0Bound
, Math
.min(fTime1
, fTime1Bound
));
501 if (fTime1
- fTime0
< fMinTimeInterval
) {
502 fTime1
= Math
.min(fTime1Bound
, fTime0
+ fMinTimeInterval
);
511 void updateInternalData(ITimeGraphEntry
[] traces
, long start
, long end
) {
512 ITimeGraphEntry
[] realTraces
= traces
;
514 if (null == realTraces
) {
515 realTraces
= new ITimeGraphEntry
[0];
517 if ((start
== 0 && end
== 0) || start
< 0 || end
< 0) {
518 // Start and end time are unspecified and need to be determined from
519 // individual processes
520 setTimeRange(realTraces
);
526 refreshAllData(realTraces
);
532 private void refreshAllData(ITimeGraphEntry
[] traces
) {
534 if (fSelectionBegin
< fBeginTime
) {
535 fSelectionBegin
= fBeginTime
;
536 } else if (fSelectionBegin
> fEndTime
) {
537 fSelectionBegin
= fEndTime
;
539 if (fSelectionEnd
< fBeginTime
) {
540 fSelectionEnd
= fBeginTime
;
541 } else if (fSelectionEnd
> fEndTime
) {
542 fSelectionEnd
= fEndTime
;
544 fTimeGraphCtrl
.refreshData(traces
);
545 fTimeScaleCtrl
.redraw();
546 adjustVerticalScrollBar();
550 * Callback for when this view is focused
552 public void setFocus() {
553 if (null != fTimeGraphCtrl
) {
554 fTimeGraphCtrl
.setFocus();
559 * Get the current focus status of this view.
561 * @return If the view is currently focused, or not
563 public boolean isInFocus() {
564 return fTimeGraphCtrl
.isInFocus();
568 * Get the view's current selection
570 * @return The entry that is selected
572 public ITimeGraphEntry
getSelection() {
573 return fTimeGraphCtrl
.getSelectedTrace();
577 * Get the index of the current selection
581 public int getSelectionIndex() {
582 return fTimeGraphCtrl
.getSelectedIndex();
586 public long getTime0() {
591 public long getTime1() {
596 public long getMinTimeInterval() {
597 return fMinTimeInterval
;
601 public int getNameSpace() {
606 public void setNameSpace(int width
) {
608 int w
= fTimeGraphCtrl
.getClientArea().width
;
609 if (fNameWidth
> w
- MIN_NAME_WIDTH
) {
610 fNameWidth
= w
- MIN_NAME_WIDTH
;
612 if (fNameWidth
< MIN_NAME_WIDTH
) {
613 fNameWidth
= MIN_NAME_WIDTH
;
615 fTimeGraphCtrl
.adjustScrolls();
616 fTimeGraphCtrl
.redraw();
617 fTimeScaleCtrl
.redraw();
621 public int getTimeSpace() {
622 int w
= fTimeGraphCtrl
.getClientArea().width
;
623 return w
- fNameWidth
;
627 public long getBeginTime() {
632 public long getEndTime() {
637 public long getMaxTime() {
642 public long getMinTime() {
650 public long getSelectionBegin() {
651 return fSelectionBegin
;
658 public long getSelectionEnd() {
659 return fSelectionEnd
;
663 public void setStartFinishTimeNotify(long time0
, long time1
) {
664 setStartFinishTime(time0
, time1
);
665 notifyRangeListeners(fTime0
, fTime1
);
669 public void notifyStartFinishTime() {
670 notifyRangeListeners(fTime0
, fTime1
);
674 public void setStartFinishTime(long time0
, long time1
) {
676 if (fTime0
< fTime0Bound
) {
677 fTime0
= fTime0Bound
;
679 if (fTime0
> fTime1Bound
) {
680 fTime0
= fTime1Bound
;
683 if (fTime1
< fTime0Bound
) {
684 fTime1
= fTime0Bound
;
686 if (fTime1
> fTime1Bound
) {
687 fTime1
= fTime1Bound
;
689 if (fTime1
- fTime0
< fMinTimeInterval
) {
690 fTime1
= Math
.min(fTime1Bound
, fTime0
+ fMinTimeInterval
);
692 fTimeRangeFixed
= true;
693 fTimeGraphCtrl
.adjustScrolls();
694 fTimeGraphCtrl
.redraw();
695 fTimeScaleCtrl
.redraw();
699 * Set the time bounds to the provided values
702 * The start time of the window
706 public void setTimeBounds(long beginTime
, long endTime
) {
707 if (endTime
>= beginTime
) {
708 fBeginTime
= beginTime
;
710 fTime0Bound
= beginTime
;
711 fTime1Bound
= endTime
;
718 fTimeGraphCtrl
.adjustScrolls();
722 public void resetStartFinishTime() {
723 setStartFinishTime(fTime0Bound
, fTime1Bound
);
724 fTimeRangeFixed
= false;
728 public void setSelectedTimeNotify(long time
, boolean ensureVisible
) {
729 setSelectedTimeInt(time
, ensureVisible
, true);
733 public void setSelectedTime(long time
, boolean ensureVisible
) {
734 setSelectedTimeInt(time
, ensureVisible
, false);
741 public void setSelectionRangeNotify(long beginTime
, long endTime
) {
742 boolean changed
= (beginTime
!= fSelectionBegin
|| endTime
!= fSelectionEnd
);
743 fSelectionBegin
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, beginTime
));
744 fSelectionEnd
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, endTime
));
745 fTimeGraphCtrl
.redraw();
746 fTimeScaleCtrl
.redraw();
748 notifyTimeListeners(fSelectionBegin
, fSelectionEnd
);
756 public void setSelectionRange(long beginTime
, long endTime
) {
757 fSelectionBegin
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, beginTime
));
758 fSelectionEnd
= Math
.max(fTime0Bound
, Math
.min(fTime1Bound
, endTime
));
759 fTimeGraphCtrl
.redraw();
760 fTimeScaleCtrl
.redraw();
763 private void setSelectedTimeInt(long time
, boolean ensureVisible
, boolean doNotify
) {
767 long timeSpace
= (fTime1
- fTime0
) / RECENTERING_MARGIN_FACTOR
;
768 long timeMid
= (fTime1
- fTime0
) / 2;
769 if (time
< fTime0
+ timeSpace
) {
770 long dt
= fTime0
- time
+ timeMid
;
773 } else if (time
> fTime1
- timeSpace
) {
774 long dt
= time
- fTime1
+ timeMid
;
778 if (fTime0
< fTime0Bound
) {
779 fTime1
= Math
.min(fTime1Bound
, fTime1
+ (fTime0Bound
- fTime0
));
780 fTime0
= fTime0Bound
;
781 } else if (fTime1
> fTime1Bound
) {
782 fTime0
= Math
.max(fTime0Bound
, fTime0
- (fTime1
- fTime1Bound
));
783 fTime1
= fTime1Bound
;
786 if (fTime1
- fTime0
< fMinTimeInterval
) {
787 fTime1
= Math
.min(fTime1Bound
, fTime0
+ fMinTimeInterval
);
789 fTimeGraphCtrl
.adjustScrolls();
790 fTimeGraphCtrl
.redraw();
791 fTimeScaleCtrl
.redraw();
793 boolean notifySelectedTime
= (time
!= fSelectionBegin
|| time
!= fSelectionEnd
);
794 fSelectionBegin
= time
;
795 fSelectionEnd
= time
;
797 if (doNotify
&& ((time0
!= fTime0
) || (time1
!= fTime1
))) {
798 notifyRangeListeners(fTime0
, fTime1
);
801 if (doNotify
&& notifySelectedTime
) {
802 notifyTimeListeners(fSelectionBegin
, fSelectionEnd
);
807 public void widgetDefaultSelected(SelectionEvent e
) {
808 if (fSelectedEntry
!= getSelection()) {
809 fSelectedEntry
= getSelection();
810 notifySelectionListeners(fSelectedEntry
);
815 public void widgetSelected(SelectionEvent e
) {
816 if (fSelectedEntry
!= getSelection()) {
817 fSelectedEntry
= getSelection();
818 notifySelectionListeners(fSelectedEntry
);
823 * Callback for when the next event is selected
825 public void selectNextEvent() {
826 fTimeGraphCtrl
.selectNextEvent();
827 adjustVerticalScrollBar();
831 * Callback for when the previous event is selected
833 public void selectPrevEvent() {
834 fTimeGraphCtrl
.selectPrevEvent();
835 adjustVerticalScrollBar();
839 * Callback for when the next item is selected
841 public void selectNextItem() {
842 fTimeGraphCtrl
.selectNextTrace();
843 adjustVerticalScrollBar();
847 * Callback for when the previous item is selected
849 public void selectPrevItem() {
850 fTimeGraphCtrl
.selectPrevTrace();
851 adjustVerticalScrollBar();
855 * Callback for the show legend action
857 public void showLegend() {
858 if (fDataViewer
== null || fDataViewer
.isDisposed()) {
862 TimeGraphLegend
.open(fDataViewer
.getShell(), fTimeGraphProvider
);
866 * Callback for the Zoom In action
868 public void zoomIn() {
869 fTimeGraphCtrl
.zoomIn();
873 * Callback for the Zoom Out action
875 public void zoomOut() {
876 fTimeGraphCtrl
.zoomOut();
879 private String
getPreferenceString(String string
) {
880 return getViewTypeStr() + "." + string
; //$NON-NLS-1$
884 * Add a selection listener
887 * The listener to add
889 public void addSelectionListener(ITimeGraphSelectionListener listener
) {
890 fSelectionListeners
.add(listener
);
894 * Remove a selection listener
897 * The listener to remove
899 public void removeSelectionListener(ITimeGraphSelectionListener listener
) {
900 fSelectionListeners
.remove(listener
);
903 private void notifySelectionListeners(ITimeGraphEntry selection
) {
904 TimeGraphSelectionEvent event
= new TimeGraphSelectionEvent(this, selection
);
906 for (ITimeGraphSelectionListener listener
: fSelectionListeners
) {
907 listener
.selectionChanged(event
);
912 * Add a time listener
915 * The listener to add
917 public void addTimeListener(ITimeGraphTimeListener listener
) {
918 fTimeListeners
.add(listener
);
922 * Remove a time listener
925 * The listener to remove
927 public void removeTimeListener(ITimeGraphTimeListener listener
) {
928 fTimeListeners
.remove(listener
);
931 private void notifyTimeListeners(long startTime
, long endTime
) {
932 TimeGraphTimeEvent event
= new TimeGraphTimeEvent(this, startTime
, endTime
);
934 for (ITimeGraphTimeListener listener
: fTimeListeners
) {
935 listener
.timeSelected(event
);
940 * Add a range listener
943 * The listener to add
945 public void addRangeListener(ITimeGraphRangeListener listener
) {
946 fRangeListeners
.add(listener
);
950 * Remove a range listener
953 * The listener to remove
955 public void removeRangeListener(ITimeGraphRangeListener listener
) {
956 fRangeListeners
.remove(listener
);
959 private void notifyRangeListeners(long startTime
, long endTime
) {
960 // Check if the time has actually changed from last notification
961 if (startTime
!= fTime0ExtSynch
|| endTime
!= fTime1ExtSynch
) {
962 // Notify Time Scale Selection Listeners
963 TimeGraphRangeUpdateEvent event
= new TimeGraphRangeUpdateEvent(this, startTime
, endTime
);
965 for (ITimeGraphRangeListener listener
: fRangeListeners
) {
966 listener
.timeRangeUpdated(event
);
969 // update external synch timers
970 updateExtSynchTimers();
975 * Callback to set a selected event in the view
978 * The event that was selected
980 * The source of this selection event
982 public void setSelectedEvent(ITimeEvent event
, Object source
) {
983 if (event
== null || source
== this) {
986 fSelectedEntry
= event
.getEntry();
987 fTimeGraphCtrl
.selectItem(fSelectedEntry
, false);
989 setSelectedTimeInt(event
.getTime(), true, true);
990 adjustVerticalScrollBar();
994 * Set the seeked time of a trace
997 * The trace that was seeked
1001 * The source of this seek event
1003 public void setSelectedTraceTime(ITimeGraphEntry trace
, long time
, Object source
) {
1004 if (trace
== null || source
== this) {
1007 fSelectedEntry
= trace
;
1008 fTimeGraphCtrl
.selectItem(trace
, false);
1010 setSelectedTimeInt(time
, true, true);
1014 * Callback for a trace selection
1017 * The trace that was selected
1019 public void setSelection(ITimeGraphEntry trace
) {
1020 fSelectedEntry
= trace
;
1021 fTimeGraphCtrl
.selectItem(trace
, false);
1022 adjustVerticalScrollBar();
1026 * Callback for a time window selection
1029 * Start time of the range
1031 * End time of the range
1033 * Source of the event
1035 public void setSelectVisTimeWindow(long time0
, long time1
, Object source
) {
1036 if (source
== this) {
1040 setStartFinishTime(time0
, time1
);
1042 // update notification time values since we are now in synch with the
1043 // external application
1044 updateExtSynchTimers();
1048 * update the cache timers used to identify the need to send a time window
1049 * update to external registered listeners
1051 private void updateExtSynchTimers() {
1052 // last time notification cache
1053 fTime0ExtSynch
= fTime0
;
1054 fTime1ExtSynch
= fTime1
;
1061 public TimeFormat
getTimeFormat() {
1067 * the {@link TimeFormat} used to display timestamps
1070 public void setTimeFormat(TimeFormat tf
) {
1071 this.fTimeFormat
= tf
;
1072 if (tf
== TimeFormat
.CYCLES
) {
1073 fTimeDataProvider
= new TimeDataProviderCyclesConverter(this, fClockFrequency
);
1075 fTimeDataProvider
= this;
1077 fTimeScaleCtrl
.setTimeProvider(fTimeDataProvider
);
1078 if (fToolTipHandler
!= null) {
1079 fToolTipHandler
.setTimeProvider(fTimeDataProvider
);
1084 * Sets the clock frequency. Used when the time format is set to CYCLES.
1086 * @param clockFrequency
1087 * the clock frequency in Hz
1090 public void setClockFrequency(long clockFrequency
) {
1091 fClockFrequency
= clockFrequency
;
1092 if (fTimeFormat
== TimeFormat
.CYCLES
) {
1093 fTimeDataProvider
= new TimeDataProviderCyclesConverter(this, fClockFrequency
);
1094 fTimeScaleCtrl
.setTimeProvider(fTimeDataProvider
);
1095 if (fToolTipHandler
!= null) {
1096 fToolTipHandler
.setTimeProvider(fTimeDataProvider
);
1102 * Retrieve the border width
1106 public int getBorderWidth() {
1107 return fBorderWidth
;
1111 * Set the border width
1113 * @param borderWidth
1116 public void setBorderWidth(int borderWidth
) {
1117 if (borderWidth
> -1) {
1118 this.fBorderWidth
= borderWidth
;
1119 GridLayout gl
= (GridLayout
) fDataViewer
.getLayout();
1120 gl
.marginHeight
= borderWidth
;
1125 * Retrieve the height of the header
1127 * @return The height
1129 public int getHeaderHeight() {
1130 return fTimeScaleHeight
;
1134 * Set the height of the header
1136 * @param headerHeight
1139 public void setHeaderHeight(int headerHeight
) {
1140 if (headerHeight
> -1) {
1141 this.fTimeScaleHeight
= headerHeight
;
1142 fTimeScaleCtrl
.setHeight(headerHeight
);
1147 * Retrieve the height of an item row
1149 * @return The height
1151 public int getItemHeight() {
1152 if (fTimeGraphCtrl
!= null) {
1153 return fTimeGraphCtrl
.getItemHeight();
1159 * Set the height of an item row
1164 public void setItemHeight(int rowHeight
) {
1165 if (fTimeGraphCtrl
!= null) {
1166 fTimeGraphCtrl
.setItemHeight(rowHeight
);
1171 * Set the minimum item width
1176 public void setMinimumItemWidth(int width
) {
1177 if (fTimeGraphCtrl
!= null) {
1178 fTimeGraphCtrl
.setMinimumItemWidth(width
);
1183 * Set the width for the name column
1188 public void setNameWidthPref(int width
) {
1189 fNameWidthPref
= width
;
1197 * Retrieve the configure width for the name column
1203 public int getNameWidthPref(int width
) {
1204 return fNameWidthPref
;
1208 * Returns the primary control associated with this viewer.
1210 * @return the SWT control which displays this viewer's content
1212 public Control
getControl() {
1217 * Returns the time graph control associated with this viewer.
1219 * @return the time graph control
1222 public TimeGraphControl
getTimeGraphControl() {
1223 return fTimeGraphCtrl
;
1227 * Returns the time graph scale associated with this viewer.
1229 * @return the time graph scale
1232 public TimeGraphScale
getTimeGraphScale() {
1233 return fTimeScaleCtrl
;
1237 * Return the x coordinate corresponding to a time
1241 * @return the x coordinate corresponding to the time
1245 public int getXForTime(long time
) {
1246 return fTimeGraphCtrl
.getXForTime(time
);
1250 * Return the time corresponding to an x coordinate
1254 * @return the time corresponding to the x coordinate
1258 public long getTimeAtX(int x
) {
1259 return fTimeGraphCtrl
.getTimeAtX(x
);
1263 * Get the selection provider
1265 * @return the selection provider
1267 public ISelectionProvider
getSelectionProvider() {
1268 return fTimeGraphCtrl
;
1272 * Wait for the cursor
1275 * Wait indefinitely?
1277 public void waitCursor(boolean waitInd
) {
1278 fTimeGraphCtrl
.waitCursor(waitInd
);
1282 * Get the horizontal scroll bar object
1284 * @return The scroll bar
1286 public ScrollBar
getHorizontalBar() {
1287 return fTimeGraphCtrl
.getHorizontalBar();
1291 * Get the vertical scroll bar object
1293 * @return The scroll bar
1295 public Slider
getVerticalBar() {
1296 return fVerticalScrollBar
;
1300 * Set the given index as the top one
1303 * The index that will go to the top
1305 public void setTopIndex(int index
) {
1306 fTimeGraphCtrl
.setTopIndex(index
);
1307 adjustVerticalScrollBar();
1311 * Retrieve the current top index
1313 * @return The top index
1315 public int getTopIndex() {
1316 return fTimeGraphCtrl
.getTopIndex();
1320 * Sets the auto-expand level to be used when the input of the viewer is set
1321 * using {@link #setInput(Object)}. The value 0 means that there is no
1322 * auto-expand; 1 means that top-level elements are expanded, but not their
1323 * children; 2 means that top-level elements are expanded, and their
1324 * children, but not grand-children; and so on.
1326 * The value {@link #ALL_LEVELS} means that all subtrees should be expanded.
1329 * non-negative level, or <code>ALL_LEVELS</code> to expand all
1330 * levels of the tree
1333 public void setAutoExpandLevel(int level
) {
1334 fTimeGraphCtrl
.setAutoExpandLevel(level
);
1338 * Returns the auto-expand level.
1340 * @return non-negative level, or <code>ALL_LEVELS</code> if all levels of
1341 * the tree are expanded automatically
1342 * @see #setAutoExpandLevel
1345 public int getAutoExpandLevel() {
1346 return fTimeGraphCtrl
.getAutoExpandLevel();
1350 * Set the expanded state of an entry
1353 * The entry to expand/collapse
1355 * True for expanded, false for collapsed
1357 public void setExpandedState(ITimeGraphEntry entry
, boolean expanded
) {
1358 fTimeGraphCtrl
.setExpandedState(entry
, expanded
);
1359 adjustVerticalScrollBar();
1363 * Collapses all nodes of the viewer's tree, starting with the root.
1367 public void collapseAll() {
1368 fTimeGraphCtrl
.collapseAll();
1369 adjustVerticalScrollBar();
1373 * Expands all nodes of the viewer's tree, starting with the root.
1377 public void expandAll() {
1378 fTimeGraphCtrl
.expandAll();
1379 adjustVerticalScrollBar();
1383 * Get the number of sub-elements when expanded
1385 * @return The element count
1387 public int getExpandedElementCount() {
1388 return fTimeGraphCtrl
.getExpandedElementCount();
1392 * Get the sub-elements
1394 * @return The array of entries that are below this one
1396 public ITimeGraphEntry
[] getExpandedElements() {
1397 return fTimeGraphCtrl
.getExpandedElements();
1401 * Add a tree listener
1404 * The listener to add
1406 public void addTreeListener(ITimeGraphTreeListener listener
) {
1407 fTimeGraphCtrl
.addTreeListener(listener
);
1411 * Remove a tree listener
1414 * The listener to remove
1416 public void removeTreeListener(ITimeGraphTreeListener listener
) {
1417 fTimeGraphCtrl
.removeTreeListener(listener
);
1421 * Get the reset scale action.
1423 * @return The Action object
1425 public Action
getResetScaleAction() {
1426 if (fResetScaleAction
== null) {
1428 fResetScaleAction
= new Action() {
1431 resetStartFinishTime();
1432 notifyStartFinishTime();
1435 fResetScaleAction
.setText(Messages
.TmfTimeGraphViewer_ResetScaleActionNameText
);
1436 fResetScaleAction
.setToolTipText(Messages
.TmfTimeGraphViewer_ResetScaleActionToolTipText
);
1437 fResetScaleAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_HOME_MENU
));
1439 return fResetScaleAction
;
1443 * Get the show legend action.
1445 * @return The Action object
1447 public Action
getShowLegendAction() {
1448 if (fShowLegendAction
== null) {
1450 fShowLegendAction
= new Action() {
1456 fShowLegendAction
.setText(Messages
.TmfTimeGraphViewer_LegendActionNameText
);
1457 fShowLegendAction
.setToolTipText(Messages
.TmfTimeGraphViewer_LegendActionToolTipText
);
1458 fShowLegendAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_SHOW_LEGEND
));
1461 return fShowLegendAction
;
1465 * Get the the next event action.
1467 * @return The action object
1469 public Action
getNextEventAction() {
1470 if (fNextEventAction
== null) {
1471 fNextEventAction
= new Action() {
1478 fNextEventAction
.setText(Messages
.TmfTimeGraphViewer_NextEventActionNameText
);
1479 fNextEventAction
.setToolTipText(Messages
.TmfTimeGraphViewer_NextEventActionToolTipText
);
1480 fNextEventAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_NEXT_EVENT
));
1483 return fNextEventAction
;
1487 * Get the previous event action.
1489 * @return The Action object
1491 public Action
getPreviousEventAction() {
1492 if (fPrevEventAction
== null) {
1493 fPrevEventAction
= new Action() {
1500 fPrevEventAction
.setText(Messages
.TmfTimeGraphViewer_PreviousEventActionNameText
);
1501 fPrevEventAction
.setToolTipText(Messages
.TmfTimeGraphViewer_PreviousEventActionToolTipText
);
1502 fPrevEventAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_PREV_EVENT
));
1505 return fPrevEventAction
;
1509 * Get the next item action.
1511 * @return The Action object
1513 public Action
getNextItemAction() {
1514 if (fNextItemAction
== null) {
1516 fNextItemAction
= new Action() {
1522 fNextItemAction
.setText(Messages
.TmfTimeGraphViewer_NextItemActionNameText
);
1523 fNextItemAction
.setToolTipText(Messages
.TmfTimeGraphViewer_NextItemActionToolTipText
);
1524 fNextItemAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_NEXT_ITEM
));
1526 return fNextItemAction
;
1530 * Get the previous item action.
1532 * @return The Action object
1534 public Action
getPreviousItemAction() {
1535 if (fPreviousItemAction
== null) {
1537 fPreviousItemAction
= new Action() {
1543 fPreviousItemAction
.setText(Messages
.TmfTimeGraphViewer_PreviousItemActionNameText
);
1544 fPreviousItemAction
.setToolTipText(Messages
.TmfTimeGraphViewer_PreviousItemActionToolTipText
);
1545 fPreviousItemAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_PREV_ITEM
));
1547 return fPreviousItemAction
;
1551 * Get the zoom in action
1553 * @return The Action object
1555 public Action
getZoomInAction() {
1556 if (fZoomInAction
== null) {
1557 fZoomInAction
= new Action() {
1563 fZoomInAction
.setText(Messages
.TmfTimeGraphViewer_ZoomInActionNameText
);
1564 fZoomInAction
.setToolTipText(Messages
.TmfTimeGraphViewer_ZoomInActionToolTipText
);
1565 fZoomInAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_ZOOM_IN_MENU
));
1567 return fZoomInAction
;
1571 * Get the zoom out action
1573 * @return The Action object
1575 public Action
getZoomOutAction() {
1576 if (fZoomOutAction
== null) {
1577 fZoomOutAction
= new Action() {
1583 fZoomOutAction
.setText(Messages
.TmfTimeGraphViewer_ZoomOutActionNameText
);
1584 fZoomOutAction
.setToolTipText(Messages
.TmfTimeGraphViewer_ZoomOutActionToolTipText
);
1585 fZoomOutAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_ZOOM_OUT_MENU
));
1587 return fZoomOutAction
;
1591 * Get the hide arrows action
1593 * @param dialogSettings
1594 * The dialog settings section where the state should be stored,
1597 * @return The Action object
1601 public Action
getHideArrowsAction(final IDialogSettings dialogSettings
) {
1602 if (fHideArrowsAction
== null) {
1603 fHideArrowsAction
= new Action(Messages
.TmfTimeGraphViewer_HideArrowsActionNameText
, IAction
.AS_CHECK_BOX
) {
1606 boolean hideArrows
= fHideArrowsAction
.isChecked();
1607 fTimeGraphCtrl
.hideArrows(hideArrows
);
1609 if (dialogSettings
!= null) {
1610 dialogSettings
.put(HIDE_ARROWS_KEY
, hideArrows
);
1612 if (fFollowArrowFwdAction
!= null) {
1613 fFollowArrowFwdAction
.setEnabled(!hideArrows
);
1615 if (fFollowArrowBwdAction
!= null) {
1616 fFollowArrowBwdAction
.setEnabled(!hideArrows
);
1620 fHideArrowsAction
.setToolTipText(Messages
.TmfTimeGraphViewer_HideArrowsActionToolTipText
);
1621 fHideArrowsAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_HIDE_ARROWS
));
1622 if (dialogSettings
!= null) {
1623 boolean hideArrows
= dialogSettings
.getBoolean(HIDE_ARROWS_KEY
);
1624 fTimeGraphCtrl
.hideArrows(hideArrows
);
1625 fHideArrowsAction
.setChecked(hideArrows
);
1626 if (fFollowArrowFwdAction
!= null) {
1627 fFollowArrowFwdAction
.setEnabled(!hideArrows
);
1629 if (fFollowArrowBwdAction
!= null) {
1630 fFollowArrowBwdAction
.setEnabled(!hideArrows
);
1634 return fHideArrowsAction
;
1638 * Get the follow arrow forward action.
1640 * @return The Action object
1644 public Action
getFollowArrowFwdAction() {
1645 if (fFollowArrowFwdAction
== null) {
1646 fFollowArrowFwdAction
= new Action() {
1649 fTimeGraphCtrl
.followArrowFwd();
1650 adjustVerticalScrollBar();
1653 fFollowArrowFwdAction
.setText(Messages
.TmfTimeGraphViewer_FollowArrowForwardActionNameText
);
1654 fFollowArrowFwdAction
.setToolTipText(Messages
.TmfTimeGraphViewer_FollowArrowForwardActionToolTipText
);
1655 fFollowArrowFwdAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_FOLLOW_ARROW_FORWARD
));
1656 if (fHideArrowsAction
!= null) {
1657 fFollowArrowFwdAction
.setEnabled(!fHideArrowsAction
.isChecked());
1660 return fFollowArrowFwdAction
;
1664 * Get the follow arrow backward action.
1666 * @return The Action object
1670 public Action
getFollowArrowBwdAction() {
1671 if (fFollowArrowBwdAction
== null) {
1672 fFollowArrowBwdAction
= new Action() {
1675 fTimeGraphCtrl
.followArrowBwd();
1676 adjustVerticalScrollBar();
1679 fFollowArrowBwdAction
.setText(Messages
.TmfTimeGraphViewer_FollowArrowBackwardActionNameText
);
1680 fFollowArrowBwdAction
.setToolTipText(Messages
.TmfTimeGraphViewer_FollowArrowBackwardActionToolTipText
);
1681 fFollowArrowBwdAction
.setImageDescriptor(Activator
.getDefault().getImageDescripterFromPath(ITmfImageConstants
.IMG_UI_FOLLOW_ARROW_BACKWARD
));
1682 if (fHideArrowsAction
!= null) {
1683 fFollowArrowBwdAction
.setEnabled(!fHideArrowsAction
.isChecked());
1686 return fFollowArrowBwdAction
;
1689 private void adjustVerticalScrollBar() {
1690 int topIndex
= fTimeGraphCtrl
.getTopIndex();
1691 int countPerPage
= fTimeGraphCtrl
.countPerPage();
1692 int expandedElementCount
= fTimeGraphCtrl
.getExpandedElementCount();
1693 if (topIndex
+ countPerPage
> expandedElementCount
) {
1694 fTimeGraphCtrl
.setTopIndex(Math
.max(0, expandedElementCount
- countPerPage
));
1697 int selection
= fTimeGraphCtrl
.getTopIndex();
1699 int max
= Math
.max(1, expandedElementCount
- 1);
1700 int thumb
= Math
.min(max
, Math
.max(1, countPerPage
- 1));
1702 int pageIncrement
= Math
.max(1, countPerPage
);
1703 fVerticalScrollBar
.setValues(selection
, min
, max
, thumb
, increment
, pageIncrement
);
1708 * a {@link MenuDetectListener}
1709 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#addTimeGraphEntryMenuListener(org.eclipse.swt.events.MenuDetectListener)
1712 public void addTimeGraphEntryMenuListener(MenuDetectListener listener
) {
1713 fTimeGraphCtrl
.addTimeGraphEntryMenuListener(listener
);
1718 * a {@link MenuDetectListener}
1719 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#removeTimeGraphEntryMenuListener(org.eclipse.swt.events.MenuDetectListener)
1722 public void removeTimeGraphEntryMenuListener(MenuDetectListener listener
) {
1723 fTimeGraphCtrl
.removeTimeGraphEntryMenuListener(listener
);
1728 * a {@link MenuDetectListener}
1729 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#addTimeEventMenuListener(org.eclipse.swt.events.MenuDetectListener)
1732 public void addTimeEventMenuListener(MenuDetectListener listener
) {
1733 fTimeGraphCtrl
.addTimeEventMenuListener(listener
);
1738 * a {@link MenuDetectListener}
1739 * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#removeTimeEventMenuListener(org.eclipse.swt.events.MenuDetectListener)
1742 public void removeTimeEventMenuListener(MenuDetectListener listener
) {
1743 fTimeGraphCtrl
.removeTimeEventMenuListener(listener
);
1748 * The filter object to be attached to the view
1751 public void addFilter(ViewerFilter filter
) {
1752 fTimeGraphCtrl
.addFilter(filter
);
1758 * The filter object to be attached to the view
1761 public void removeFilter(ViewerFilter filter
) {
1762 fTimeGraphCtrl
.removeFilter(filter
);