[Title]chart widget tooltip add
authoryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Wed, 15 Aug 2012 11:08:46 +0000 (20:08 +0900)
committeryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Wed, 15 Aug 2012 11:08:46 +0000 (20:08 +0900)
[Type]
[Module]chart
[Priority]high
[CQ#]
[Redmine#]6184
[Problem]
[Cause]
[Solution]
[TestCase]

org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartPlot.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartPlotIntervalMarker.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartPlotTooltip.java [new file with mode: 0644]
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartRenderer.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartSeries.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineChartManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineItemManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DACPUChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/chart/DATimelineChart.java

index 017e054..1440d35 100644 (file)
@@ -1,23 +1,19 @@
 package org.tizen.dynamicanalyzer.widgets.chart;
 
-import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.widgets.Display;
 
 public class DACustomChartPlot {
        private double startX = 0;
        private double endX = 0;
        private double startY = 0;
        private double endY = 0;
-       private double rangeStartX = 0;
-       private double rangeEndX = 0;
-       private Color rangeColor = null;
        private boolean bAutoHeightRange = false;
        private Image backgroundImage = null;
        private DACustomChart chart;
        private DACustomChartPlotIntervalMarker marker = null;
-
+       private DACustomChartPlotTooltip tooltip = null;
+       
        public DACustomChartPlot(DACustomChart chart) {
                this.chart = chart;
        }
@@ -35,59 +31,40 @@ public class DACustomChartPlot {
                endX = 0;
                startY = 0;
                endY = 0;
-               rangeStartX = 0;
-               rangeEndX = 0;
+               removeIntervalMarker();
+               removeTooltip();
        }
 
        public void setIntervalMarker(DACustomChartPlotIntervalMarker marker){
                this.marker = marker;
-               this.marker.setChart(chart);
+               this.marker.registerChart(chart);
+       }
+       
+       public void removeIntervalMarker(){
+               if(null!=marker){
+                       this.marker.unRegisterChart(chart);
+                       this.marker = null;
+               }
        }
        
        public DACustomChartPlotIntervalMarker getIntervalMarker(){
                return marker;
        }
 
-       public void setRange(double startX, double endX) {
-               this.rangeStartX = startX;
-               this.rangeEndX = endX;
-               chart.redraw();
-       }
-
-       public void setRangeFromPixcel(int startXPixcel, int endXPixcel) {
-               setRange(getXFromXPixcel(startXPixcel), getXFromXPixcel(endXPixcel));
-               chart.redraw();
-       }
-
-       public void setRangeStart(double startX) {
-               this.rangeStartX = startX;
-               chart.redraw();
-       }
-
-       public void setRangeStartFromPixcel(int startXPixcel) {
-               setRangeStart(getXFromXPixcel(startXPixcel));
-               chart.redraw();
-       }
-
-       public void setRangeEnd(double endX) {
-               this.rangeEndX = endX;
-               chart.redraw();
-       }
-
-       public void setRangeEndFromPixcel(int endXPixcel) {
-               setRangeEnd(getXFromXPixcel(endXPixcel));
-               chart.redraw();
+       public void setTooltip(DACustomChartPlotTooltip tooltip) {
+               this.tooltip = tooltip;
+               this.tooltip.registerChart(chart);
        }
-
-       public Color getRangeColor() {
-               if (null == rangeColor) {
-                       rangeColor = new Color(Display.getCurrent(), 23, 98, 132);
+       
+       public void removeTooltip(){
+               if(null!=tooltip){
+                       this.tooltip.unRegisterChart(chart);
+                       this.tooltip = null;
                }
-               return rangeColor;
        }
-
-       public void setRangeColor(Color rangeColor) {
-               this.rangeColor = rangeColor;
+       
+       public DACustomChartPlotTooltip getTooltip() {
+               return tooltip;
        }
 
        public void setAxisRangeX(double startX, double endX) {
@@ -136,14 +113,6 @@ public class DACustomChartPlot {
                return startY;
        }
 
-       public double getRangeStartX() {
-               return rangeStartX;
-       }
-
-       public double getRangeEndX() {
-               return rangeEndX;
-       }
-
        public double getEndY() {
                return endY;
        }
@@ -193,5 +162,4 @@ public class DACustomChartPlot {
                Rectangle r = chart.getBounds();
                return getYFromYPixcel(yPixcel, r);
        }
-
 }
index 94aa8e4..e5ad72a 100644 (file)
@@ -1,5 +1,8 @@
 package org.tizen.dynamicanalyzer.widgets.chart;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.widgets.Display;
 
@@ -9,27 +12,44 @@ public class DACustomChartPlotIntervalMarker {
        private int alpha = (int) (255*0.25);   //default
        private Color backgroundColor;
        private Color foregroundColor;
-       private DACustomChart chart;
+       private List<DACustomChart> charts = new ArrayList<DACustomChart>();
        
        public DACustomChartPlotIntervalMarker(double start, double end){
                startVal = start;
                endVal = end;
        }
        
-       public DACustomChart getChart(){
-               return chart;
+       public List<DACustomChart> getRegisteChartList(){
+               return charts;
+       }
+       
+       public void registerChart(DACustomChart chart){
+               charts.add(chart);
        }
        
-       public void setChart(DACustomChart chart){
-               this.chart = chart;
+       public void unRegisterChart(DACustomChart chart){
+               for(int i=0; i<charts.size(); i++){
+                       if(charts.get(i).equals(chart)){
+                               charts.remove(i);
+                       }
+               }
+       }
+       
+       private void redrawRegisteredChart(){
+               for(int i=0; i<charts.size(); i++){
+                       if(charts.get(i).isDisposed()){
+                               charts.remove(i);
+                       }
+                       else{
+                               charts.get(i).redraw();
+                       }
+               }
        }
        
        public void setInterval(double start, double end){
                startVal = start;
                endVal = end;
-               if(null != chart){
-                       chart.redraw();
-               }
+               redrawRegisteredChart();
        }
 
        public double getStartVal() {
@@ -38,9 +58,7 @@ public class DACustomChartPlotIntervalMarker {
 
        public void setStartVal(double startVal) {
                this.startVal = startVal;
-               if(null != chart){
-                       chart.redraw();
-               }
+               redrawRegisteredChart();
        }
 
        public double getEndVal() {
@@ -49,9 +67,7 @@ public class DACustomChartPlotIntervalMarker {
 
        public void setEndVal(double endVal) {
                this.endVal = endVal;
-               if(null != chart){
-                       chart.redraw();
-               }
+               redrawRegisteredChart();
        }
 
        public int getAlpha() {
@@ -60,9 +76,7 @@ public class DACustomChartPlotIntervalMarker {
 
        public void setAlpha(int alpha) {
                this.alpha = alpha;
-               if(null != chart){
-                       chart.redraw();
-               }
+               redrawRegisteredChart();
        }
 
        public Color getBackgroundColor() {
@@ -74,9 +88,7 @@ public class DACustomChartPlotIntervalMarker {
 
        public void setBackgroundColor(Color backgroundColor) {
                this.backgroundColor = backgroundColor;
-               if(null != chart){
-                       chart.redraw();
-               }
+               redrawRegisteredChart();
        }
 
        public Color getForegroundColor() {
@@ -85,8 +97,6 @@ public class DACustomChartPlotIntervalMarker {
 
        public void setForegroundColor(Color foregroundColor) {
                this.foregroundColor = foregroundColor;
-               if(null != chart){
-                       chart.redraw();
-               }
+               redrawRegisteredChart();
        }
 }
diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartPlotTooltip.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chart/DACustomChartPlotTooltip.java
new file mode 100644 (file)
index 0000000..005452c
--- /dev/null
@@ -0,0 +1,125 @@
+package org.tizen.dynamicanalyzer.widgets.chart;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.widgets.Display;
+
+public class DACustomChartPlotTooltip {
+       public static final int TOOLTIP_MARGIN = 5;
+       public static final int TOOLTIP_HEIGHT = 30;
+       public static final int TOOLTIP_SERIES_RECT_LENGTH = 10;
+       private boolean bTooltip = false;
+       private double startVal;
+       private Color backgroundColor;
+       private Color lineColor;
+       private Color textColor;
+       private Font font;
+       private List<DACustomChart> charts = new ArrayList<DACustomChart>();
+       
+       public DACustomChartPlotTooltip(double start){
+               setStartVal(start);
+       } 
+       
+       public List<DACustomChart> getRegisteChartList(){
+               return charts;
+       }
+
+       public void registerChart(DACustomChart chart){
+               charts.add(chart);
+       }
+       
+       public void unRegisterChart(DACustomChart chart){
+               for(int i=0; i<charts.size(); i++){
+                       if(charts.get(i).equals(chart)){
+                               charts.remove(i);
+                       }
+               }
+       }
+       
+       private void redrawRegisteredChart(){
+               for(int i=0; i<charts.size(); i++){
+                       if(charts.get(i).isDisposed()){
+                               charts.remove(i);
+                       }
+                       else{
+                               charts.get(i).redraw();
+                       }
+               }
+       }
+       
+       public Color getBackgroundColor() {
+               if (null == backgroundColor) {
+                       backgroundColor = new Color(Display.getCurrent(), 193, 193, 193);
+               }
+               return backgroundColor;
+       }
+
+       public void setBackgroundColor(Color backgroundColor) {
+               this.backgroundColor = backgroundColor;
+               if(true == bTooltip){
+                       redrawRegisteredChart();
+               }
+       }
+       
+       public Color getLineColor() {
+               if (null == lineColor) {
+                       lineColor = new Color(Display.getCurrent(), 193, 193, 193);
+               }
+               return lineColor;
+       }
+       
+       public void setLineColor(Color lineColor) {
+               this.lineColor = lineColor;
+               if(true == bTooltip){
+                       redrawRegisteredChart();
+               }
+       }
+       
+       public Color getTextColor() {
+               if (null == textColor) {
+                       textColor = new Color(Display.getCurrent(), 0, 0, 0);
+               }
+               return textColor;
+       }
+       
+       public void setTextColor(Color textColor) {
+               this.textColor = textColor;
+               if(true == bTooltip){
+                       redrawRegisteredChart();
+               }
+       }
+
+       public Font getFont() {
+               return font;
+       }
+
+       public void setFont(Font font) {
+               this.font = font;
+               if(true == bTooltip){
+                       redrawRegisteredChart();
+               }
+       }
+
+       public double getStartVal() {
+               return startVal;
+       }
+
+       public void setStartVal(double startVal) {
+               this.startVal = startVal;
+               if(true == bTooltip){
+                       redrawRegisteredChart();
+               }
+       }
+
+       public boolean isTooltip() {
+               return bTooltip;
+       }
+
+       public void setTooltip(boolean show) {
+               this.bTooltip = show;
+               redrawRegisteredChart();
+       }
+}
index 4ec119b..3c7ab24 100644 (file)
@@ -1,5 +1,6 @@
 package org.tizen.dynamicanalyzer.widgets.chart;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import org.eclipse.swt.SWT;
@@ -64,8 +65,8 @@ public class DACustomChartRenderer {
                                }
                        }
                }
+               drawTooltip(gc);
                drawRange(gc);
-
        }
 
        private void initialize(GC gc, DACustomChart chart) {
@@ -76,12 +77,12 @@ public class DACustomChartRenderer {
 
        public void drawRange(GC gc) {
                DACustomChartPlotIntervalMarker marker = plot.getIntervalMarker();
-               if(null == marker){
+               if (null == marker) {
                        return;
                }
-               int pixcelStartX =  plot.getXPixcelFromX(marker.getStartVal());
+               int pixcelStartX = plot.getXPixcelFromX(marker.getStartVal());
                int pixcelEndX = plot.getXPixcelFromX(marker.getEndVal());
-               
+
                Color color = marker.getBackgroundColor();
                int alpha = gc.getAlpha();
                gc.setAlpha(marker.getAlpha());
@@ -89,8 +90,7 @@ public class DACustomChartRenderer {
                        gc.setForeground(color);
                        gc.setLineWidth(2);
                        gc.drawLine(pixcelStartX, r.y, pixcelStartX, r.height);
-               }
-               else{
+               } else {
                        gc.setBackground(color);
                        gc.fillRectangle(pixcelStartX, 0, pixcelEndX - pixcelStartX,
                                        r.height);
@@ -98,6 +98,94 @@ public class DACustomChartRenderer {
                gc.setAlpha(alpha);
        }
 
+       private int getTooltipStartX(double startVal, int width, int margin) {
+               int ret = plot.getXPixcelFromX(startVal);
+               if (ret + width > r.x + r.width) {
+                       ret = ret - width - margin;
+               } else {
+                       ret += margin;
+               }
+
+               return ret;
+       }
+
+       public void drawTooltip(GC gc) {
+               DACustomChartPlotTooltip tooltip = plot.getTooltip();
+               if (null == tooltip || false == tooltip.isTooltip()
+                               || -1 == tooltip.getStartVal()) {
+                       return;
+               }
+               gc.setBackground(tooltip.getBackgroundColor());
+
+               List<String> tooltipTexts = new ArrayList<String>();
+
+               // make text & draw line
+               int textWidthMax = 0;
+               double realXVal = tooltip.getStartVal();
+               for (int i = 0; i < seriesList.size(); i++) {
+                       DACustomChartSeries series = seriesList.get(i);
+                       double yVal = series.getSeriesItemList()
+                                       .get(series.getPrevIndexByXvalue(realXVal)).getY();
+                       double xVal = series.getSeriesItemList()
+                                       .get(series.getPrevIndexByXvalue(realXVal)).getX();
+                       String text = series.getName() + ":" + yVal
+                                       + series.getSeriesUnit();
+                       tooltipTexts.add(text);
+                       int textWidth = gc.textExtent(text).x;
+                       if (textWidthMax < textWidth) {
+                               textWidthMax = textWidth;
+                       }
+
+                       gc.setForeground(tooltip.getLineColor());
+                       gc.setLineStyle(SWT.LINE_DOT);
+                       gc.drawLine(0, plot.getYPixcelFromY(yVal), r.width,
+                                       plot.getYPixcelFromY(yVal));
+                       gc.drawLine(plot.getXPixcelFromX(xVal), 0,
+                                       plot.getXPixcelFromX(xVal), r.height);
+                       gc.setLineStyle(SWT.LINE_CUSTOM);
+               }
+               int startX = getTooltipStartX(realXVal, textWidthMax
+                               + DACustomChartPlotTooltip.TOOLTIP_MARGIN,
+                               DACustomChartPlotTooltip.TOOLTIP_MARGIN);
+               int totalHeight = seriesList.size()
+                               * DACustomChartPlotTooltip.TOOLTIP_HEIGHT;
+
+               gc.setBackground(tooltip.getBackgroundColor());
+               gc.setForeground(tooltip.getTextColor());
+               gc.fillRectangle(startX, ((r.y + r.height) / 2) - (totalHeight / 2),
+                               DACustomChartPlotTooltip.TOOLTIP_MARGIN
+                                               + DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+                                               + DACustomChartPlotTooltip.TOOLTIP_MARGIN
+                                               + textWidthMax
+                                               + DACustomChartPlotTooltip.TOOLTIP_MARGIN, totalHeight);
+               gc.drawRectangle(startX, ((r.y + r.height) / 2) - (totalHeight / 2),
+                               DACustomChartPlotTooltip.TOOLTIP_MARGIN
+                                               + DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+                                               + DACustomChartPlotTooltip.TOOLTIP_MARGIN
+                                               + textWidthMax
+                                               + DACustomChartPlotTooltip.TOOLTIP_MARGIN, totalHeight);
+
+               for (int i = 0; i < seriesList.size(); i++) {
+                       DACustomChartSeries series = seriesList.get(i);
+                       int y = ((r.y + r.height) / 2) - (totalHeight / 2)
+                                       + (DACustomChartPlotTooltip.TOOLTIP_HEIGHT * i);
+                       gc.setBackground(series.getColor());
+                       gc.fillRectangle(
+                                       startX + DACustomChartPlotTooltip.TOOLTIP_MARGIN,
+                                       y
+                                                       + (DACustomChartPlotTooltip.TOOLTIP_HEIGHT / 2 - DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH / 2),
+                                       DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH,
+                                       DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH);
+                       gc.setBackground(tooltip.getBackgroundColor());
+                       gc.drawString(tooltipTexts.get(i), startX
+                                       + DACustomChartPlotTooltip.TOOLTIP_MARGIN
+                                       + DACustomChartPlotTooltip.TOOLTIP_SERIES_RECT_LENGTH
+                                       + DACustomChartPlotTooltip.TOOLTIP_MARGIN, y
+                                       + DACustomChartPlotTooltip.TOOLTIP_MARGIN);
+               }
+
+       }
+
        private void drawBarSeries(GC gc, DACustomChartSeries series) {
                List<DACustomChartSeriesItem> seriesItems = series.getSeriesItemList();
                if (null == seriesItems) {
index e2ea226..1750799 100644 (file)
@@ -20,6 +20,7 @@ public class DACustomChartSeries {
        private double barWidth = SERIES_DEFAULT_BAR_WIDTH;
        private double maxX = 0;
        private double maxY = 0;
+       private String seriesUnit = "";
 
        public DACustomChartSeries(String name, int chartStyle) {
                this.name = name;
@@ -84,6 +85,52 @@ public class DACustomChartSeries {
                return maxY;
        }
 
+       public String getSeriesUnit() {
+               return seriesUnit;
+       }
+
+       public void setSeriesUnit(String seriesUnit) {
+               this.seriesUnit = seriesUnit;
+       }
+       
+       public int getPrevIndexByXvalue(double x){
+               int current;
+               int seriesItemSize = seriesItems.size();
+
+               if(0 == seriesItemSize){
+                       return -1;
+               }
+               else if(seriesItemSize <= (int)x){
+                       current = seriesItemSize-1;
+               }
+               else if((int)x < 0){
+                       current = 0;
+               }
+               else{
+                       current = (int)x;
+               }
+               int i;
+               if(seriesItems.get(current).getX() == x){
+                       return current;
+               }
+               else if(seriesItems.get(current).getX() < x){
+                       for(i=current+1; i<seriesItemSize; i++){
+                               if(seriesItems.get(i).getX() > x){
+                                       break;
+                               }
+                       }
+                       return i-1;
+               }
+               else{
+                       for(i=current-1; i>0; i--){
+                               if(seriesItems.get(i).getX() <= x){
+                                       break;
+                               }
+                       }
+                       return i;
+               }
+       }
+
        public void clear() {
                seriesItems.clear();
                maxX = 0;
index 14d2fe7..972fb2e 100644 (file)
@@ -127,7 +127,12 @@ public class TimelineChartManager {
        public TimelineChart getTimelineChartInstance(int chartType) {
                switch(chartType) {
                case TimelineConstants.CHART_TYPE_CPU:
-                       return CPUChart.getInstance();
+                       if(TimelineItemManager.bCustomChart == true){
+                               return DACPUChart.getInstance();
+                       }
+                       else{
+                               return CPUChart.getInstance();
+                       }
                case TimelineConstants.CHART_TYPE_CPU_CORE:
                        return CPUCoreChart.getInstance();
                case TimelineConstants.CHART_TYPE_CPU_FREQUENCY:
index da14dc9..f75d677 100644 (file)
@@ -18,6 +18,7 @@ import org.tizen.dynamicanalyzer.model.DAView;
 import org.tizen.dynamicanalyzer.model.LogPackage;
 import org.tizen.dynamicanalyzer.model.Logs;
 import org.tizen.dynamicanalyzer.model.SnapshotData;
+import org.tizen.dynamicanalyzer.timeline.chart.DATimelineChart;
 import org.tizen.dynamicanalyzer.timeline.chart.TimelineChart;
 import org.tizen.dynamicanalyzer.ui.views.CoolbarArea;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
@@ -275,10 +276,11 @@ public class TimelineComposite extends DAView {
                int probeType = TimelineUtils.getProbeID(chartType);
 
                TimelineChart timelineChart = TimelineChartManager.getInstance().getTimelineChartInstance(chartType);
-               if(chartType == TimelineConstants.CHART_TYPE_CPU && TimelineItemManager.bCustomChart == true) {
-               } else {
+//             if(chartType == TimelineConstants.CHART_TYPE_CPU && TimelineItemManager.bCustomChart == true) {
+//                     ((DATimelineChart)timelineChart).parsingLogList(logPack, probeType);
+//             } else {
                        timelineChart.parsingLogList(logPack, probeType);
-               }
+//             }
        }
 
        @Override
index 274de93..3e5fed7 100755 (executable)
@@ -56,6 +56,8 @@ import org.tizen.dynamicanalyzer.utils.TimelineUtils;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartPlotIntervalMarker;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartPlotTooltip;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries;
 
 public class TimelineItemManager {
        private static final int ITEM_INFO_ZOOM_HEIGHT = 16;
@@ -78,7 +80,8 @@ public class TimelineItemManager {
        private Image selectedItemImage;
 
        private IntervalMarker selectionMarker;
-       private DACustomChartPlotIntervalMarker intervalMarker; // for DACustomChart Selection 
+       private DACustomChartPlotIntervalMarker intervalMarker; // for DACustomChart
+                                                                                                                       // Selection
 
        private Shell tooltip;
 
@@ -144,7 +147,8 @@ public class TimelineItemManager {
        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;
@@ -155,12 +159,14 @@ public class TimelineItemManager {
 
                        TimelineItemSettingProvider.setItemZoomToggle(itemID);
 
-                       TimelineComposite timelineComposite = AnalyzerUtil.getTimelineComposite();
+                       TimelineComposite timelineComposite = AnalyzerUtil
+                                       .getTimelineComposite();
                        if (null != timelineComposite) {
                                timelineComposite.resizeItemArea();
                                setActivateItem(itemInfoComp.itemName);
 
-                               if (TimelineConstants.ITEM_SIZE_MODE_MAX == TimelineItemSettingProvider.getItemSetting(itemID).getSizeMode()) {
+                               if (TimelineConstants.ITEM_SIZE_MODE_MAX == TimelineItemSettingProvider
+                                               .getItemSetting(itemID).getSizeMode()) {
                                        focusItem(itemID);
                                }
                        }
@@ -188,7 +194,8 @@ public class TimelineItemManager {
                                return;
                        }
 
-                       ItemInfoComposite itemInfoComp = (ItemInfoComposite) label.getParent();
+                       ItemInfoComposite itemInfoComp = (ItemInfoComposite) label
+                                       .getParent();
 
                        if (null == itemInfoComp) {
                                return;
@@ -212,27 +219,84 @@ public class TimelineItemManager {
                }
        };
 
+       private double getTooltipStartX(DACustomChartPlot plot,
+                       List<DACustomChartSeries> seriesList, int x) {
+               double ret = -1;
+               for (int i = 0; i < seriesList.size(); i++) {
+                       DACustomChartSeries series = seriesList.get(i);
+                       int index = series.getPrevIndexByXvalue(plot.getXFromXPixcel(x));
+                       if (-1 == index) {
+                               return ret;
+                       }
+                       double startVal = series.getSeriesItemList().get(index).getX();
+                       if (ret < startVal) {
+                               ret = startVal;
+                       }
+               }
+               return ret;
+       }
+
        private Listener chartMouseListener = new Listener() {
 
                @Override
                public void handleEvent(Event event) {
                        DACustomChart chart = (DACustomChart) event.widget;
                        DACustomChartPlot plot = chart.getPlot();
+                       DACustomChartPlotTooltip tooltip = null;
 
                        switch (event.type) {
                        case SWT.MouseMove:
                                if ((event.stateMask & SWT.BUTTON1) != 0) {
                                        intervalMarker.setEndVal(plot.getXFromXPixcel(event.x));
                                } else {
-                                       // FIXME : tooltip
+                                       tooltip = plot.getTooltip();
+                                       if (null == tooltip) {
+                                               return;
+                                       }
+                                       double oldStartVal = tooltip.getStartVal();
+                                       double newStartVal = getTooltipStartX(plot,
+                                                       chart.getSeriesList(), event.x);
+
+                                       if (oldStartVal != newStartVal) {
+                                               tooltip.setStartVal(newStartVal);
+                                       }
                                }
                                break;
                        case SWT.MouseDown:
-                               intervalMarker.setInterval(plot.getXFromXPixcel(event.x), plot.getXFromXPixcel(event.x));
+                               tooltip = plot.getTooltip();
+                               if (null == tooltip) {
+                                       return;
+                               }
+                               tooltip.setTooltip(false);
+                               intervalMarker.setInterval(plot.getXFromXPixcel(event.x),
+                                               plot.getXFromXPixcel(event.x));
                                break;
                        case SWT.MouseUp:
+                               tooltip = plot.getTooltip();
+                               if (null == tooltip) {
+                                       return;
+                               }
+                               tooltip.setStartVal(getTooltipStartX(plot,
+                                               chart.getSeriesList(), event.x));
+                               tooltip.setTooltip(true);
                                intervalMarker.setEndVal(plot.getXFromXPixcel(event.x));
                                break;
+                       case SWT.MouseEnter:
+                               tooltip = plot.getTooltip();
+                               if (null == tooltip) {
+                                       return;
+                               }
+                               tooltip.setStartVal(getTooltipStartX(plot,
+                                               chart.getSeriesList(), event.x));
+                               tooltip.setTooltip(true);
+                               break;
+                       case SWT.MouseExit:
+                               tooltip = plot.getTooltip();
+                               if (null == tooltip) {
+                                       return;
+                               }
+                               tooltip.setTooltip(false);
+                               break;
                        default:
                                break;
                        }
@@ -255,17 +319,24 @@ public class TimelineItemManager {
                        XYPlot xyplot = itemChartComp.getChart().getXYPlot();
                        ValueAxis domainAxis = xyplot.getDomainAxis();
                        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());
 
-                       tempUpTime = domainAxis.java2DToValue(e.x, rect2D, xyplot.getDomainAxisEdge());
+                       tempUpTime = domainAxis.java2DToValue(e.x, rect2D,
+                                       xyplot.getDomainAxisEdge());
                        tempUpTime = Math.round(tempUpTime);
-                       int correctedX = (int) domainAxis.valueToJava2D(tempUpTime, rect2D, xyplot.getDomainAxisEdge());
-                       Double selectionEndTime = domainAxis.java2DToValue(correctedX, rect2D, xyplot.getDomainAxisEdge());
+                       int correctedX = (int) domainAxis.valueToJava2D(tempUpTime, rect2D,
+                                       xyplot.getDomainAxisEdge());
+                       Double selectionEndTime = domainAxis.java2DToValue(correctedX,
+                                       rect2D, xyplot.getDomainAxisEdge());
 
                        setSelectionMarkerEndVal(selectionEndTime);
                        sendSelectionTimes(e, correctedX);
 
-                       TimelineMaster.getInstance().highlightSelectedSnapshot(selectionMarker.getStartValue(), selectionMarker.getEndValue());
+                       TimelineMaster.getInstance().highlightSelectedSnapshot(
+                                       selectionMarker.getStartValue(),
+                                       selectionMarker.getEndValue());
                }
 
                @Override
@@ -283,14 +354,20 @@ public class TimelineItemManager {
                        XYPlot xyplot = itemChartComp.getChart().getXYPlot();
                        ValueAxis domainAxis = xyplot.getDomainAxis();
                        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 = domainAxis.java2DToValue(e.x, rect2D, xyplot.getDomainAxisEdge());
+                       tempDownTime = domainAxis.java2DToValue(e.x, rect2D,
+                                       xyplot.getDomainAxisEdge());
                        tempDownTime = Math.round(tempDownTime);
-                       int correctedX = (int) domainAxis.valueToJava2D(tempDownTime, rect2D, xyplot.getDomainAxisEdge());
-                       Double selectionStartTime = domainAxis.java2DToValue(correctedX - TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D,
+                       int correctedX = (int) domainAxis.valueToJava2D(tempDownTime,
+                                       rect2D, xyplot.getDomainAxisEdge());
+                       Double selectionStartTime = domainAxis.java2DToValue(correctedX
+                                       - TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D,
                                        xyplot.getDomainAxisEdge());
-                       Double selectionEndTime = domainAxis.java2DToValue(correctedX + TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D,
+                       Double selectionEndTime = domainAxis.java2DToValue(correctedX
+                                       + TempConstants.MIN_SELECTION_HALF_WIDTH_PX, rect2D,
                                        xyplot.getDomainAxisEdge());
 
                        selectionMarker.setStartValue(selectionStartTime);
@@ -319,8 +396,11 @@ public class TimelineItemManager {
 
                XYPlot xyplot = itemChartComp.getChart().getXYPlot();
                Rectangle2D rect2D = plotInfo.getDataArea();
-               rect2D.setRect(rect2D.getX(), canvas.getBounds().y, canvas.getBounds().width - rect2D.getY(), canvas.getBounds().height);
-               long selectedTime = Math.round(xyplot.getDomainAxis().java2DToValue(correctedX, rect2D, xyplot.getDomainAxisEdge()));
+               rect2D.setRect(rect2D.getX(), canvas.getBounds().y,
+                               canvas.getBounds().width - rect2D.getY(),
+                               canvas.getBounds().height);
+               long selectedTime = Math.round(xyplot.getDomainAxis().java2DToValue(
+                               correctedX, rect2D, xyplot.getDomainAxisEdge()));
 
                Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
                tooltip = new Shell(shell, SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
@@ -333,7 +413,8 @@ public class TimelineItemManager {
                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;
@@ -342,21 +423,25 @@ public class TimelineItemManager {
                List<java.awt.Color> seriesColorList;
                int seriesSize;
 
-               TimelineChart timelineChart = TimelineChartManager.getInstance().getTimelineChartInstance(chartType);
+               TimelineChart timelineChart = TimelineChartManager.getInstance()
+                               .getTimelineChartInstance(chartType);
                seriesList = timelineChart.getBaseSeriesList();
                seriesColorList = timelineChart.getSeriesColorList();
                seriesSize = seriesList.size();
                rowData = new RowData(10, 10);
 
-               makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, timelineChart);
+               makeTooltip(seriesSize, seriesColorList, rowData, seriesList,
+                               selectedTime, indexInfoFont, timelineChart);
 
                if (show) {
                        showTooltip(itemChartComp, correctedX, e.y);
                }
        }
-       
-       private void makeTooltip(int seriesSize, List<java.awt.Color> seriesColorList, RowData rowData, List<XYSeries> seriesList, long selectedTime,
-                       Font indexInfoFont, TimelineChart timelineChart) {
+
+       private void makeTooltip(int seriesSize,
+                       List<java.awt.Color> seriesColorList, RowData rowData,
+                       List<XYSeries> seriesList, long selectedTime, Font indexInfoFont,
+                       TimelineChart timelineChart) {
                for (int i = 0; i < seriesSize; i++) {
                        if (i == 0) {
                                indexInfoLabelList.clear();
@@ -366,7 +451,8 @@ public class TimelineItemManager {
                        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);
@@ -382,7 +468,9 @@ public class TimelineItemManager {
        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);
        }
 
@@ -418,7 +506,8 @@ public class TimelineItemManager {
        }
 
        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(Composite itemAreaComp) {
@@ -435,7 +524,8 @@ public class TimelineItemManager {
 
        public void updateActiveItem(double runTimeMs) {
                chartManager.updateChart();
-               SnapshotData.getInstance().querySnapshotInfo(runTimeMs * TimelineConstants.TIME_US_TO_MS);
+               SnapshotData.getInstance().querySnapshotInfo(
+                               runTimeMs * TimelineConstants.TIME_US_TO_MS);
        }
 
        public void clear() {
@@ -497,21 +587,24 @@ public class TimelineItemManager {
                dispose();
 
                for (int i = 0; i < selectedItemList.size(); i++) {
-                       ItemInfo info = createItemInfo(itemsAreaComp, TimelineUtils.getChartType(selectedItemList.get(i)));
+                       ItemInfo info = createItemInfo(itemsAreaComp,
+                                       TimelineUtils.getChartType(selectedItemList.get(i)));
                        realTimeItemList.add(info);
                }
        }
 
        private void initSelectionMarker() {
                selectionMarker = new IntervalMarker(-1, -1);
-               selectionMarker.setPaint(new java.awt.Color(ColorResources.SELECTION_RANGE.getRed(), ColorResources.SELECTION_RANGE.getGreen(),
+               selectionMarker.setPaint(new java.awt.Color(
+                               ColorResources.SELECTION_RANGE.getRed(),
+                               ColorResources.SELECTION_RANGE.getGreen(),
                                ColorResources.SELECTION_RANGE.getBlue(), 25));
                selectionMarker.setOutlineStroke(null);
 
                TimelineMaster.getInstance().setSelectionMarker(selectionMarker);
        }
-       
-       private void initIntervalMarker(){
+
+       private void initIntervalMarker() {
                intervalMarker = new DACustomChartPlotIntervalMarker(-1, -1);
                intervalMarker.setBackgroundColor(ColorResources.SELECTION_RANGE);
                intervalMarker.setAlpha((int) (255 * 0.25));
@@ -520,12 +613,15 @@ public class TimelineItemManager {
        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;
                }
@@ -544,14 +640,18 @@ public class TimelineItemManager {
                if (tempDownTime == tempUpTime) {
                        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));
                        }
 
                        disposeTooltip();
                        createTooltip(e, correctedX);
                } else {
-                       long startTime = (long) ((tempDownTime < tempUpTime ? tempDownTime : tempUpTime) * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
-                       long endTime = (long) ((tempDownTime < tempUpTime ? tempUpTime : tempDownTime) * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
+                       long startTime = (long) ((tempDownTime < tempUpTime ? tempDownTime
+                                       : tempUpTime) * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
+                       long endTime = (long) ((tempDownTime < tempUpTime ? tempUpTime
+                                       : tempDownTime) * TimelineConstants.TIME_SEC_TO_MS * TimelineConstants.TIME_SEC_TO_MS);
                        if (startTime < coolBarTime) {
                                if (endTime > coolBarTime) {
                                        endTime = coolBarTime;
@@ -559,19 +659,28 @@ public class TimelineItemManager {
                                if (startTime < 0) {
                                        startTime = 0;
                                }
-                               AnalyzerManager.getCurrentPage().updatePage(new DASelectionData(TimelineComposite.ID, startTime, endTime, null, null));
+                               AnalyzerManager.getCurrentPage().updatePage(
+                                               new DASelectionData(TimelineComposite.ID, startTime,
+                                                               endTime, null, null));
                        }
                }
        }
 
        private Composite createItemArea(Composite itemAreaComp) {
-               realTimeItemList.add(createItemInfo(itemAreaComp, TimelineConstants.CHART_TYPE_CPU));
-               realTimeItemList.add(createItemInfo(itemAreaComp, TimelineConstants.CHART_TYPE_CPU_CORE));
-               realTimeItemList.add(createItemInfo(itemAreaComp, TimelineConstants.CHART_TYPE_CPU_FREQUENCY));
-               realTimeItemList.add(createItemInfo(itemAreaComp, TimelineConstants.CHART_TYPE_HEAP));
-               realTimeItemList.add(createItemInfo(itemAreaComp, TimelineConstants.CHART_TYPE_PROCESS_MEMORY));
-               realTimeItemList.add(createItemInfo(itemAreaComp, TimelineConstants.CHART_TYPE_SYSTEM_MEMORY));
-               realTimeItemList.add(createItemInfo(itemAreaComp, TimelineConstants.CHART_TYPE_FILE));
+               realTimeItemList.add(createItemInfo(itemAreaComp,
+                               TimelineConstants.CHART_TYPE_CPU));
+               realTimeItemList.add(createItemInfo(itemAreaComp,
+                               TimelineConstants.CHART_TYPE_CPU_CORE));
+               realTimeItemList.add(createItemInfo(itemAreaComp,
+                               TimelineConstants.CHART_TYPE_CPU_FREQUENCY));
+               realTimeItemList.add(createItemInfo(itemAreaComp,
+                               TimelineConstants.CHART_TYPE_HEAP));
+               realTimeItemList.add(createItemInfo(itemAreaComp,
+                               TimelineConstants.CHART_TYPE_PROCESS_MEMORY));
+               realTimeItemList.add(createItemInfo(itemAreaComp,
+                               TimelineConstants.CHART_TYPE_SYSTEM_MEMORY));
+               realTimeItemList.add(createItemInfo(itemAreaComp,
+                               TimelineConstants.CHART_TYPE_FILE));
 
                TimelineMaster.getInstance().redrawTimeTickCanvas();
 
@@ -580,7 +689,8 @@ public class TimelineItemManager {
 
        private ItemInfo createItemInfo(Composite parent, int chartType) {
                ItemInfo info;
-               if (chartType == TimelineConstants.CHART_TYPE_CPU && bCustomChart == true) {
+               if (chartType == TimelineConstants.CHART_TYPE_CPU
+                               && bCustomChart == true) {
                        info = createDAItem(parent, chartType);
                } else {
                        info = createItem(parent, chartType);
@@ -600,7 +710,8 @@ public class TimelineItemManager {
                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);
@@ -620,7 +731,8 @@ public class TimelineItemManager {
                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);
@@ -637,13 +749,16 @@ public class TimelineItemManager {
                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.getChartName(chartType);
 
                if (null == infoComp || infoComp.isDisposed()) {
@@ -655,7 +770,9 @@ public class TimelineItemManager {
                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 {
@@ -686,12 +803,14 @@ public class TimelineItemManager {
                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 {
@@ -705,15 +824,18 @@ public class TimelineItemManager {
 
                /* 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 {
@@ -735,7 +857,8 @@ public class TimelineItemManager {
                if (selectionMarker == null) {
                        initSelectionMarker();
                }
-               itemChartComposite.getChart().getXYPlot().addDomainMarker(selectionMarker, Layer.FOREGROUND);
+               itemChartComposite.getChart().getXYPlot()
+                               .addDomainMarker(selectionMarker, Layer.FOREGROUND);
                iteminfo.infoComp = itemInfoComp;
                iteminfo.chartComp = itemChartComposite;
 
@@ -762,7 +885,8 @@ public class TimelineItemManager {
                iteminfo.itemComp.setBackground(ColorResources.GRAY_170);
 
                /* Item info composite */
-               final ItemInfoComposite itemInfoComp = createItemInfoComp(iteminfo.itemComp, chartType);
+               final ItemInfoComposite itemInfoComp = createItemInfoComp(
+                               iteminfo.itemComp, chartType);
 
                GridData gDataInfo = new GridData();
 
@@ -774,13 +898,15 @@ public class TimelineItemManager {
 
                itemInfoComp.addListener(SWT.Resize, resizeListenerBG);
 
-               Composite itemChartComposite = new Composite(iteminfo.itemComp, SWT.NONE);
+               Composite itemChartComposite = new Composite(iteminfo.itemComp,
+                               SWT.NONE);
                FillLayout layout = new FillLayout();
                layout.marginHeight = 1;
                layout.marginWidth = 1;
                itemChartComposite.setLayout(layout);
                itemChartComposite.setBackground(ColorResources.WINDOW_BG_COLOR);
-               DACustomChart chart = chartManager.createDATimelineChart(itemChartComposite, chartType);
+               DACustomChart chart = chartManager.createDATimelineChart(
+                               itemChartComposite, chartType);
 
                itemChartComposite.setData(chartType);
 
@@ -795,15 +921,17 @@ public class TimelineItemManager {
                chart.addListener(SWT.MouseMove, chartMouseListener);
                chart.addListener(SWT.MouseDown, chartMouseListener);
                chart.addListener(SWT.MouseUp, chartMouseListener);
+               chart.addListener(SWT.MouseEnter, chartMouseListener);
+               chart.addListener(SWT.MouseExit, chartMouseListener);
                // itemChartComposite.addMouseMoveListener(itemMouseMouveListener);
 
                // itemChartComposite.getChart().getXYPlot().addDomainMarker(selectionMarker,
                // Layer.FOREGROUND);
-               
-               if(null == intervalMarker){
+
+               if (null == intervalMarker) {
                        initIntervalMarker();
                }
-               
+
                chart.getPlot().setIntervalMarker(intervalMarker);
 
                iteminfo.infoComp = itemInfoComp;
@@ -821,9 +949,12 @@ public class TimelineItemManager {
                }
 
                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.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.getChart().getXYPlot()
+                                               .removeDomainMarker(selectionMarker);
                        }
                }
                ItemList.clear();
@@ -837,8 +968,10 @@ public class TimelineItemManager {
                int width = itemsAreaComp.getBounds().width;
 
                for (int i = 0; i < realTimeItemList.size(); i++) {
-                       TimelineItemSetting itemSetting = TimelineItemSettingProvider.getItemSetting(realTimeItemList.get(i).itemType);
-                       setItemSize(realTimeItemList.get(i), width, itemSetting.getSizeMode());
+                       TimelineItemSetting itemSetting = TimelineItemSettingProvider
+                                       .getItemSetting(realTimeItemList.get(i).itemType);
+                       setItemSize(realTimeItemList.get(i), width,
+                                       itemSetting.getSizeMode());
                }
 
                itemsAreaComp.layout();
@@ -846,7 +979,8 @@ public class TimelineItemManager {
 
        private void setItemInfoGradientBG(Composite composite) {
                Rectangle rect = composite.getClientArea();
-               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
@@ -866,7 +1000,8 @@ public class TimelineItemManager {
                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
@@ -876,7 +1011,8 @@ public class TimelineItemManager {
                } 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
@@ -897,7 +1033,8 @@ public class TimelineItemManager {
                }
 
                if (isSelected) {
-                       chartComp.getChart().setBackgroundPaint(ColorResources.ITEM_BLUE_AWT);
+                       chartComp.getChart().setBackgroundPaint(
+                                       ColorResources.ITEM_BLUE_AWT);
                } else {
                        chartComp.getChart().setBackgroundPaint(ColorResources.ITEM_BG_AWT);
                }
@@ -956,33 +1093,39 @@ public class TimelineItemManager {
                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.itemName));
+                       if (null == infoComp.getIconLabel()
+                                       || infoComp.getIconLabel().isDisposed()) {
+                               addIconInfoLabel(infoComp,
+                                               TimelineUtils.getChartType(infoComp.itemName));
 
                                if (null != infoComp.infoTextLabel) {
                                        infoComp.infoTextLabel.dispose();
                                }
-                               addTextInfoLabel(infoComp, TimelineUtils.getChartType(infoComp.itemName), false);
+                               addTextInfoLabel(infoComp,
+                                               TimelineUtils.getChartType(infoComp.itemName), false);
                        }
                } else {
                        if (null != infoComp.infoIconLabel) {
                                infoComp.infoIconLabel.dispose();
                                infoComp.infoTextLabel.dispose();
 
-                               boolean isSucced = addTextInfoLabel(infoComp, TimelineUtils.getChartType(infoComp.itemName), true);
+                               boolean isSucced = addTextInfoLabel(infoComp,
+                                               TimelineUtils.getChartType(infoComp.itemName), true);
                                if (isSucced) {
                                        infoComp.layout();
                                }
index 6a5fb6b..5d900d8 100644 (file)
@@ -41,8 +41,8 @@ public class DACPUChart extends DATimelineChart {
        public DACustomChart createDAChart(Composite parent) {
                chart = new DACustomChart(parent, TimelineChartLabels.CPU_CHART_TITLE);
 
-               chart.addSeries(appLoadSeries);
                chart.addSeries(totalLoadSeries);
+               chart.addSeries(appLoadSeries);
 
                setChartStyle();
                chart.getPlot().setAutoHeightRange(false);
index 20cd517..d601853 100644 (file)
@@ -5,6 +5,7 @@ import org.jfree.chart.JFreeChart;
 import org.tizen.dynamicanalyzer.ImageResources;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartPlot;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartPlotTooltip;
 
 public abstract class DATimelineChart extends TimelineChart {
 
@@ -37,5 +38,6 @@ public abstract class DATimelineChart extends TimelineChart {
                }
                plot.setBackgroundImage(ImageResources.BG_GRADIENT);
                plot.setAutoHeightRange(true);
+               plot.setTooltip(new DACustomChartPlotTooltip(-1));
        }
 }