import java.util.Comparator;
import java.util.List;
+import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.nebula.widgets.grid.GridColumn;
import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
import org.tizen.dynamicanalyzer.swap.model.data.SyncData;
+import org.tizen.dynamicanalyzer.ui.file.FileChartView;
+import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.memory.MemoryChartView;
+import org.tizen.dynamicanalyzer.ui.memory.MemoryPage;
+import org.tizen.dynamicanalyzer.ui.network.NetworkChartView;
+import org.tizen.dynamicanalyzer.ui.network.NetworkPage;
+import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
+import org.tizen.dynamicanalyzer.ui.opengl.chart.GLChartView;
+import org.tizen.dynamicanalyzer.ui.page.BaseView;
+import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
+import org.tizen.dynamicanalyzer.ui.thread.chart.ThreadChartView;
import org.tizen.dynamicanalyzer.ui.thread.data.ThreadDataManager;
import org.tizen.dynamicanalyzer.ui.thread.db.SyncAPIDBTable;
import org.tizen.dynamicanalyzer.ui.thread.db.ThreadAPIDBTable;
import org.tizen.dynamicanalyzer.ui.thread.type.ThreadPageSyncData;
import org.tizen.dynamicanalyzer.ui.thread.type.ThreadPageSyncDataEvent;
import org.tizen.dynamicanalyzer.ui.thread.type.ThreadPageThreadData;
+import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartView;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.ui.widgets.table.DAApiListTableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.util.Logger;
+import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
+import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.Formatter;
public class ThreadAPIListTable extends DAApiListTableComposite {
// do nothing
}
});
+
+ table.addMouseListener(new MouseListener() {
+
+ @Override
+ public void mouseUp(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDown(MouseEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
+ GridItem[] ti = ((Grid) e.widget).getSelection();
+ if (null == ti || ti.length == 0) {
+ return;
+ }
+ List<Object> markerData = ((DATableDataFormat) ti[0].getData()).getData();
+ long markerTime = Long.parseLong((String)markerData.get(1));
+ addMarker(markerTime);
+ }
+ });
+ }
+
+ private void addMarker(long markerTime) {
+ double startMarkerTime = markerTime / (TimelineConstants.MEGA_DOUBLE);
+
+ TimelineChartView TLchartView = (TimelineChartView) AnalyzerUtil.getView(TimelinePage.pageID, TimelineChartView.class.getName());
+ NetworkChartView NETchartView = (NetworkChartView) AnalyzerUtil.getView(NetworkPage.pageID, NetworkChartView.class.getName());
+ ThreadChartView THRchartView = (ThreadChartView) AnalyzerUtil.getView(ThreadPage.pageID, ThreadChartView.class.getName());
+ FileChartView FLchartView = (FileChartView) AnalyzerUtil.getView(FilePage.pageID, FileChartView.class.getName());
+ GLChartView GLchartview = (GLChartView) AnalyzerUtil.getView(GLPage.pageID, GLChartView.class.getName());
+ MemoryChartView MMchartView = (MemoryChartView) AnalyzerUtil.getView(MemoryPage.pageID, MemoryChartView.class.getName());
+
+ //1. add marker to rangedatamanager
+ RangeDataManager.getInstance().addMarkerTime(markerTime);
+
+ //2. add marker to toolbar
+ Toolbar.INSTANCE.addMarkerTime(startMarkerTime);
+
+ if(TLchartView != null)
+ TLchartView.updateView();
+ if(NETchartView != null)
+ NETchartView.updateView();
+ if(THRchartView != null)
+ THRchartView.updateView();
+ if(FLchartView != null)
+ FLchartView.updateView();
+ if(GLchartview != null)
+ GLchartview.updateView();
+ if(MMchartView != null)
+ MMchartView.updateView();
+
+ AnalyzerUtil.getMainTab().getTopComposite().updateView();
+ /// draw marker clearly
+ BaseView baseView = (BaseView) WorkbenchUtil.getViewPart(BaseView.ID);
+ baseView.getTopComposite().updateView();
}
@Override
private DAToolBarCustomCombo threadProcessCombo;
private DAToolBarCustomCombo syncProcessCombo;
-
- private DACustomButton threadDimensionSwitchButton;
- private DACustomButton syncDimensionSwitchButton;
public ThreadChartView(Composite parent, int style) {
super(parent, style, false);
FormData data = new FormData();
data.top = new FormAttachment(0, 0);
data.left = new FormAttachment(0, 0);
- data.width = 167;
+ data.width = 192;
data.height = 25;
threadProcessCombo.setLayoutData(data);
syncProcessCombo = makeDACustomCombo(syncChartBoard.getTitleComp());
syncProcessCombo.setLayoutData(data);
- threadDimensionSwitchButton = new DACustomButton(threadChartBoard.getTitleComp(),
- ImageResources.DIMENSION_IC_NOR,
- ImageResources.DIMENSION_IC_NOR,
- ImageResources.DIMENSION_IC_NOR,
- ImageResources.DIMENSION_IC_NOR
- );
-
- syncDimensionSwitchButton = new DACustomButton(syncChartBoard.getTitleComp(),
- ImageResources.DIMENSION_IC_SEL,
- ImageResources.DIMENSION_IC_SEL,
- ImageResources.DIMENSION_IC_SEL,
- ImageResources.DIMENSION_IC_SEL
- );
-
- threadDimensionSwitchButton.setForeground(ColorResources.GRAY_170);
- threadDimensionSwitchButton.setBackground(ColorResources.WHITE);
- syncDimensionSwitchButton.setForeground(ColorResources.GRAY_170);
- syncDimensionSwitchButton.setBackground(ColorResources.WHITE);
-
- threadDimensionSwitchButton.setRenderer(new DACustomButtonRenderer() {
- @Override
- public void draw(GC gc, Canvas canvas, int state,
- DACustomButtonAttribute attr) {
- Rectangle rect = canvas.getClientArea();
-
- if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
- drawImageButton(gc, rect, state, attr);
- } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
- || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
- drawButton(gc, rect, state, attr);
- }
- drawButtonImage(gc, rect, attr, state);
- drawIcon(gc, rect, attr);
- gc.drawLine(0, 0, 25, 0);
- gc.drawLine(0, 24, 25, 24);
- gc.drawLine(24, 0, 24, 24);
- }
- });
-
- syncDimensionSwitchButton.setRenderer(new DACustomButtonRenderer() {
- @Override
- public void draw(GC gc, Canvas canvas, int state,
- DACustomButtonAttribute attr) {
- Rectangle rect = canvas.getClientArea();
-
- if (attr.getDrawType() == DACustomButton.TYPE_IMAGE) {
- drawImageButton(gc, rect, state, attr);
- } else if (attr.getDrawType() == DACustomButton.TYPE_COLOR
- || attr.getDrawType() == DACustomButton.TYPE_GRADATION) {
- drawButton(gc, rect, state, attr);
- }
- drawButtonImage(gc, rect, attr, state);
- drawIcon(gc, rect, attr);
- gc.drawLine(0, 0, 25, 0);
- gc.drawLine(0, 24, 25, 24);
- gc.drawLine(24, 0, 24, 24);
- }
- });
-
- threadDimensionSwitchButton.addClickListener(new DACustomButtonClickEventListener() {
- @Override
- public void handleEvent(Event event) {
- changeBoardThreadToSync();
- }
-
- @Override
- public void handleClickEvent(DACustomButton button) {
-
- }
- });
-
- syncDimensionSwitchButton.addClickListener(new DACustomButtonClickEventListener() {
- @Override
- public void handleEvent(Event event) {
- changeBoardSyncToThread();
- }
-
- @Override
- public void handleClickEvent(DACustomButton button) {
-
- }
- });
-
- data = new FormData();
- data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(threadProcessCombo, 0);
- data.width = 25;
- data.height = 25;
- threadDimensionSwitchButton.setLayoutData(data);
-
- data = new FormData();
- data.top = new FormAttachment(0, 0);
- data.left = new FormAttachment(syncProcessCombo, 0);
- data.width = 25;
- data.height = 25;
- syncDimensionSwitchButton.setLayoutData(data);
-
initProcessCombo(threadProcessCombo);
initProcessCombo(syncProcessCombo);
updateScale();
ImageResources.DROP_ARROW_DOWN_SEL,
ImageResources.DROP_ARROW_DOWN_HOVER,
ImageResources.DROP_ARROW_DOWN_DIM);
- returnCombo.setComboImagePoint(new Point(135, 9));
+ returnCombo.setComboImagePoint(new Point(160, 9));
returnCombo.setComboButtonColor(ColorResources.WHITE,
ColorResources.WHITE,
ColorResources.WHITE,
public void updateMarker() {
List<Double> markerTimeList = Toolbar.INSTANCE.getMarkerTimeList();
- List<ThreadChart> chartList = threadChartBoard.getThreadChartItemList();
- for(ThreadChart chart : chartList) {
- chart.getChart().getPlot().clearMarkerTime();
+
+ List<ThreadChart> threadChartList = threadChartBoard.getThreadChartItemList();
+ for(ThreadChart threadChart : threadChartList) {
+ threadChart.getChart().getPlot().clearMarkerTime();
}
for(double time : markerTimeList) {
- for(ThreadChart chart : chartList) {
- chart.getChart().getPlot().addMarkerTime(time);
+ for(ThreadChart threadChart : threadChartList) {
+ threadChart.getChart().getPlot().addMarkerTime(time);
}
threadChartBoard.getTimeline().addMarker(time);
}
+
+ List<SyncChart> syncChartList = threadChartBoard.getSyncChartList();
+ for(SyncChart syncChart : syncChartList) {
+ syncChart.getChart().getPlot().clearMarkerTime();
+ }
+ for(double time : markerTimeList) {
+ for(SyncChart syncChart : syncChartList) {
+ syncChart.getChart().getPlot().addMarkerTime(time);
+ }
+ }
}
@Override