import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
}
DACustomChartSeries series = seriesList.get(i);
int index = series.getPrevIndexByXvalue(realXVal);
- String text;
+ String text = "";
if (index >= 0) {
double yVal = series.getSeriesItemList().get(index).getY();
double xVal = series.getSeriesItemList().get(index).getX();
- text = series.getName()
- + " : "
- + series.getSeriesItemList().get(index)
- .getTooltipText();
+ if(!(plot instanceof DACustomUIEventChartPlot)) {
+ text += series.getName() + " : ";
+ }
+ text += series.getSeriesItemList().get(index).getTooltipText();
gc.setForeground(tooltip.getLineColor());
gc.setLineStyle(SWT.LINE_DOT);
gc.setLineWidth(1);
- if (!(plot instanceof DACustomUIEventChartPlot)) {
+
+ if(!(plot instanceof DACustomUIEventChartPlot)) {
gc.drawLine(0, plot.getYPixcelFromY(series, yVal, r),
r.width, plot.getYPixcelFromY(series, yVal, r));
}
-
+
gc.drawLine(plot.getXPixcelFromX(xVal), 0,
plot.getXPixcelFromX(xVal), r.height);
gc.setLineStyle(SWT.LINE_CUSTOM);
gc.setBackground(tooltip.getBackgroundColor());
gc.setForeground(tooltip.getTextColor());
- gc.fillRectangle(startX, ((r.y + r.height) / 2) - (totalHeight / 2),
+
+ int startY;
+ if(plot instanceof DACustomUIEventChartPlot) {
+ startY = (int)(r.height * (int)(tooltip.getYPosRatio() * seriesList.size()) / seriesList.size());
+ if(r.height - startY - totalHeight < 0) {
+ startY = r.height - totalHeight - 1;
+ if(startY < 0) {
+ startY = 0;
+ }
+ }
+
+ } else {
+ startY = (r.y + r.height / 2) - (totalHeight / 2);
+ }
+
+ gc.fillRectangle(startX, startY,
preTextWidthMargin + textWidthMax
+ DACustomChartPlotTooltip.TOOLTIP_MARGIN, totalHeight);
- gc.drawRectangle(startX, ((r.y + r.height) / 2) - (totalHeight / 2),
+ gc.drawRectangle(startX, startY,
preTextWidthMargin + textWidthMax
+ DACustomChartPlotTooltip.TOOLTIP_MARGIN, totalHeight);
gc.setFont(tooltip.getFont());
for (int i = 0; i < seriesList.size(); i++) {
- DACustomChartSeries series = seriesList.get(i);
- int y = ((r.y + r.height) / 2) - (totalHeight / 2)
+ int y = startY
+ (textHeightMax * i)
+ DACustomChartPlotTooltip.TOOLTIP_MARGIN;
- if (series.getStyle() != DACustomChartSeries.SERIES_STYLE_IMAGE) {
- gc.setBackground(series.getColor());
+ DACustomChartSeries series;
+ if (plot instanceof DACustomUIEventChartPlot) {
+ series = seriesList.get((int) (seriesList.size() * tooltip.getYPosRatio()));
+ } else {
+ series = seriesList.get(i);
}
+ gc.setBackground(series.getColor());
gc.fillRectangle(
startX + DACustomChartPlotTooltip.TOOLTIP_MARGIN,
- y
- + textHeightMax
- / 2
- - DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
- / 2,
+ y + textHeightMax / 2 - DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH / 2,
DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH,
DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH);
gc.setBackground(tooltip.getBackgroundColor());
gc.drawText(tooltipTexts.get(i), startX
+ DACustomChartPlotTooltip.TOOLTIP_MARGIN
+ DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
-// + DACustomChartPlotTooltip.TOOLTIP_MARGIN, y, SWT.DRAW_DELIMITER);
-// if(plot instanceof DACustomUIEventChartPlot) {
- + DACustomChartPlotTooltip.TOOLTIP_MARGIN, y);
+ + DACustomChartPlotTooltip.TOOLTIP_MARGIN, y, SWT.DRAW_DELIMITER);
if (plot instanceof DACustomUIEventChartPlot) {
break;
}
int seriesItemSize = seriesItems.size();
Rectangle rect = new Rectangle(r.x, r.y + (r.height/seriesSize * seriesIndex), r.width, r.height/seriesSize);
gc.setForeground(ColorResources.UI_EVENT_CHART_TEXT);
+ Font tempFont = gc.getFont();
gc.setFont(FontResources.TIMELINE_TICK_FONT);
gc.drawText(series.getName(), rect.x + 3, rect.y + 3, true);
+ gc.setFont(tempFont);
if(seriesIndex != 0) {
gc.setForeground(ColorResources.UI_EVENT_CHART_SEPERATE_LINE);
gc.drawLine(rect.x, rect.y, rect.width, rect.y);
private DACustomChartSeries orientationEventSeries;
private DACustomChartSeries frameworkEventSeries;
- private final int EVENT_TYPE = 12;
- private final int DETAIL_TYPE = 13;
- private final int X = 14;
- private final int Y = 15;
- private final int INFO1 = 16;
- private final int INFO2 = 17;
-
private final int TYPE_KEY = 1;
private final int TYPE_TOUCH = 2;
private final int TYPE_GESTURE = 3;
keyEventSeries.addSeriesItem(new DACustomChartSeriesItem(10, 10, "key1"));
gestureEventSeries.addSeriesItem(new DACustomChartSeriesItem(10, 100, "gesture1"));
gestureEventSeries.addSeriesItem(new DACustomChartSeriesItem(15, 100, "gesture2"));
- gestureEventSeries.addSeriesItem(new DACustomChartSeriesItem(30, 100, "gesture2"));
+ gestureEventSeries.addSeriesItem(new DACustomChartSeriesItem(30, 100, "gesture2\nn\nn\nn\nn\nn\nn"));
keyEventSeries.addSeriesItem(new DACustomChartSeriesItem(20, 100, "key2"));
keyEventSeries.addSeriesItem(new DACustomChartSeriesItem(25, 100, "key3"));
+ frameworkEventSeries.addSeriesItem(new DACustomChartSeriesItem(40, 30, "framework\nframework"));
}
@Override
private void parsingLog(List<String> log) {
double time = Double.parseDouble(log.get(LogCenterConstants.TIME_INDEX)) / TimelineConstants.MEGA;
- int type = Integer.parseInt(log.get(EVENT_TYPE));
- int detailType = Integer.parseInt(log.get(DETAIL_TYPE));
+ int type = Integer.parseInt(log.get(LogCenterConstants.UI_EVENT_EVENT_TYPE));
+ int detailType = Integer.parseInt(log.get(LogCenterConstants.UI_EVENT_DETAIL_TYPE));
switch (type) {
case TYPE_KEY:
- String keyName = log.get(INFO1);
+ String keyName = log.get(LogCenterConstants.UI_EVENT_INFO1);
String keyStatus;
if(detailType == 0) {
keyStatus = KEY_DOWN;
keyEventSeries.addSeriesItem(new DACustomChartSeriesItem(time, 0, keyName + SPACE + keyStatus));
break;
case TYPE_TOUCH:
- String info = EnumTouchStatus.values()[Integer.parseInt(log.get(DETAIL_TYPE))].getStatus() + NEW_LINE
- + log.get(X) + NEW_LINE
- + log.get(Y) + NEW_LINE;
+ String info = EnumTouchStatus.values()[Integer.parseInt(log.get(LogCenterConstants.UI_EVENT_DETAIL_TYPE))].getStatus() + NEW_LINE
+ + log.get(LogCenterConstants.UI_EVENT_X) + NEW_LINE
+ + log.get(LogCenterConstants.UI_EVENT_Y);
// + log.get(INFO2);
touchEventSeries.addSeriesItem(new DACustomChartSeriesItem(time, 0, info));
break;
gestureEventSeries.addSeriesItem(new DACustomChartSeriesItem(time, 0));
break;
case TYPE_ORIENTATION:
- orientationEventSeries.addSeriesItem(new DACustomChartSeriesItem(time, 0, log.get(INFO1)));
+ orientationEventSeries.addSeriesItem(new DACustomChartSeriesItem(time, 0, log.get(LogCenterConstants.UI_EVENT_INFO1)));
break;
case TYPE_FRAMEWORK:
// FIXME argument