import org.tizen.dynamicanalyzer.model.DASelectionData;
import org.tizen.dynamicanalyzer.model.LogPackage;
import org.tizen.dynamicanalyzer.model.SnapshotData;
-import org.tizen.dynamicanalyzer.nl.TimelineChartLables;
import org.tizen.dynamicanalyzer.timeline.chart.CPUChart;
import org.tizen.dynamicanalyzer.timeline.chart.CPUCoreChart;
import org.tizen.dynamicanalyzer.timeline.chart.CPUFrequencyChart;
private MouseListener itemZoomMouseListener = new MouseAdapter() {
@Override
public void mouseDown(MouseEvent event) {
- ItemInfoComposite itemInfoComp = (ItemInfoComposite) ((Label) event
- .getSource()).getParent();
+ ItemInfoComposite itemInfoComp = (ItemInfoComposite) ((Label) event.getSource()).getParent();
if (null == itemInfoComp) {
return;
TimelineItemSettingProvider.setItemZoomToggle(itemID);
- TimelineComposite timelineComposite = AnalyzerUtil
- .getTimelineComposite();
+ TimelineComposite timelineComposite = AnalyzerUtil.getTimelineComposite();
if (null != timelineComposite) {
timelineComposite.resizeItemArea();
- setActivateItem(localPageID, itemInfoComp.ID,
- getItemInfoList(localPageID).size());
+ setActivateItem(localPageID, itemInfoComp.ID, getItemInfoList(localPageID).size());
- if (TimelineConstants.ITEM_SIZE_MODE_MAX == TimelineItemSettingProvider
- .getItemSetting(itemID).getSizeMode()) {
+ if (TimelineConstants.ITEM_SIZE_MODE_MAX == TimelineItemSettingProvider.getItemSetting(itemID).getSizeMode()) {
focusItem(itemID);
}
}
return;
}
- setActivateItem(localPageID, itemInfoComp.ID,
- getItemNum(localPageID));
+ setActivateItem(localPageID, itemInfoComp.ID, getItemNum(localPageID));
}
};
return;
}
- ItemInfoComposite itemInfoComp = (ItemInfoComposite) label
- .getParent();
+ ItemInfoComposite itemInfoComp = (ItemInfoComposite) label.getParent();
if (null == itemInfoComp) {
return;
}
- setActivateItem(localPageID, itemInfoComp.ID,
- getItemNum(localPageID));
+ setActivateItem(localPageID, itemInfoComp.ID, getItemNum(localPageID));
}
};
XYPlot xyplot = itemChartComp.getChart().getXYPlot();
Rectangle2D rect2D = plotInfo.getDataArea();
- rect2D.setRect(rect2D.getX(), rect2D.getY(),
- canvas.getBounds().width - rect2D.getY(),
- rect2D.getHeight());
+ rect2D.setRect(rect2D.getX(), rect2D.getY(), canvas.getBounds().width - rect2D.getY(), rect2D.getHeight());
- Double selectionEndTime = xyplot.getDomainAxis().java2DToValue(e.x,
- rect2D, xyplot.getDomainAxisEdge());
+ Double selectionEndTime = xyplot.getDomainAxis().java2DToValue(e.x, rect2D, xyplot.getDomainAxisEdge());
tempUpTime = selectionEndTime;
setSelectionMarkerEndVal(selectionEndTime);
sendSelectionTimes();
- TimelineMaster.getInstance().highlightSelectedSnapshot(
- selectionMarker.getStartValue()
- - TimelineConstants.MS_TO_FIXEDMS,
- selectionMarker.getEndValue()
- - TimelineConstants.MS_TO_FIXEDMS);
+ TimelineMaster.getInstance().highlightSelectedSnapshot(selectionMarker.getStartValue(), selectionMarker.getEndValue());
}
@Override
XYPlot xyplot = itemChartComp.getChart().getXYPlot();
Rectangle2D rect2D = plotInfo.getDataArea();
- rect2D.setRect(rect2D.getX(), rect2D.getY(),
- canvas.getBounds().width - rect2D.getY(),
- rect2D.getHeight());
+ rect2D.setRect(rect2D.getX(), rect2D.getY(), canvas.getBounds().width - rect2D.getY(), rect2D.getHeight());
- tempDownTime = xyplot.getDomainAxis().java2DToValue(e.x, rect2D,
- xyplot.getDomainAxisEdge());
- Double selectionStartTime = xyplot.getDomainAxis().java2DToValue(
- e.x - TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D,
- xyplot.getDomainAxisEdge());
- Double selectionEndTime = xyplot.getDomainAxis().java2DToValue(
- e.x + TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D,
+ tempDownTime = xyplot.getDomainAxis().java2DToValue(e.x, rect2D, xyplot.getDomainAxisEdge());
+ Double selectionStartTime = xyplot.getDomainAxis().java2DToValue(e.x - TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D,
xyplot.getDomainAxisEdge());
+ Double selectionEndTime = xyplot.getDomainAxis().java2DToValue(e.x + TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D, xyplot.getDomainAxisEdge());
selectionMarker.setStartValue(selectionStartTime);
selectionMarker.setEndValue(selectionEndTime);
XYPlot xyplot = itemChartComp.getChart().getXYPlot();
Rectangle2D rect2D = plotInfo.getDataArea();
- rect2D.setRect(rect2D.getX(), rect2D.getY(),
- canvas.getBounds().width - rect2D.getY(),
- rect2D.getHeight());
+ rect2D.setRect(rect2D.getX(), rect2D.getY(), canvas.getBounds().width - rect2D.getY(), rect2D.getHeight());
createTooltip(e);
- double chartX = xyplot.getDomainAxis().java2DToValue(e.x, rect2D,
- xyplot.getDomainAxisEdge());
+ double chartX = xyplot.getDomainAxis().java2DToValue(e.x, rect2D, xyplot.getDomainAxisEdge());
tooltipValue = getTooltipXPosition(chartX);
// FIXME tooltip
// tooltipMarker.setValue(tooltipValue);
};
@SuppressWarnings("unused")
- private void drawVerticalLine(Graphics2D g2, Rectangle2D dataArea,
- double value, Stroke stroke, Paint paint, XYPlot xyplot) {
+ private void drawVerticalLine(Graphics2D g2, Rectangle2D dataArea, double value, Stroke stroke, Paint paint, XYPlot xyplot) {
ValueAxis axis = xyplot.getDomainAxis();
if (axis.getRange().contains(value)) {
- double xx = axis.valueToJava2D(value, dataArea,
- RectangleEdge.BOTTOM);
- Line2D line = new Line2D.Double(xx, dataArea.getMinY(), xx,
- dataArea.getMaxY());
+ double xx = axis.valueToJava2D(value, dataArea, RectangleEdge.BOTTOM);
+ Line2D line = new Line2D.Double(xx, dataArea.getMinY(), xx, dataArea.getMaxY());
g2.setStroke(stroke);
g2.setPaint(paint);
g2.draw(line);
XYPlot xyplot = itemChartComp.getChart().getXYPlot();
Rectangle2D rect2D = plotInfo.getDataArea();
- rect2D.setRect(rect2D.getX(), rect2D.getY(),
- canvas.getBounds().width - rect2D.getY(),
- rect2D.getHeight());
+ rect2D.setRect(rect2D.getX(), rect2D.getY(), canvas.getBounds().width - rect2D.getY(), rect2D.getHeight());
- double x = xyplot.getDomainAxis().java2DToValue(e.x, rect2D,
- xyplot.getDomainAxisEdge());
+ double x = xyplot.getDomainAxis().java2DToValue(e.x, rect2D, xyplot.getDomainAxisEdge());
if (tooltipValue != getTooltipXPosition(x)) {
tooltipValue = getTooltipXPosition(x);
// FIXME tooltip
case TimelineConstants.CHART_TYPE_CPU:
seriesList = CPUChart.getSeriesList();
for (int i = 0; i < seriesList.size(); i++) {
- double yValue = getYbyX(seriesList.get(i).toArray(),
- tooltipValue);
+ double yValue = getYbyX(seriesList.get(i).toArray(), tooltipValue);
- indexInfoLabelList.get(i).setText(
- CPUChart.getTooltipContent(i, yValue));
+ indexInfoLabelList.get(i).setText(CPUChart.getTooltipContent(i, yValue));
}
break;
case TimelineConstants.CHART_TYPE_CPU_CORE:
seriesList = CPUCoreChart.getSeriesList();
- int seriesSize = CPUCoreChart.getCoreSize() == TempConstants.NOT_INITED ? 4
- : CPUCoreChart.getCoreSize();
+ int seriesSize = CPUCoreChart.getCoreSize() == TempConstants.NOT_INITED ? 4 : CPUCoreChart.getCoreSize();
for (int i = 0; i < seriesSize; i++) {
- double yValue = getYbyX(seriesList.get(i).toArray(),
- tooltipValue);
+ double yValue = getYbyX(seriesList.get(i).toArray(), tooltipValue);
- indexInfoLabelList.get(i).setText(
- CPUCoreChart.getTooltipContent(i, yValue));
+ indexInfoLabelList.get(i).setText(CPUCoreChart.getTooltipContent(i, yValue));
}
break;
case TimelineConstants.CHART_TYPE_CPU_FREQUENCY:
seriesList = CPUFrequencyChart.getSeriesList();
for (int i = 0; i < seriesList.size(); i++) {
- double yValue = getYbyX(seriesList.get(i).toArray(),
- tooltipValue);
+ double yValue = getYbyX(seriesList.get(i).toArray(), tooltipValue);
- indexInfoLabelList.get(i).setText(
- CPUFrequencyChart.getTooltipContent(i, yValue));
+ indexInfoLabelList.get(i).setText(CPUFrequencyChart.getTooltipContent(i, yValue));
}
break;
case TimelineConstants.CHART_TYPE_HEAP:
seriesList = HeapChart.getSeriesList();
for (int i = 0; i < seriesList.size(); i++) {
- double yValue = getYbyX(seriesList.get(i).toArray(),
- tooltipValue);
+ double yValue = getYbyX(seriesList.get(i).toArray(), tooltipValue);
- indexInfoLabelList.get(i).setText(
- HeapChart.getTooltipContent(i, yValue));
+ indexInfoLabelList.get(i).setText(HeapChart.getTooltipContent(i, yValue));
}
break;
case TimelineConstants.CHART_TYPE_PROCESS_SIZE:
seriesList = ProcessMemoryChart.getSeriesList();
for (int i = 0; i < seriesList.size(); i++) {
- double yValue = getYbyX(seriesList.get(i).toArray(),
- tooltipValue);
+ double yValue = getYbyX(seriesList.get(i).toArray(), tooltipValue);
- indexInfoLabelList.get(i)
- .setText(
- ProcessMemoryChart.getTooltipContent(i,
- yValue));
+ indexInfoLabelList.get(i).setText(ProcessMemoryChart.getTooltipContent(i, yValue));
}
break;
case TimelineConstants.CHART_TYPE_SYSTEM_MEMORY:
seriesList = SystemMemoryChart.getSeriesList();
for (int i = 0; i < seriesList.size(); i++) {
- double yValue = getYbyX(seriesList.get(i).toArray(),
- tooltipValue);
+ double yValue = getYbyX(seriesList.get(i).toArray(), tooltipValue);
- indexInfoLabelList.get(i).setText(
- SystemMemoryChart.getTooltipContent(i, yValue));
+ indexInfoLabelList.get(i).setText(SystemMemoryChart.getTooltipContent(i, yValue));
}
break;
case TimelineConstants.CHART_TYPE_FILE:
seriesList = FileChart.getSeriesList();
for (int i = 0; i < seriesList.size(); i++) {
- double yValue = getYbyX(seriesList.get(i).toArray(),
- tooltipValue);
+ double yValue = getYbyX(seriesList.get(i).toArray(), tooltipValue);
- indexInfoLabelList.get(i).setText(
- FileChart.getTooltipContent(i, yValue));
+ indexInfoLabelList.get(i).setText(FileChart.getTooltipContent(i, yValue));
}
break;
}
Point pt = itemChartComp.toDisplay(e.x, e.y);
Point size = tooltip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- tooltip.setBounds(pt.x + TOOLTIP_MARGIN, pt.y - e.y
- + (itemChartComp.getBounds().height - size.y) / 2, size.x,
- size.y);
+ tooltip.setBounds(pt.x + TOOLTIP_MARGIN, pt.y - e.y + (itemChartComp.getBounds().height - size.y) / 2, size.x, size.y);
}
};
XYPlot xyplot = itemChartComp.getChart().getXYPlot();
Rectangle2D rect2D = plotInfo.getDataArea();
- rect2D.setRect(rect2D.getX(), canvas.getBounds().y,
- canvas.getBounds().width - rect2D.getY(),
- canvas.getBounds().height);
- double selectedTime = xyplot.getDomainAxis().java2DToValue(e.x, rect2D,
- xyplot.getDomainAxisEdge());
+ rect2D.setRect(rect2D.getX(), canvas.getBounds().y, canvas.getBounds().width - rect2D.getY(), canvas.getBounds().height);
+ double selectedTime = xyplot.getDomainAxis().java2DToValue(e.x, rect2D, xyplot.getDomainAxisEdge());
Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
tooltip = new Shell(shell, SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
gridLayout.verticalSpacing = SPACING;
tooltip.setLayout(gridLayout);
- Font indexInfoFont = new Font(Display.getDefault(),
- FontResources.ARIAL, 8, SWT.NORMAL);
+ Font indexInfoFont = new Font(Display.getDefault(), FontResources.ARIAL, 8, SWT.NORMAL);
RowData rowData;
boolean show = true;
seriesSize = seriesList.size();
rowData = new RowData(10, 10);
- makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
- selectedTime, indexInfoFont, chartID);
+ makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID);
break;
case TimelineConstants.CHART_TYPE_CPU:
seriesSize = seriesList.size();
rowData = new RowData(10, 10);
- makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
- selectedTime, indexInfoFont, chartID);
+ makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID);
break;
case TimelineConstants.CHART_TYPE_CPU_CORE:
seriesList = CPUCoreChart.getSeriesList();
seriesColorList = CPUCoreChart.getSeriesColor();
- seriesSize = CPUCoreChart.getCoreSize() == TempConstants.NOT_INITED ? 4
- : CPUCoreChart.getCoreSize();
+ seriesSize = CPUCoreChart.getCoreSize() == TempConstants.NOT_INITED ? 4 : CPUCoreChart.getCoreSize();
rowData = new RowData(10, 10);
- makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
- selectedTime, indexInfoFont, chartID);
+ makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID);
break;
case TimelineConstants.CHART_TYPE_CPU_FREQUENCY:
seriesSize = seriesList.size();
rowData = new RowData(10, 10);
- makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
- selectedTime, indexInfoFont, chartID);
+ makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID);
break;
case TimelineConstants.CHART_TYPE_PROCESS_SIZE:
seriesSize = seriesList.size();
rowData = new RowData(10, 10);
- makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
- selectedTime, indexInfoFont, chartID);
+ makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID);
break;
case TimelineConstants.CHART_TYPE_SYSTEM_MEMORY:
seriesSize = seriesList.size();
rowData = new RowData(10, 10);
- makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
- selectedTime, indexInfoFont, chartID);
+ makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID);
break;
case TimelineConstants.CHART_TYPE_SNAPSHOT:
IndexInfoComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
Canvas indexCanvas = new Canvas(IndexInfoComposite, SWT.NONE);
- indexCanvas.setBackground(getColorFromAwtColor(seriesColorList
- .get(i)));
+ indexCanvas.setBackground(getColorFromAwtColor(seriesColorList.get(i)));
indexCanvas.setLayoutData(rowData);
Label indexLabel = new Label(IndexInfoComposite, SWT.NONE);
seriesSize = seriesList.size();
rowData = new RowData(10, 10);
- makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
- selectedTime, indexInfoFont, chartID);
+ makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID);
break;
// case TimelineConstants.CHART_TYPE_DEVICE:
// break;
}
- int lifecycle = TimelineMaster.getInstance().getLifecycleByTime(
- selectedTime);
- String lifecycleDetail = TimelineMaster.getInstance()
- .getLifecycleString(lifecycle);
- if (lifecycleDetail != null) {
- show = true;
- Label lifecycleInfoColorLabel = new Label(tooltip, SWT.NONE);
- lifecycleInfoColorLabel
- .setText(TimelineChartLables.TIMELINE_LINE_ITEM_MANAGER_APP_LABLE
- + lifecycleDetail);
- lifecycleInfoColorLabel.setFont(indexInfoFont);
- }
+ // FIXME lifecycle
+ /*
+ * int lifecycle =
+ * TimelineMaster.getInstance().getLifecycleByTime(selectedTime); String
+ * lifecycleDetail =
+ * TimelineMaster.getInstance().getLifecycleString(lifecycle); if
+ * (lifecycleDetail != null) { show = true; Label
+ * lifecycleInfoColorLabel = new Label(tooltip, SWT.NONE);
+ * lifecycleInfoColorLabel
+ * .setText(TimelineChartLables.TIMELINE_LINE_ITEM_MANAGER_APP_LABLE +
+ * lifecycleDetail); lifecycleInfoColorLabel.setFont(indexInfoFont); }
+ */
if (show) {
showTooltip(itemChartComp, e.x, e.y);
private void showTooltip(ChartComposite chartComp, int x, int y) {
Point size = tooltip.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Point pt = chartComp.toDisplay(x, y);
- tooltip.setBounds(pt.x + TOOLTIP_MARGIN,
- pt.y - y + (chartComp.getBounds().height - size.y) / 2, size.x,
- size.y);
+ tooltip.setBounds(pt.x + TOOLTIP_MARGIN, pt.y - y + (chartComp.getBounds().height - size.y) / 2, size.x, size.y);
tooltip.setVisible(true);
}
return seriesData[1][index];
}
- private void makeTooltip(int seriesSize,
- List<java.awt.Color> seriesColorList, RowData rowData,
- List<XYSeries> seriesList, double selectedTime, Font indexInfoFont,
- int chartType) {
+ private void makeTooltip(int seriesSize, List<java.awt.Color> seriesColorList, RowData rowData, List<XYSeries> seriesList, double selectedTime,
+ Font indexInfoFont, int chartType) {
for (int i = 0; i < seriesSize; i++) {
if (i == 0) {
indexInfoLabelList.clear();
IndexInfoComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
Canvas indexCanvas = new Canvas(IndexInfoComposite, SWT.BORDER);
- indexCanvas.setBackground(getColorFromAwtColor(seriesColorList
- .get(i)));
+ indexCanvas.setBackground(getColorFromAwtColor(seriesColorList.get(i)));
indexCanvas.setLayoutData(rowData);
Label indexLabel = new Label(IndexInfoComposite, SWT.NONE);
} else if (chartType == TimelineConstants.CHART_TYPE_HEAP) {
indexLabel.setText(HeapChart.getTooltipContent(i, yValue));
} else if (chartType == TimelineConstants.CHART_TYPE_PROCESS_SIZE) {
- indexLabel.setText(ProcessMemoryChart.getTooltipContent(i,
- yValue));
+ indexLabel.setText(ProcessMemoryChart.getTooltipContent(i, yValue));
} else if (chartType == TimelineConstants.CHART_TYPE_SYSTEM_MEMORY) {
- indexLabel.setText(SystemMemoryChart.getTooltipContent(i,
- yValue));
+ indexLabel.setText(SystemMemoryChart.getTooltipContent(i, yValue));
} else if (chartType == TimelineConstants.CHART_TYPE_FILE) {
indexLabel.setText(FileChart.getTooltipContent(i, yValue));
} else if (chartType == TimelineConstants.CHART_TYPE_CPU_FREQUENCY) {
- indexLabel.setText(CPUFrequencyChart.getTooltipContent(i,
- yValue));
+ indexLabel.setText(CPUFrequencyChart.getTooltipContent(i, yValue));
}
}
}
private Color getColorFromAwtColor(java.awt.Color color) {
- return new Color(Display.getDefault(), color.getRed(),
- color.getGreen(), color.getBlue());
+ return new Color(Display.getDefault(), color.getRed(), color.getGreen(), color.getBlue());
}
public void addItems(int tabID, Composite page) {
public void updateActiveItem(double runTimeMs) {
chartManager.updateChart(runTimeMs);
- SnapshotData.getInstance().querySnapshotInfo(
- runTimeMs * TimelineConstants.TIME_US_TO_MS);
+ SnapshotData.getInstance().querySnapshotInfo(runTimeMs * TimelineConstants.TIME_US_TO_MS);
}
public void clear() {
List<ItemInfo> ItemList = getItemInfoList(localPageID);
for (int i = 0; i < selectedItemList.size(); i++) {
- ItemInfo info = createItemInfo(itemsAreaComp, localPageID,
- TimelineUtils.getChartType(selectedItemList.get(i)));
+ ItemInfo info = createItemInfo(itemsAreaComp, localPageID, TimelineUtils.getChartType(selectedItemList.get(i)));
ItemList.add(info);
}
private void setSelectionMarkerEndVal(Double endTime) {
double selectionMarkerStartValue = selectionMarker.getStartValue();
double selectionMarkerEndValue = selectionMarker.getEndValue();
- if (endTime >= selectionMarkerStartValue
- && endTime <= selectionMarkerEndValue) {
+ if (endTime >= selectionMarkerStartValue && endTime <= selectionMarkerEndValue) {
return;
}
- double minSelectionWidthTime = selectionMarkerEndValue
- - selectionMarkerStartValue;
- if (endTime < selectionMarkerStartValue
- && endTime > selectionMarkerStartValue - minSelectionWidthTime) {
+ double minSelectionWidthTime = selectionMarkerEndValue - selectionMarkerStartValue;
+ if (endTime < selectionMarkerStartValue && endTime > selectionMarkerStartValue - minSelectionWidthTime) {
selectionMarker.setStartValue(endTime);
return;
}
long coolBarTime = CoolbarArea.getInstance().getTime();
if (tempDownTime == tempUpTime) {
- long time = (long) ((tempDownTime - TimelineConstants.MS_TO_FIXEDMS)
- * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
+ long time = (long) (tempDownTime * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
if (time <= coolBarTime) {
- AnalyzerManager.getCurrentPage().updatePage(
- new DASelectionData(TimelineComposite.ID, time, time,
- null, null));
+ AnalyzerManager.getCurrentPage().updatePage(new DASelectionData(TimelineComposite.ID, time, time, null, null));
}
} else {
- long startTime = (long) ((selectionMarker.getStartValue() - TimelineConstants.MS_TO_FIXEDMS)
- * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
- long endTime = (long) ((selectionMarker.getEndValue() - TimelineConstants.MS_TO_FIXEDMS)
- * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
+ long startTime = (long) (selectionMarker.getStartValue() * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
+ long endTime = (long) (selectionMarker.getEndValue() * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
if (startTime < coolBarTime) {
if (endTime > coolBarTime) {
endTime = coolBarTime;
}
- AnalyzerManager.getCurrentPage().updatePage(
- new DASelectionData(TimelineComposite.ID, startTime,
- endTime, null, null));
+ AnalyzerManager.getCurrentPage().updatePage(new DASelectionData(TimelineComposite.ID, startTime, endTime, null, null));
}
}
}
private Composite createItemPage(int tabID, Composite rscPage) {
/* CPU */
- ItemInfo infoCPU = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_CPU);
+ ItemInfo infoCPU = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_CPU);
realTimeItemList.add(infoCPU);
/* CPU Core */
- ItemInfo infoCPUCore = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_CPU_CORE);
+ ItemInfo infoCPUCore = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_CPU_CORE);
realTimeItemList.add(infoCPUCore);
/* CPU Frequency */
@SuppressWarnings("unused")
- ItemInfo infoCPUFreq = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_CPU_FREQUENCY);
+ ItemInfo infoCPUFreq = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_CPU_FREQUENCY);
// realTimeItemList.add(infoCPUFreq);
/* Allocated memory */
- ItemInfo infoAlloc = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_HEAP);
+ ItemInfo infoAlloc = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_HEAP);
realTimeItemList.add(infoAlloc);
/* Process memory */
- ItemInfo infoProcessMem = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_PROCESS_SIZE);
+ ItemInfo infoProcessMem = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_PROCESS_SIZE);
realTimeItemList.add(infoProcessMem);
/* Available memory */
- ItemInfo infoAvailableMem = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_SYSTEM_MEMORY);
+ ItemInfo infoAvailableMem = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_SYSTEM_MEMORY);
realTimeItemList.add(infoAvailableMem);
/* Snapshot */
@SuppressWarnings("unused")
- ItemInfo infoSnapshot = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_SNAPSHOT);
+ ItemInfo infoSnapshot = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_SNAPSHOT);
// realTimeItemList.add(infoSnapshot);
/* Device */
// TimelineConstants.CHART_TYPE_ENERGY);
// realTimeItemList.add(infoEnergy);
/* File */
- ItemInfo infoFile = createItemInfo(rscPage, tabID,
- TimelineConstants.CHART_TYPE_FILE);
+ ItemInfo infoFile = createItemInfo(rscPage, tabID, TimelineConstants.CHART_TYPE_FILE);
realTimeItemList.add(infoFile);
// setSelectedItemColor(tabID, realTimeItemList.get(0));
}
private Composite createBatteryPage(int tabID, Composite batPage) {
- ItemInfo infoCPU = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_CPU);
- ItemInfo infoMemory = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_PROCESS_SIZE);
- ItemInfo infoVoltage = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_VOLTAGE);
- ItemInfo infoBright = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_BRIGHTNESS);
- ItemInfo infoWifi = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_WIFI);
- ItemInfo infoBT = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_BT);
- ItemInfo infoGPS = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_GPS);
- ItemInfo infoCamera = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_CAMERA);
- ItemInfo infoAudio = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_AUDIO);
- ItemInfo infoSound = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_SOUND);
- ItemInfo infoVibration = createItemInfo(batPage, tabID,
- TimelineConstants.CHART_TYPE_VIBRATION);
+ ItemInfo infoCPU = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_CPU);
+ ItemInfo infoMemory = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_PROCESS_SIZE);
+ ItemInfo infoVoltage = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_VOLTAGE);
+ ItemInfo infoBright = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_BRIGHTNESS);
+ ItemInfo infoWifi = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_WIFI);
+ ItemInfo infoBT = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_BT);
+ ItemInfo infoGPS = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_GPS);
+ ItemInfo infoCamera = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_CAMERA);
+ ItemInfo infoAudio = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_AUDIO);
+ ItemInfo infoSound = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_SOUND);
+ ItemInfo infoVibration = createItemInfo(batPage, tabID, TimelineConstants.CHART_TYPE_VIBRATION);
batteryItemList.add(infoCPU);
batteryItemList.add(infoMemory);
FormLayout fLayout = new FormLayout();
infoComp.setLayout(fLayout);
- if (chartType != TimelineConstants.CHART_TYPE_SNAPSHOT
- && chartType != TimelineConstants.CHART_TYPE_DEVICE) {
+ if (chartType != TimelineConstants.CHART_TYPE_SNAPSHOT && chartType != TimelineConstants.CHART_TYPE_DEVICE) {
addZoomLabel(infoComp, chartType);
}
addIconInfoLabel(infoComp, chartType);
infoComp.infoZoomLabel.setText(info);
infoComp.infoZoomLabel.setImage(ImageResources.TIMLINE_FULL);
infoComp.infoZoomLabel.setAlignment(SWT.RIGHT);
- FormData fData2 = new FormData(ITEM_INFO_ZOOM_HEIGHT,
- ITEM_INFO_ZOOM_HEIGHT);
+ FormData fData2 = new FormData(ITEM_INFO_ZOOM_HEIGHT, ITEM_INFO_ZOOM_HEIGHT);
fData2.top = new FormAttachment(1, 0);
fData2.left = new FormAttachment(82, 0);
infoComp.infoIconLabel = new Label(infoComp, SWT.NONE);
infoComp.infoIconLabel.setImage(TimelineUtils.getIconImage(chartType));
infoComp.infoIconLabel.setAlignment(SWT.CENTER);
- FormData fData = new FormData(
- TimelineConstants.TIMELINE_ITEM_INFO_WIDTH,
- ITEM_INFO_ICON_HEIGHT);
+ FormData fData = new FormData(TimelineConstants.TIMELINE_ITEM_INFO_WIDTH, ITEM_INFO_ICON_HEIGHT);
fData.top = new FormAttachment(8, 0);
infoComp.infoIconLabel.setLayoutData(fData);
infoComp.infoIconLabel.addMouseListener(itemLableMouseListener);
}
- private boolean addTextInfoLabel(ItemInfoComposite infoComp, int chartType,
- boolean isAlone) {
+ private boolean addTextInfoLabel(ItemInfoComposite infoComp, int chartType, boolean isAlone) {
String info = TimelineUtils.getStringChartType(chartType);
if (null == infoComp || infoComp.isDisposed()) {
infoComp.infoTextLabel.setForeground(ColorResources.WHITE);
infoComp.infoTextLabel.setText(info);
infoComp.infoTextLabel.setAlignment(SWT.CENTER);
- FormData fData2 = new FormData(
- TimelineConstants.TIMELINE_ITEM_INFO_WIDTH,
- ITEM_INFO_LABEL_HEIGHT);
+ FormData fData2 = new FormData(TimelineConstants.TIMELINE_ITEM_INFO_WIDTH, ITEM_INFO_LABEL_HEIGHT);
if (isAlone) {
fData2.top = new FormAttachment(0, 8);
} else {
iteminfo.itemComp.setBackground(ColorResources.GRAY_170);
/* Item info composite */
- final ItemInfoComposite itemInfoComp = createItemInfoComp(
- iteminfo.itemComp, chartType);
+ final ItemInfoComposite itemInfoComp = createItemInfoComp(iteminfo.itemComp, chartType);
if (chartType == TimelineConstants.CHART_TYPE_SNAPSHOT) {
TempConstants.isSnapshotChartDisposed = false;
}
GridData gDataInfo = new GridData();
- if (chartType == TimelineConstants.CHART_TYPE_SNAPSHOT
- || chartType == TimelineConstants.CHART_TYPE_DEVICE) {
+ if (chartType == TimelineConstants.CHART_TYPE_SNAPSHOT || chartType == TimelineConstants.CHART_TYPE_DEVICE) {
gDataInfo.heightHint = TimelineConstants.ITEM_HEIGHT_DEF;
gDataInfo.verticalAlignment = GridData.BEGINNING;
} else {
/* Item Chart composite */
JFreeChart chart = chartManager.createTimelineChart(chartType);
- final ChartComposite itemChartComposite = new ChartComposite(
- iteminfo.itemComp, SWT.NONE, chart, true) {
- protected Menu createPopupMenu(boolean properties, boolean save,
- boolean print, boolean zoom) {
+ final ChartComposite itemChartComposite = new ChartComposite(iteminfo.itemComp, SWT.NONE, chart, true) {
+ protected Menu createPopupMenu(boolean properties, boolean save, boolean print, boolean zoom) {
return null;
}
};
itemChartComposite.setData(chartType);
GridData gDataChart;
- if (chartType == TimelineConstants.CHART_TYPE_SNAPSHOT
- || chartType == TimelineConstants.CHART_TYPE_DEVICE) {
+ if (chartType == TimelineConstants.CHART_TYPE_SNAPSHOT || chartType == TimelineConstants.CHART_TYPE_DEVICE) {
gDataChart = new GridData(GridData.FILL_HORIZONTAL);
gDataChart.heightHint = TempConstants.JFREE_MIN_SIZE;
} else {
if (tooltipMarker == null) {
initTooltipMarker();
}
- itemChartComposite.getChart().getXYPlot()
- .addDomainMarker(selectionMarker, Layer.FOREGROUND);
+ itemChartComposite.getChart().getXYPlot().addDomainMarker(selectionMarker, Layer.FOREGROUND);
// FIXME tooltip
// itemChartComposite.getChart().getXYPlot().addDomainMarker(tooltipMarker,
// Layer.FOREGROUND);
- TimelineMaster.getInstance().addChartPlot(
- itemChartComposite.getChart().getXYPlot());
+ TimelineMaster.getInstance().addChartPlot(itemChartComposite.getChart().getXYPlot());
iteminfo.infoComp = itemInfoComp;
iteminfo.chartComp = itemChartComposite;
}
for (int i = 0; i < ItemList.size(); i++) {
- if (null != ItemList.get(i).chartComp
- && !ItemList.get(i).chartComp.isDisposed()) {
- ItemList.get(i).chartComp
- .removeMouseListener(itemMouseListener);
- ItemList.get(i).chartComp
- .removeMouseTrackListener(chartMouseTrackListener);
- ItemList.get(i).chartComp
- .removeMouseMoveListener(chartMouseMoveListener);
- ItemList.get(i).chartComp.getChart().getXYPlot()
- .removeDomainMarker(selectionMarker);
+ if (null != ItemList.get(i).chartComp && !ItemList.get(i).chartComp.isDisposed()) {
+ ItemList.get(i).chartComp.removeMouseListener(itemMouseListener);
+ ItemList.get(i).chartComp.removeMouseTrackListener(chartMouseTrackListener);
+ ItemList.get(i).chartComp.removeMouseMoveListener(chartMouseMoveListener);
+ ItemList.get(i).chartComp.getChart().getXYPlot().removeDomainMarker(selectionMarker);
// FIXME tooltip
// ItemList.get(i).chartComp.getChart().getXYPlot().removeDomainMarker(tooltipMarker);
}
List<ItemInfo> infoList = getItemInfoList(localPageID);
for (int i = 0; i < infoList.size(); i++) {
- TimelineItemSetting itemSetting = TimelineItemSettingProvider
- .getItemSetting(infoList.get(i).itemType);
+ TimelineItemSetting itemSetting = TimelineItemSettingProvider.getItemSetting(infoList.get(i).itemType);
setItemSize(infoList.get(i), width, itemSetting.getSizeMode());
}
Rectangle rect = composite.getClientArea();
if (null == itemImage) {
- itemImage = new Image(composite.getDisplay(), 1, Math.max(1,
- rect.height));
+ itemImage = new Image(composite.getDisplay(), 1, Math.max(1, rect.height));
GC gc = new GC(itemImage);
gc.setForeground(ColorResources.GRAY_210); // brighter
gc.setBackground(ColorResources.GRAY_130); // darker
} else if (itemImage.getBounds().height != rect.height) {
itemImage.dispose();
- itemImage = new Image(composite.getDisplay(), 1, Math.max(1,
- rect.height));
+ itemImage = new Image(composite.getDisplay(), 1, Math.max(1, rect.height));
GC gc = new GC(itemImage);
gc.setForeground(ColorResources.GRAY_210); // brighter
gc.setBackground(ColorResources.GRAY_130); // darker
Rectangle rect = composite.getClientArea();
if (null == selectedItemImage) {
- selectedItemImage = new Image(composite.getDisplay(), 1, Math.max(
- 1, rect.height));
+ selectedItemImage = new Image(composite.getDisplay(), 1, Math.max(1, rect.height));
GC gc = new GC(selectedItemImage);
gc.setForeground(ColorResources.ITEM_BLUE_BRIGHT); // brighter
gc.setBackground(ColorResources.ITEM_BLUE_DARK); // darker
} else if (selectedItemImage.getBounds().height != rect.height) {
selectedItemImage.dispose();
- selectedItemImage = new Image(composite.getDisplay(), 1, Math.max(
- 1, rect.height));
+ selectedItemImage = new Image(composite.getDisplay(), 1, Math.max(1, rect.height));
GC gc = new GC(selectedItemImage);
gc.setForeground(ColorResources.ITEM_BLUE_BRIGHT); // brighter
gc.setBackground(ColorResources.ITEM_BLUE_DARK); // darker
}
if (isSelected) {
- chartComp.getChart().setBackgroundPaint(
- ColorResources.ITEM_BLUE_AWT);
+ chartComp.getChart().setBackgroundPaint(ColorResources.ITEM_BLUE_AWT);
} else {
chartComp.getChart().setBackgroundPaint(ColorResources.ITEM_BG_AWT);
}
ScrolledComposite sc = (ScrolledComposite) itemsAreaComp.getParent();
if (itemsAreaComp.getBounds().height - sc.getClientArea().height < focusY) {
- focusY = itemsAreaComp.getBounds().height
- - sc.getClientArea().height;
+ focusY = itemsAreaComp.getBounds().height - sc.getClientArea().height;
}
itemsAreaComp.setLocation(0, -focusY);
sc.getVerticalBar().setSelection(focusY);
}
- private void setItemInfoIconVisible(ItemInfoComposite infoComp,
- boolean isIconVisible) {
+ private void setItemInfoIconVisible(ItemInfoComposite infoComp, boolean isIconVisible) {
if (null == infoComp) {
return;
}
if (isIconVisible) {
- if (null == infoComp.getIconLabel()
- || infoComp.getIconLabel().isDisposed()) {
- addIconInfoLabel(infoComp,
- TimelineUtils.getChartType(infoComp.ID));
+ if (null == infoComp.getIconLabel() || infoComp.getIconLabel().isDisposed()) {
+ addIconInfoLabel(infoComp, TimelineUtils.getChartType(infoComp.ID));
if (null != infoComp.infoTextLabel) {
infoComp.infoTextLabel.dispose();
}
- addTextInfoLabel(infoComp,
- TimelineUtils.getChartType(infoComp.ID), false);
+ addTextInfoLabel(infoComp, TimelineUtils.getChartType(infoComp.ID), false);
}
} else {
if (null != infoComp.infoIconLabel) {
infoComp.infoIconLabel.dispose();
infoComp.infoTextLabel.dispose();
- boolean isSucced = addTextInfoLabel(infoComp,
- TimelineUtils.getChartType(infoComp.ID), true);
+ boolean isSucced = addTextInfoLabel(infoComp, TimelineUtils.getChartType(infoComp.ID), true);
if (isSucced) {
infoComp.layout();
}