protected void actionSetStartEnd(int type) {
GridItem item = table.getItem(mousePoint);
if (null != item) {
- List<String> data = ((DATableDataFormat) item.getData()).getData();
- String time = data.get(LogCenterConstants.TIME_INDEX);
- long inputTime = -1;
- try {
- inputTime = Long.parseLong(time);
- } catch (NumberFormatException e) {
- e.printStackTrace();
- return;
- }
+ NetworkData data = (NetworkData) ((DATableDataFormat) item
+ .getData()).getLogData();
+ long time = data.getTime();
double startTime = -1;
double endTime = -1;
DAChartBoard board = getChartBoard();
if (type == START_TIME) {
- rangeDataManager.setMarkerStartTime(inputTime);
- startTime = inputTime / TimelineConstants.MEGA;
+ rangeDataManager.setMarkerStartTime(time);
+ startTime = time / TimelineConstants.MEGA;
endTime = rangeDataManager.getMarkerEndTime()
/ TimelineConstants.MEGA;
} else if (type == END_TIME) {
- rangeDataManager.setMarkerEndTime(inputTime);
- endTime = inputTime / TimelineConstants.MEGA;
+ rangeDataManager.setMarkerEndTime(time);
+ endTime = time / TimelineConstants.MEGA;
startTime = rangeDataManager.getMarkerStartTime()
/ TimelineConstants.MEGA;
}
import org.tizen.dynamicanalyzer.swap.model.probe2.FailedData2;
import org.tizen.dynamicanalyzer.swap.model.probe2.LogData;
import org.tizen.dynamicanalyzer.swap.model.probe2.NetworkData;
-import org.tizen.dynamicanalyzer.ui.common.PopupAnalysisMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupClearMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupEndMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupFromSelectionMenuItemClickListener;
-import org.tizen.dynamicanalyzer.ui.common.PopupStartMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextAnalysisMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextClearMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextEndMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextFromSelectionMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.ContextStartMenuItemClickListener;
+import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseEventListener;
+import org.tizen.dynamicanalyzer.ui.common.TimelineChartMouseTrackAdapter;
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningCase;
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningData;
+import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.widgets.chart.DAChart;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartPlot;
import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeries;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoard;
import org.tizen.dynamicanalyzer.widgets.chartBoard.DAChartBoardItem;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu;
-import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem;
+import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem;
public class NetworkDataMaker {
private DAChartBoard board;
} else {
plot.setBackgroundImage(ImageResources.BG_CHILD_GRADIENT);
}
+ plot.setAutoHeightRange(false);
+ plot.setAxisFont(FontResources.CHART_AXIS_FONT);
+ plot.setAxisRangeY(0, 101);
+ plot.setAxisRangeX(board.getVisibleStartTime(),
+ board.getVisibleEndTime());
+ DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1);
+ tooltip.setFont(FontResources.CHART_TOOLTIP_FONT);
+ plot.setTooltip(tooltip);
+
+ DAContextMenu popupMenu = new DAContextMenu(chart);
+ popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT);
+ DAContextMenuItem startItem = new DAContextMenuItem(popupMenu);
+ startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START);
+ startItem.addClickListener(new ContextStartMenuItemClickListener(
+ startItem, board));
+
+ DAContextMenuItem endItem = new DAContextMenuItem(popupMenu);
+ endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END);
+ endItem.addClickListener(new ContextEndMenuItemClickListener(endItem,
+ board));
+
+ DAContextMenuItem fromSelectionItem = new DAContextMenuItem(popupMenu);
+ fromSelectionItem
+ .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION);
+ fromSelectionItem
+ .addClickListener(new ContextFromSelectionMenuItemClickListener(
+ fromSelectionItem, board));
+
+ DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu);
+ analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS);
+ analysisItem
+ .addClickListener(new ContextAnalysisMenuItemClickListener());
+
+ DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu);
+ clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR);
+ clearItem
+ .addClickListener(new ContextClearMenuItemClickListener(board));
+
+ TimelineChartMouseEventListener timelineChartMouseEventListener = new TimelineChartMouseEventListener(
+ popupMenu, board.getTimeline());
+ chart.addMouseListener(timelineChartMouseEventListener);
+ chart.addMouseMoveListener(timelineChartMouseEventListener);
+ chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
+ .getTimeline()));
+ plot.setMarkers(board.getMarkers());
+ /*
// plot.setAutoHeightRange(AutoRangeType.MANUAL);
plot.setAxisFont(FontResources.CHART_AXIS_FONT);
plot.setAxisRangeY(0, 101);
// chart.addMouseMoveListener(timelineChartMouseEventListener);
// chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board
// .getTimeline()));
+ */
}
private boolean createNetworkBoardItem(NetworkChartData parent,