From: sanghyunnim.lee Date: Wed, 4 Jul 2012 07:23:23 +0000 (+0900) Subject: [Title] Fix tooltip bug X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03b72c78aa85a46b98ece86a6c365395d1a03e5e;p=sdk%2Ftools%2Fdynamic-analyzer.git [Title] Fix tooltip bug [Type] Buf fix [Module] [Priority] [CQ#] [Redmine#]5682 [Problem] [Cause] [Solution] [TestCase] --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineItemManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineItemManager.java index 6b23f8d..b508975 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineItemManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/timeline/TimelineItemManager.java @@ -9,6 +9,7 @@ import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.events.MouseMoveListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.GC; @@ -285,6 +286,13 @@ public class TimelineItemManager { public void mouseDoubleClick(MouseEvent e) { } }; + + private MouseMoveListener itemMouseMouveListener = new MouseMoveListener() { + @Override + public void mouseMove(MouseEvent e) { + disposeTooltip(); + } + }; private void createTooltip(MouseEvent e, int correctedX) { Canvas canvas = (Canvas) e.getSource(); @@ -395,17 +403,6 @@ public class TimelineItemManager { } break; - // case TimelineConstants.CHART_TYPE_ENERGY: - // seriesList = EnergyChart.getSeriesList(); - // seriesUnitList = EnergyChart.getSeriesUnitList(); - // seriesColorList = EnergyChart.getSeriesColor(); - // seriesSize = seriesList.size(); - // rowData = new RowData(10, 10); - // - // makeTooltip(seriesSize, seriesColorList, rowData, seriesList, - // selectedTime, seriesUnitList, indexInfoFont, chartID); - // - // break; case TimelineConstants.CHART_TYPE_FILE: seriesList = FileChart.getSeriesList(); seriesColorList = FileChart.getSeriesColor(); @@ -415,74 +412,7 @@ public class TimelineItemManager { makeTooltip(seriesSize, seriesColorList, rowData, seriesList, selectedTime, indexInfoFont, chartID); break; - // case TimelineConstants.CHART_TYPE_DEVICE: - // indexInfoComposite = new Composite(tooltip, SWT.NONE); - // indexInfoComposite.setLayout(new RowLayout(SWT.VERTICAL)); - // - // Composite enableInfoComposite = new Composite(indexInfoComposite, - // SWT.NONE); - // enableInfoComposite.setLayout(new RowLayout(SWT.HORIZONTAL)); - // Canvas indexCanvasEnabled = new Canvas(enableInfoComposite, - // SWT.BORDER); - // indexCanvasEnabled.setBackground(getColorFromAwtColor(DeviceChart.COLOR_ENABLED)); - // rowData = new RowData(10, 10); - // indexCanvasEnabled.setLayoutData(rowData); - // Label indexLabelEnabled = new Label(enableInfoComposite, SWT.NONE); - // indexLabelEnabled.setText("Device Enabled"); - // indexLabelEnabled.setFont(indexInfoFont); - // - // Composite connectInfoComposite = new Composite(indexInfoComposite, - // SWT.NONE); - // connectInfoComposite.setLayout(new RowLayout(SWT.HORIZONTAL)); - // Canvas indexCanvasConnected = new Canvas(connectInfoComposite, - // SWT.BORDER); - // indexCanvasConnected.setBackground(getColorFromAwtColor(DeviceChart.COLOR_CONNECTED)); - // rowData = new RowData(10, 10); - // indexCanvasConnected.setLayoutData(rowData); - // Label indexLabelConnected = new Label(connectInfoComposite, - // SWT.NONE); - // indexLabelConnected.setText("WIFI Connected"); - // indexLabelConnected.setFont(indexInfoFont); - // - // Composite voiceInfoComposite = new Composite(indexInfoComposite, - // SWT.NONE); - // voiceInfoComposite.setLayout(new RowLayout(SWT.HORIZONTAL)); - // Canvas indexCanvasVoiceCall = new Canvas(voiceInfoComposite, - // SWT.BORDER); - // indexCanvasVoiceCall.setBackground(getColorFromAwtColor(DeviceChart.COLOR_CALL_VOICE)); - // rowData = new RowData(10, 10); - // indexCanvasVoiceCall.setLayoutData(rowData); - // Label indexLabelVoiceCall = new Label(voiceInfoComposite, SWT.NONE); - // indexLabelVoiceCall.setText("Voice Call"); - // indexLabelVoiceCall.setFont(indexInfoFont); - // - // Composite videoInfoComposite = new Composite(indexInfoComposite, - // SWT.NONE); - // videoInfoComposite.setLayout(new RowLayout(SWT.HORIZONTAL)); - // Canvas indexCanvasVideoCall = new Canvas(videoInfoComposite, - // SWT.BORDER); - // indexCanvasVideoCall.setBackground(getColorFromAwtColor(DeviceChart.COLOR_CALL_VIDEO)); - // rowData = new RowData(10, 10); - // indexCanvasVideoCall.setLayoutData(rowData); - // Label indexLabelVideoCall = new Label(videoInfoComposite, SWT.NONE); - // indexLabelVideoCall.setText("Video Call"); - // indexLabelVideoCall.setFont(indexInfoFont); - // - // break; - } - - // 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_LABEL + - * lifecycleDetail); lifecycleInfoColorLabel.setFont(indexInfoFont); } - */ + } if (show) { showTooltip(itemChartComp, correctedX, e.y); @@ -1047,6 +977,7 @@ public class TimelineItemManager { /* Add Listener */ itemChartComposite.addSWTListener(itemMouseListener); + itemChartComposite.addSWTListener(itemMouseMouveListener); if (selectionMarker == null) { initSelectionMarker();