public final static int SORT_TYPE_NUM = 1;
public final static int SORT_TYPE_STRING = 2;
public final static int SORT_TYPE_GRID = 3;
+ public final static int SORT_TYPE_GRID_NUM = 4;
// function usage profile data type
public final static int FUPD_APPLICATION = 1;
public static String CALL_TRACE_VIEW_BINARY_PATH;
public static String CALL_TRACE_VIEW_FILE;
public static String CALL_TRACE_VIEW_LINE_NUMBER;
-
+
public static String UI_EVENT_LIST_TYPE;
public static String UI_EVENT_LIST_NAME;
public static String UI_EVENT_LIST_TIME;
- public static String UI_EVENT_LIST_SET_RANGE;
+ public static String UI_EVENT_LIST_DETAIL;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, TimelinePageLabels.class);
UI_EVENT_LIST_TYPE=Type
UI_EVENT_LIST_NAME=Name
UI_EVENT_LIST_TIME=Time
-UI_EVENT_LIST_SET_RANGE=Set range
\ No newline at end of file
+UI_EVENT_LIST_DETAIL=Detail
\ No newline at end of file
eventListItem.addListener(new DAPopupMenuListener() {
@Override
public void widgetSelected(DAPopupMenuItem menuItem) {
- List<DAChartSeries> chartSeriesList = eventListItem.getChartSeriesList();
- List<Integer> startIndexList = eventListItem.getStartIndexList();
- List<Integer> endIndexList = eventListItem.getEndIndexList();
-
- uiEventListDialog.setSelectedEventInfo(chartSeriesList, startIndexList, endIndexList);
+ uiEventListDialog.setSelectedEventInfo(chart.getSeriesList());
uiEventListDialog.open();
}
});
Toolbar.INSTANCE.getProcessCombo().add(buffer.toString());
}
}
-
+
private void updateProcessCombo() {
int index = Toolbar.INSTANCE.getProcessCombo().getSelectionIndex();
if(index+1 > processCombo.getItems().size()) {
}
processCombo.select(index);
}
-
+
public void ScaleChanged(boolean zoom){
chartBoard.getScale().changeScale(zoom);
}
-
+
private void updateScale() {
int scaleSelection = Toolbar.INSTANCE.getScaleSelection();
chartBoard.getBoardManager().scaleChanged(scaleSelection);
chartBoard.setScaleVal(scaleSelection);
}
-
+
public void reArrangeChart(List<Integer> order, List<Boolean> showInfo) {
if (order != null) {
chartBoard.reArrangeItem(order.toArray(new Integer[order.size()]));
}
}
}
-
+
public void updateMarker() {
List<Double> markerTimeList = Toolbar.INSTANCE.getMarkerTimeList();
List<TimelineChart> chartList = TimelineChartManager.getInstance().getChartList();
for(TimelineChart chart : chartList) {
chart.getChart().getPlot().clearMarkerTime();
-
if(chart instanceof CPUChart && ((CPUChart) chart).getProcessChart() != null) {
((CPUChart) chart).getProcessChart().getChart().getPlot().clearMarkerTime();
}
for(double time : markerTimeList) {
for(TimelineChart chart : chartList) {
chart.getChart().getPlot().addMarkerTime(time);
-
- if(chart instanceof CPUChart && ((CPUChart) chart).getProcessChart().getChart() != null) {
+ if(chart instanceof CPUChart && ((CPUChart) chart).getProcessChart() != null) {
((CPUChart) chart).getProcessChart().getChart().getPlot().addMarkerTime(time);
}
}
import org.tizen.dynamicanalyzer.appearance.DesignConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
-import org.tizen.dynamicanalyzer.model.FilterProperty;
import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.nl.TimelinePageLabels;
import org.tizen.dynamicanalyzer.nl.WidgetLabels;
import org.tizen.dynamicanalyzer.resources.FontResources;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
-import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartView;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
private Shell parent;
private UIEventListTable uiEventListTable;
private List<DAChartSeries> chartSeriesList;
- private List<Integer> startIndexList;
- private List<Integer> endIndexList;
- private String[] columnNames = { TimelinePageLabels.UI_EVENT_LIST_TYPE,
- TimelinePageLabels.UI_EVENT_LIST_NAME,
+ private String[] columnNames = {
TimelinePageLabels.UI_EVENT_LIST_TIME,
- TimelinePageLabels.UI_EVENT_LIST_SET_RANGE };
- private int[] columnSizes = { 74, 102, 100, 140 };
- private boolean[] columnVisibility = { true, true, true, true };
- int[] sortTypes = { AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_GRID, AnalyzerConstants.SORT_TYPE_GRID,
- AnalyzerConstants.SORT_TYPE_NONE };
+ TimelinePageLabels.UI_EVENT_LIST_TYPE,
+ TimelinePageLabels.UI_EVENT_LIST_NAME,
+ TimelinePageLabels.UI_EVENT_LIST_DETAIL
+ };
+ private int[] columnSizes = { 100, 100, 175, 425};
+ private boolean[] columnVisibility = { true, true, true, true};
+ int[] sortTypes = {
+ AnalyzerConstants.SORT_TYPE_GRID_NUM,
+ AnalyzerConstants.SORT_TYPE_GRID,
+ AnalyzerConstants.SORT_TYPE_GRID,
+ AnalyzerConstants.SORT_TYPE_GRID
+ };
DefaultTableComparator comparator = new DefaultTableComparator();
public UIEventListDialog(Shell parent) {
public int open() {
shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
shell.setText("Event list"); // FIXME
- shell.setSize(446, 450);
+ shell.setSize(825, 450);
shell.setLayout(new FormLayout());
Composite tableComp = new Composite(shell, SWT.NONE);
uiEventListTable.setColumnSize(columnSizes);
uiEventListTable.setColumnVisibility(columnVisibility);
uiEventListTable.setSortTypes(sortTypes);
- comparator.setColumn(2);
+ comparator.setColumn(0);
+ comparator.setType(AnalyzerConstants.SORT_TYPE_GRID_NUM);
uiEventListTable.setComparator(comparator);
uiEventListTable.getTable().setData(UIEventListDialog.KEY_START_TIME,
-1.0);
okButton.setFont(FontResources.EDIT_CHART_DLG_BUTTON);
data = new FormData();
data.top = new FormAttachment(0, 8);
- data.left = new FormAttachment(0, 119);
+ data.left = new FormAttachment(0, 569);
data.width = DesignConstants.DA_BUTTON_WIDTH;
data.height = DesignConstants.DA_BUTTON_HEIGHT;
okButton.setLayoutData(data);
return 0;
}
- public void setSelectedEventInfo(List<DAChartSeries> chartSeriesList,
- List<Integer> startIndexList, List<Integer> endIndexList) {
+ public void setSelectedEventInfo(List<DAChartSeries> chartSeriesList) {
this.chartSeriesList = chartSeriesList;
- this.startIndexList = startIndexList;
- this.endIndexList = endIndexList;
}
private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
protected List<TableInput> makeTableInput() {
List<TableInput> inputList = new ArrayList<TableInput>();
+ if(chartSeriesList == null && chartSeriesList.size() == 0) {
+ return null;
+ }
+
for (int i = 0; i < chartSeriesList.size(); i++) {
String seriesName = chartSeriesList.get(i).getName();
- int fromIndex = startIndexList.get(i);
- int toIndex = endIndexList.get(i);
-
- if (fromIndex > toIndex || fromIndex == -1 || toIndex == -1) {
- continue;
- }
List<DAChartSeriesItem> subItemList = chartSeriesList.get(i)
- .getSeriesItemList().subList(fromIndex, toIndex);
+ .getSeriesItemList();
for (DAChartSeriesItem item : subItemList) {
+ String[] eventDetailDatas = item.getTooltipText().split("\n");
+ String eventName = eventDetailDatas[0];
+ String detailData = "";
+ for(String tmpDetail : eventDetailDatas) {
+ detailData = detailData.concat(tmpDetail).concat("|");
+ }
+ detailData = detailData.split(eventName)[1];
+ if(detailData.length() > 1 ) {
+ detailData = detailData.substring(1, detailData.length()-1);
+ } else {
+ detailData = "";
+ }
+
List<String> columnTexts = new ArrayList<String>();
- columnTexts.add(seriesName);
- columnTexts.add(item.getTooltipText().split("\n")[0]);//$NON-NLS-1$
columnTexts.add(String.valueOf(item.getX()));
+ columnTexts.add(seriesName);
+ columnTexts.add(eventName);//$NON-NLS-1$
+ columnTexts.add(detailData);
TableInput tableInput = new TableInput();
tableInput.setText(columnTexts);
package org.tizen.dynamicanalyzer.ui.timeline.uievent;
-import org.eclipse.nebula.widgets.grid.Grid;
import org.eclipse.nebula.widgets.grid.GridItem;
-import org.eclipse.nebula.widgets.grid.IInternalWidget;
import org.eclipse.nebula.widgets.grid.internal.DefaultCellRenderer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.resources.FontResources;
-import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
-import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
public class UIEventListDialogTableCellRenderer extends DefaultCellRenderer {
private int leftMargin = 4;
private int textTopMargin = 1;
private int insideMargin = 3;
- private int CHECK_INDEX = 3;
-
- private final int buttonWidth = ImageResources.UIEVENT_DIALOG_START_SELECTED_NORMAL
- .getBounds().width;
-
@Override
public void paint(GC gc, Object value) {
GridItem item = (GridItem) value;
}
int x = leftMargin;
- if (getColumn() == CHECK_INDEX) {
- Image buttonImage;
- Integer data = (Integer) item
- .getData(UIEventListDialog.KEY_OLD_HOVERED_INDEX);
- if (item.getChecked(CHECK_INDEX)) {
- if (data != null && data == CHECK_INDEX) {
- buttonImage = ImageResources.UIEVENT_DIALOG_START_SELECTED_HOVER;
- } else {
- buttonImage = ImageResources.UIEVENT_DIALOG_START_SELECTED_NORMAL;
- }
- } else {
- if (data != null && data == CHECK_INDEX) {
- buttonImage = ImageResources.UIEVENT_DIALOG_START_HOVER;
- } else {
- buttonImage = ImageResources.UIEVENT_DIALOG_START_NORMAL;
- }
- }
- gc.drawImage(buttonImage, getStartButtonXPostion(),
- getBounds().y + 1);
-
- if (item.getChecked(CHECK_INDEX - 1)) {
- if (data != null && data == CHECK_INDEX - 1) {
- buttonImage = ImageResources.UIEVENT_DIALOG_END_SELECTED_HOVER;
- } else {
- buttonImage = ImageResources.UIEVENT_DIALOG_END_SELECTED_NORMAL;
- }
- } else {
- if (data != null && data == CHECK_INDEX - 1) {
- buttonImage = ImageResources.UIEVENT_DIALOG_END_HOVER;
- } else {
- buttonImage = ImageResources.UIEVENT_DIALOG_END_NORMAL;
- }
- }
- gc.drawImage(buttonImage, getEndButtonXPosition(),
- getBounds().y + 1);
- }
-
Image image = item.getImage(getColumn());
if (image != null) {
int y = getBounds().y;
}
gc.setFont(FontResources.TABLE_CELL_FONT);
+ gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin, true);
- if (getColumn() != CHECK_INDEX) {
- gc.drawText(text, getBounds().x + x, getBounds().y + textTopMargin,
- true);
- }
if (item.getParent().getLinesVisible()) {
gc.setForeground(ColorResources.TABLE_LINE);
gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
}
}
}
-
- private int getStartButtonXPostion() {
- return getBounds().x + getBounds().width / 2 - buttonWidth - 5;
- }
-
- private int getEndButtonXPosition() {
- return getBounds().x + getBounds().width / 2 + 5;
- }
-
- private int getCheckBoxIndex(Point point) {
- Image buttonImage;
- if (point.x < getBounds().x + getBounds().width / 2) {
- buttonImage = ImageResources.UIEVENT_DIALOG_START_NORMAL;
- } else {
- buttonImage = ImageResources.UIEVENT_DIALOG_END_NORMAL;
- }
-
- if (point.x >= getStartButtonXPostion()
- && point.x <= getStartButtonXPostion()
- + buttonImage.getBounds().width) {
- return CHECK_INDEX;
- } else if (point.x >= getEndButtonXPosition()
- && point.x <= getEndButtonXPosition()
- + buttonImage.getBounds().width) {
- return CHECK_INDEX - 1;
- } else {
- return -1;
- }
- }
-
- public boolean notify(int event, Point point, Object value) {
- if (getColumn() == CHECK_INDEX) {
- if (event == IInternalWidget.MouseMove) {
- GridItem item = (GridItem) value;
- int checkBoxIndex = getCheckBoxIndex(point);
- Grid parentGrid = item.getParent();
- GridItem oldHoveredItem = (GridItem) parentGrid
- .getData(UIEventListDialog.KEY_OLD_HOVERED_ITEM);
- if (oldHoveredItem != null) {
- oldHoveredItem.setData(
- UIEventListDialog.KEY_OLD_HOVERED_INDEX, null);
- }
-
- if (checkBoxIndex != -1) {
- parentGrid.setData(UIEventListDialog.KEY_OLD_HOVERED_ITEM,
- item);
- item.setData(UIEventListDialog.KEY_OLD_HOVERED_INDEX,
- checkBoxIndex);
- }
-
- parentGrid.redraw();
- } else if (event == IInternalWidget.LeftMouseButtonDown) {
- GridItem item = (GridItem) value;
- int checkBoxIndex = getCheckBoxIndex(point);
- if (checkBoxIndex != -1) {
- boolean isCheckEvent = !item
- .getChecked(getCheckBoxIndex(point));
-
- Grid parentGrid = item.getParent();
- if (isCheckEvent) {
- double data = (Double) ((DATableDataFormat) item
- .getData()).getObject();
-
- if (checkBoxIndex == CHECK_INDEX) {
- GridItem oldCheckedItem = (GridItem) parentGrid
- .getData(UIEventListDialog.KEY_START_OLD_CHECKED_ITEM);
-
- if (oldCheckedItem != null) {
- oldCheckedItem.setChecked(CHECK_INDEX, false);
- }
- parentGrid
- .setData(
- UIEventListDialog.KEY_START_OLD_CHECKED_ITEM,
- item);
-
- parentGrid.setData(
- UIEventListDialog.KEY_START_TIME, data);
- } else {
- GridItem oldCheckedItem = (GridItem) parentGrid
- .getData(UIEventListDialog.KEY_END_OLD_CHECKED_ITEM);
-
- if (oldCheckedItem != null) {
- oldCheckedItem.setChecked(CHECK_INDEX - 1,
- false);
- }
- parentGrid.setData(
- UIEventListDialog.KEY_END_OLD_CHECKED_ITEM,
- item);
-
- parentGrid.setData(UIEventListDialog.KEY_END_TIME,
- data);
- }
- } else {
- if (checkBoxIndex == CHECK_INDEX) {
- parentGrid.setData(
- UIEventListDialog.KEY_START_TIME, -1.0);
- } else {
- parentGrid.setData(UIEventListDialog.KEY_END_TIME,
- -1.0);
- }
- }
-
- item.setChecked(checkBoxIndex, isCheckEvent);
-
- return true;
- }
- }
- }
- return false;
- }
}
String str2 = null;
int rc = 0;
- if (type != AnalyzerConstants.SORT_TYPE_GRID) {
+ if (type != AnalyzerConstants.SORT_TYPE_GRID && type != AnalyzerConstants.SORT_TYPE_GRID_NUM) {
DATableDataFormat tableData1 = (DATableDataFormat) item1.getData();
DATableDataFormat tableData2 = (DATableDataFormat) item2.getData();
Logger.exception(e);
break;
}
+ case AnalyzerConstants.SORT_TYPE_GRID_NUM:
+ try {
+
+ double returnData = Double.parseDouble(str1) - Double.parseDouble(str2);
+ if (returnData > 0) {
+ rc = 1;
+ } else if (returnData < 0) {
+ rc = -1;
+ } else {
+ rc = 0;
+ }
+ break;
+ } catch (NumberFormatException e) {
+ Logger.exception(e);
+ break;
+ }
case AnalyzerConstants.SORT_TYPE_STRING:
case AnalyzerConstants.SORT_TYPE_GRID:
rc = str1.compareTo(str2);