1 /*******************************************************************************
2 * Copyright (c) 2016 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.views
.latency
;
11 import static org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
.checkNotNull
;
13 import org
.eclipse
.jdt
.annotation
.NonNull
;
14 import org
.eclipse
.jface
.util
.IPropertyChangeListener
;
15 import org
.eclipse
.jface
.util
.PropertyChangeEvent
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
17 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.TmfXmlUiStrings
;
18 import org
.eclipse
.tracecompass
.internal
.tmf
.analysis
.xml
.ui
.views
.XmlLatencyViewInfo
;
19 import org
.eclipse
.tracecompass
.tmf
.ui
.viewers
.xycharts
.TmfXYChartViewer
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.TmfChartView
;
23 * The scatter graph view for pattern latency
25 * @author Jean-Christian Kouame
27 public class PatternScatterGraphView
extends TmfChartView
{
30 public static final @NonNull String ID
= "org.eclipse.tracecompass.internal.tmf.analysis.xml.ui.views.scattergraph"; //$NON-NLS-1$
32 private final XmlLatencyViewInfo fViewInfo
= new XmlLatencyViewInfo(ID
);
34 private PatternScatterGraphViewer fViewer
;
39 public PatternScatterGraphView() {
41 this.addPartPropertyListener(new IPropertyChangeListener() {
43 public void propertyChange(PropertyChangeEvent event
) {
44 if (event
.getProperty().equals(TmfXmlUiStrings
.XML_LATENCY_OUTPUT_DATA
)) {
45 Object newValue
= event
.getNewValue();
46 if (newValue
instanceof String
) {
47 String data
= (String
) newValue
;
48 fViewInfo
.setViewData(data
);
56 private void loadLatencyView() {
57 if (fViewer
!= null) {
58 fViewer
.updateViewer(fViewInfo
.getViewAnalysisId());
63 protected TmfXYChartViewer
createChartViewer(Composite parent
) {
64 PatternScatterGraphViewer viewer
= new PatternScatterGraphViewer(checkNotNull(parent
), checkNotNull(Messages
.PatternLatencyViews_ScatterGraphTitle
), checkNotNull(Messages
.PatternLatencyViews_ScatterGraphXLabel
), checkNotNull(Messages
.PatternLatencyViews_ScatterGraphYLabel
));