* Signal handling (@TmfSignalHandler)
* Data requests (TmfEventRequest)
* SWTChart integration
+* Use of the pin feature
'''Note''': Trace Compass 0.1.0 provides base implementations for generating SWTChart viewers and views. For more details please refer to chapter [[#TMF Built-in Views and Viewers]].
In summary, we have implemented a simple TMF view using the SWTChart library. We made use of signals and requests to populate the view at the appropriate time and we formated the time stamps nicely. We also made sure that the time stamp format is updated when the preferences change.
+==== Pin feature ====
+
+The pin feature allow freezing a view. How it freezes is up to the view itself. Normally a pinned view
+will not synchronize on active trace changes, visual time range changes, selection time changes, marker updates etc.
+
+By default TmfView provides a pin button in its toolbar.<br>
+[[Image:images/TmfViewPinAction.png]]<br>
+
+By default nothing is done on button click, <code>setPinned</code> needs to be overridden to take action on user interaction. It is the view's responsibility to propagate the pinned state to its children (controls, scroll bars, etc.).
+
+e.g. <code>setPinned</code> from ControlFlowView:
+<pre>
+ @Override
+ protected synchronized void setPinned(boolean pinned) {
+
+ /* Is pinned */
+ if (pinned) {
+ /* Ignore all outbound and inbound signal */
+ TmfSignalManager.addIgnoredOutboundSignal(this, TmfSignal.class);
+ TmfSignalManager.addIgnoredInboundSignal(this, TmfSignal.class);
+
+ String objectType = Messages.ControlFlowView_TraceLabel;
+ if (getTrace() instanceof TmfExperiment) {
+ objectType = Messages.ControlFlowView_ExperimentLabel;
+ }
+ setPartName(String.format("%s [%s][%s:%s]", fOriginalTabLabel, Messages.ControlFlowView_PinnedLabel, objectType, getTrace().getName())); //$NON-NLS-1$
+ } else {
+ TmfSignalManager.clearIgnoredInboundSignalList(this);
+ TmfSignalManager.clearIgnoredOutboundSignalList(this);
+
+ setPartName(fOriginalTabLabel);
+
+ loadTrace(TmfTraceManager.getInstance().getActiveTrace());
+ }
+
+ boolean enabled = !pinned;
+
+ fFlatAction.setEnabled(enabled);
+ fHierarchicalAction.setEnabled(enabled);
+ fOptimizationAction.setEnabled(enabled);
+ fPreviousEventAction.setEnabled(enabled);
+ fNextEventAction.setEnabled(enabled);
+ fThreadPresentationMenu.setVisible(enabled);
+ fThreadPresentationMenu.markDirty();
+
+ fShowFollowThreadAction = enabled;
+
+ /* Propagate pin state to viewer */
+ if (getTimeGraphCombo() != null) {
+ getTimeGraphCombo().setPinned(pinned);
+ } else {
+ getTimeGraphViewer().setPinned(pinned);
+ }
+
+ redraw();
+ }
+
+</pre>
+
+==== Disabling the pin feature ====
+
+If one wishes to disable the pin feature the <code>canBePinned</code> method can be overridden to return false. By default this function returns <code>True</code>.
+
+e.g.:
+
+<pre>
+ @Override
+ protected boolean canBePinned() {
+ return false;
+ }
+</pre>
+
== TMF Built-in Views and Viewers ==
TMF provides base implementations for several types of views and viewers for generating custom X-Y-Charts, Time Graphs, or Trees. They are well integrated with various TMF features such as reading traces and time synchronization with other views. They also handle mouse events for navigating the trace and view, zooming or presenting detailed information at mouse position. The code can be found in the TMF UI plug-in ''org.eclipse.tracecompass.tmf.ui''. See below for a list of relevant java packages:
The Control Flow View '''toolbar''', located at the top right of the view, has shortcut buttons to perform common actions:
{|
+| [[Image:images/pin_view.gif]]
+| Pin view
+| Pin and unpin a view. A pinned Control Flow view is frozen in time and associated with the trace selected at the time of pinning. When the unpin button is clicked the view synchronizes back with the current state (trace, visible time range, time range selection, etc.).
+|-
| [[Image:images/link.gif]]
| Align Views
| Disable and enable the automatic time axis alignment of time-based views. Disabling the alignment in this view will disable this feature across all the views because it's a workspace preference.
The Resources View '''toolbar''', located at the top right of the view, has shortcut buttons to perform common actions:
{|
+| [[Image:images/pin_view.gif]]
+| Pin view
+| Pin and unpin a view. A pinned Resources view is frozen in time and associated with the trace selected at the time of pinning. When the unpin button is clicked the view synchronizes back with the current state (trace, visible time range, time range selection, etc.).
+|-
| [[Image:images/link.gif]]
| Align Views
| Disable and enable the automatic time axis alignment of time-based views. Disabling the alignment in this view will disable this feature across all the views because it's a workspace preference.