import org.tizen.dynamicanalyzer.model.FindProperty;
import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.sql.SqlManager;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
import org.tizen.dynamicanalyzer.ui.widgets.FindDialog;
import org.tizen.dynamicanalyzer.util.CommonUtil;
protected long selectionStartTime = -1;
protected long selectionEndTime = -1;
- protected boolean isLogData = true;
protected int timeColumnIndex = 0;
private int totalItemCount = 0;
private int previousTableLength = 0;
private int tableAreaHeigth = 0;
- private List<LogData> queriedLogData = null;
private List<List<Object>> queriedObjectData = null;
public DAWindowingTableComposite(Composite parent, int compStyle, int tableStyle) {
if (null == td) {
return;
}
-
- if (isLogData) {
- selectionStartTime = td.getLogData().getTime();
- selectionEndTime = td.getLogData().getTime();
- } else {
- selectionStartTime = (Long) td.getData().get(timeColumnIndex);
- selectionEndTime = selectionStartTime;
- }
+ selectionStartTime = (Long) td.getData().get(timeColumnIndex);
+ selectionEndTime = selectionStartTime;
focusSeq = td.getSelectionKey();
}
if (null == td) {
return;
}
-
- if (isLogData) {
- selectionStartTime = td.getLogData().getTime();
- selectionEndTime = td.getLogData().getTime();
- } else {
- selectionStartTime = (Long) td.getData().get(timeColumnIndex);
- selectionEndTime = selectionStartTime;
- }
-
+ selectionStartTime = (Long) td.getData().get(timeColumnIndex);
+ selectionEndTime = selectionStartTime;
focusSeq = td.getSelectionKey();
}
if (gridData != null) {
long seqNum = gridData.getSelectionKey();
- if (isLogData) {
- long time = gridData.getLogData().getTime();
- if (selectionStartTime <= time && time <= selectionEndTime) {
- isSelectionItem = true;
- focusIndex = i;
- selectionList.add(i);
- }
- } else {
- long time = (Long) gridData.getData().get(timeColumnIndex);
- if (selectionStartTime <= time && time <= selectionEndTime) {
- isSelectionItem = true;
- focusIndex = i;
- selectionList.add(i);
- }
+ long time = (Long) gridData.getData().get(timeColumnIndex);
+ if (selectionStartTime <= time && time <= selectionEndTime) {
+ isSelectionItem = true;
+ focusIndex = i;
+ selectionList.add(i);
}
if (-1 != focusSeq && seqNum == focusSeq) {
}
if (isQueryDB) {
- if (isLogData) {
- queriedLogData = getLogDataFromDB(itemCount);
- } else {
- queriedObjectData = getObjectDataFromDB(itemCount);
- }
+ queriedObjectData = getObjectDataFromDB(itemCount);
}
- if ((isLogData && queriedLogData == null) || (!isLogData && queriedObjectData == null)) {
+ if (queriedObjectData == null) {
return null;
}
return SqlConnectionManager.executeQuery(query);
}
- private List<LogData> getLogDataFromDB(int itemCount) {
- String tableName = getDBTableName();
- if (tableName == null || tableName.isEmpty()) {
- return null;
- }
-
- int scrollSelection = vScrollbar.getSelection();
- if (scrollSelection > itemCount) { // change PID
- scrollSelection = 0;
- }
- int selectedEndIndex = getTableLength() + 1;
- if (itemCount <= selectedEndIndex) {
- selectedEndIndex = itemCount;
- }
- List<LogData> outputList = SqlManager.getInstance().selectTableData(tableName,
- getDBTableColumnNames(), scrollSelection, selectedEndIndex + 1,
- getSelectQueryOption());
- return outputList;
- }
-
@Override
public void clear() {
super.clear();
vScrollbar.setVisible(false);
selectionStartTime = -1;
selectionEndTime = -1;
- queriedLogData = null;
queriedObjectData = null;
totalItemCount = 0;
previousItemCount = -1;
protected void actionSetStartEnd(int type) {
GridItem item = table.getItem(mousePoint);
if (null != item) {
- long inputTime;
- if (isLogData) {
- LogData data = ((DATableDataFormat) item.getData()).getLogData();
- inputTime = data.getTime();
- } else {
- inputTime = (Long) ((DATableDataFormat) item.getData()).getData().get(
+ long inputTime = (Long) ((DATableDataFormat) item.getData()).getData().get(
timeColumnIndex);
- }
if (type == START_TIME) {
rangeDataManager.setMarkerStartTime(inputTime);
}
}
- protected List<LogData> getQueriedLogData() {
- return queriedLogData;
- }
-
protected List<List<Object>> getQueriedObjectData() {
return queriedObjectData;
}
}
}
- public void setDataType(boolean isLogData, int timeColumnIndex) {
- this.isLogData = isLogData;
+ public void setDataType(int timeColumnIndex) {
this.timeColumnIndex = timeColumnIndex;
}