[Title]thread page & chart selction update
authoryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Mon, 26 Nov 2012 14:26:23 +0000 (23:26 +0900)
committeryeongtaik.byeon <yeongtaik.byeon@samsung.com>
Mon, 26 Nov 2012 14:26:23 +0000 (23:26 +0900)
[Desc.]chart range selection & design update
[Issue]redmine #5322 #7167

19 files changed:
org.tizen.dynamicanalyzer.widgets/Images/timeline_right_bg_selected.png
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DACustomChartBoard.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DACustomChartBoardItem.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DACustomChartBoardItemCell.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ColorResources.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/timeline/DACustomTimelineRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/ImageResources.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadChartView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPageDataManager.java
org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_disable.png [deleted file]
org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_hover.png [deleted file]
org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_normal.png [deleted file]
org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_push.png [deleted file]
org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_push.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_hover.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_normal.png [new file with mode: 0644]
org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_push.png [new file with mode: 0644]

index 979f7d1..01ea3cf 100644 (file)
Binary files a/org.tizen.dynamicanalyzer.widgets/Images/timeline_right_bg_selected.png and b/org.tizen.dynamicanalyzer.widgets/Images/timeline_right_bg_selected.png differ
index f17e24b..7c49389 100644 (file)
@@ -50,6 +50,7 @@ import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener
 import org.tizen.dynamicanalyzer.widgets.button.toggle.DACustomToggleButton;
 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.helper.ColorResources;
 import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
 import org.tizen.dynamicanalyzer.widgets.scale.DAScale;
@@ -72,6 +73,8 @@ public class DACustomChartBoard extends Composite {
        private DACustomChartBoardItem selectItem;
        private Image oldImage;
        private List<DACustomChartBoardSelectionListener> selectionListenrers;
+       private DACustomChartPlotIntervalMarker intervalMarker;
+       private boolean bSelection = true;
 
        // private final static int DEFAULT_CHART_ZOOMOUT_HEIGHT = 50;
        private final static int DEFAULT_CHART_ZOOMIN_HEIGHT = 80;
@@ -92,19 +95,6 @@ public class DACustomChartBoard extends Composite {
                titleComp = new Composite(this, SWT.NONE);
                titleComp.setLayout(new FillLayout());
 
-               // titleButton = new DACustomButton(this, SWT.NONE, title);
-               // titleButton.addClickListener(new DACustomButtonClickEventListener() {
-               // // FIXME
-               // // test
-               // // code
-               //
-               // @Override
-               // public void handleClickEvent(DACustomButton button) {
-               // DACustomChartBoardItem item = new DACustomChartBoardItem(
-               // (DACustomChartBoard) button.getParent(), null);
-               // }
-               // });
-
                chartZoomButton = new DACustomToggleButton(this, SWT.NONE);
                chartZoomButton
                                .addClickListener(new DACustomButtonClickEventListener() { // FIXME
@@ -159,20 +149,31 @@ public class DACustomChartBoard extends Composite {
 
                        @Override
                        public void controlResized(ControlEvent e) {
+                               int clientWidth = chartTreeScrollComp.getClientArea().width;
+                               Rectangle rtScroll = chartTreeScrollComp.getBounds();
+
                                if (null != chartTreeComp) {
-                                       int width = chartTreeScrollComp.getClientArea().width;
-                                       // chartTreeComp.setSize(((ScrolledComposite)(e.widget)).getClientArea().width,
-                                       // chartTreeComp.getBounds().height);
-                                       chartTreeComp.setSize(width,
+                                       chartTreeComp.setSize(rtScroll.width,
                                                        chartTreeComp.getBounds().height);
                                        int itemSize = items.size();
 
                                        for (int i = 0; i < itemSize; i++) {
                                                DACustomChartBoardItem item = items.get(i);
                                                int height = item.getSize().y;
-                                               items.get(i).setSize(width, height);
+                                               items.get(i).setSize(clientWidth, height);
                                        }
                                }
+                               if (null != timeline) {
+                                       timeline.setSize(clientWidth
+                                                       - DEFAULT_CHARTBOARD_SCALE_WIDTH,
+                                                       timeline.getBounds().height);
+                               }
+                               if (null != scrollComp) {
+                                       scrollComp.setSize(clientWidth
+                                                       - DEFAULT_CHARTBOARD_SCALE_WIDTH,
+                                                       scrollComp.getBounds().height);
+                               }
+                               setChartAxis();
                        }
 
                        @Override
@@ -185,9 +186,11 @@ public class DACustomChartBoard extends Composite {
                        public void paintControl(PaintEvent e) {
                                // TODO Auto-generated method stub
                                Rectangle rt = getClientArea();
+
                                e.gc.setBackground(ColorResources.WHITE);
                                e.gc.setForeground(ColorResources.CHART_BOARD_ITEM_LINE);
                                e.gc.fillRectangle(rt);
+
                                int nItemSize = rt.height / chartHeight + 1;
                                for (int i = 0; i < nItemSize; i++) {
                                        e.gc.drawRectangle(rt.x, i * chartHeight,
@@ -227,7 +230,7 @@ public class DACustomChartBoard extends Composite {
                data = new FormData();
                data.left = new FormAttachment(chartZoomButton, 0);
                data.top = new FormAttachment(0, 0);
-               data.right = new FormAttachment(100, 0);
+               // data.right = new FormAttachment(100, 0);
                data.height = DEFAULT_CHARTBOARD_HEADER_HEIGHT;
                timeline.setLayoutData(data);
 
@@ -248,7 +251,7 @@ public class DACustomChartBoard extends Composite {
 
                data = new FormData();
                data.left = new FormAttachment(scale, 0);
-               data.right = new FormAttachment(100, 0);
+               // data.right = new FormAttachment(100, 0);
                data.top = new FormAttachment(chartTreeScrollComp, 0);
                data.bottom = new FormAttachment(100, 0);
                data.height = DEFAULT_CHARTBOARD_FOOTER_HEIGHT;
@@ -341,9 +344,10 @@ public class DACustomChartBoard extends Composite {
 
        protected void registeItem(DACustomChartBoardItem item) {
                items.add(item);
-               Rectangle rt = chartTreeComp.getBounds();
-               chartTreeComp.setBounds(rt.x, rt.y, rt.width, rt.height + chartHeight);
-               item.setBounds(rt.x, rt.height, rt.width, chartHeight);
+               Rectangle rt = chartTreeComp.getClientArea();
+               chartTreeComp.setSize(rt.width, rt.height + chartHeight);
+               int width = chartTreeScrollComp.getClientArea().width;
+               item.setBounds(rt.x, rt.height, width, chartHeight);
        }
 
        private int findItemIndex(DACustomChartBoardItem item) {
@@ -398,6 +402,7 @@ public class DACustomChartBoard extends Composite {
                if (null != selectItem) {
                        selectItem = null;
                }
+               intervalMarker = null;
        }
 
        public double getVisibleStartTime() {
@@ -422,17 +427,22 @@ public class DACustomChartBoard extends Composite {
        }
 
        protected void NotifyCallbackSelection(DACustomChartBoardItem item) {
+               if (false == isSelection()) {
+                       return;
+               }
                if (selectItem == item) {
                        return;
                } else {
                        if (null != oldImage && null != selectItem) {
                                setChartBackgroundImage(selectItem.getChart(), oldImage);
+                               selectItem.selectItem(false);
                        }
 
                        selectItem = item;
                        oldImage = selectItem.getChart().getPlot().getBackgroundImage();
                        setChartBackgroundImage(selectItem.getChart(),
                                        ImageResources.CHART_BG_SELECT);
+                       selectItem.selectItem(true);
                        if (null != selectionListenrers) {
                                for (int i = 0; i < selectionListenrers.size(); i++) {
                                        selectionListenrers.get(i).handleSelectionEvent(selectItem);
@@ -452,4 +462,25 @@ public class DACustomChartBoard extends Composite {
        public Composite getTitleComp() {
                return titleComp;
        }
+
+       private void initIntervalMarker() {
+               intervalMarker = new DACustomChartPlotIntervalMarker(-1, -1);
+               intervalMarker.setBackgroundColor(ColorResources.CHART_SELECTION_RANGE);
+               intervalMarker.setAlpha((int) (255 * 0.25));
+       }
+
+       public DACustomChartPlotIntervalMarker getIntervalMarker() {
+               if (null == intervalMarker) {
+                       initIntervalMarker();
+               }
+               return intervalMarker;
+       }
+
+       public boolean isSelection() {
+               return bSelection;
+       }
+
+       public void setSelection(boolean bSelection) {
+               this.bSelection = bSelection;
+       }
 }
index 4f13268..924ca40 100644 (file)
@@ -35,6 +35,7 @@ import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.widgets.Composite;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
+import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartPlot;
 
 public class DACustomChartBoardItem extends Composite {
        private DACustomChartBoard parentBoard = null;
@@ -45,7 +46,7 @@ public class DACustomChartBoardItem extends Composite {
        private String itemName;
 
        private boolean isFold = true;
-//     private boolean isExpand = false;
+       // private boolean isExpand = false;
        public final static int DEFAULT_ITEM_HEIGHT = 80; // FIXME get from
        public final static int DEFAULT_NAME_CELL_WIDTH = 99;
        private int depth = 0;
@@ -227,12 +228,24 @@ public class DACustomChartBoardItem extends Composite {
        }
 
        public DACustomChart getChart() {
+               if (null == itemCell) {
+                       return null;
+               }
                return itemCell.getChartCell();
        }
 
        protected void setChartAxis(double startX, double endX) {
                DACustomChart chart = getChart();
-               chart.getPlot().setAxisRangeX(startX, endX);
+               if (null == chart) {
+                       return;
+               }
+
+               DACustomChartPlot plot = chart.getPlot();
+
+               if (null == plot) {
+                       return;
+               }
+               plot.setAxisRangeX(startX, endX);
                chart.redraw();
                if (null == children) {
                        return;
@@ -242,4 +255,8 @@ public class DACustomChartBoardItem extends Composite {
                        children.get(i).setChartAxis(startX, endX);
                }
        }
+
+       protected void selectItem(boolean select) {
+               itemCell.setSelectCell(select);
+       }
 }
index ad6d7d2..c83595a 100644 (file)
@@ -53,6 +53,7 @@ class DACustomChartBoardItemCell extends Composite {
        private final static int DEFAULT_TOGGLE_BUTTON_SIZE = 10;
        private final static int DEFAULT_TOGGLE_BUTTON_MARGIN = 5;
        private int nameCellWidth = DACustomChartBoardItem.DEFAULT_NAME_CELL_WIDTH;
+       private boolean selectCell = false;
 
        public DACustomChartBoardItemCell(final DACustomChartBoardItem parent) {
                super(parent, SWT.NONE);
@@ -65,12 +66,12 @@ class DACustomChartBoardItemCell extends Composite {
                                Rectangle rt = getBounds();
 
                                if (null != nameCell) {
-                                       nameCell.setBounds(rt.x, rt.y+1, nameCellWidth,
-                                                       rt.height-1);
+                                       nameCell.setBounds(rt.x, rt.y + 1, nameCellWidth,
+                                                       rt.height - 1);
                                }
                                if (null != chartCell) {
-                                       chartCell.setBounds(rt.x + nameCellWidth, rt.y+1,
-                                                       rt.width - nameCellWidth, rt.height-1);
+                                       chartCell.setBounds(rt.x + nameCellWidth, rt.y + 1,
+                                                       rt.width - nameCellWidth, rt.height - 1);
                                }
                        }
 
@@ -87,8 +88,13 @@ class DACustomChartBoardItemCell extends Composite {
                        public void paintControl(PaintEvent e) {
                                Rectangle rect = ((Canvas) (e.widget)).getClientArea();
                                if (parent.getDepth() == 0) {
-                                       e.gc.setForeground(ColorResources.CHART_NAME_BACK_START); // FIXME
-                                       e.gc.setBackground(ColorResources.CHART_NAME_BACK_END); // FIXME
+                                       if (false == isSelectCell()) {
+                                               e.gc.setForeground(ColorResources.CHART_NAME_BACK_START); // FIXME
+                                               e.gc.setBackground(ColorResources.CHART_NAME_BACK_END); // FIXME
+                                       } else {
+                                               e.gc.setForeground(ColorResources.CHART_NAME_SELECT_BACK_START); // FIXME
+                                               e.gc.setBackground(ColorResources.CHART_NAME_SELECT_BACK_END); // FIXME
+                                       }
                                } else {
                                        e.gc.setForeground(ColorResources.CHART_NAME_CHILD_BACK); // FIXME
                                        e.gc.setBackground(ColorResources.CHART_NAME_CHILD_BACK);
@@ -153,7 +159,8 @@ class DACustomChartBoardItemCell extends Composite {
                }
                childExpandButton = new DACustomToggleButton(nameCell,
                                ImageResources.TREE_FOLD, ImageResources.TREE_FOLD,
-                               ImageResources.TREE_FOLD, null, ImageResources.TREE_OPEN, ImageResources.TREE_OPEN);
+                               ImageResources.TREE_FOLD, null, ImageResources.TREE_OPEN,
+                               ImageResources.TREE_OPEN);
                childExpandButton
                                .setBackground(ColorResources.CHART_BOARD_ITEM_NAME_FOLD_BG);
                Rectangle rt = nameCell.getClientArea();
@@ -170,15 +177,13 @@ class DACustomChartBoardItemCell extends Composite {
                                                        childExpandButton.setImages(
                                                                        ImageResources.TREE_FOLD,
                                                                        ImageResources.TREE_OPEN,
-                                                                       ImageResources.TREE_OPEN,
-                                                                       null);
+                                                                       ImageResources.TREE_OPEN, null);
                                                        parent.callbackUnFold();
                                                } else {
                                                        childExpandButton.setImages(
                                                                        ImageResources.TREE_FOLD,
                                                                        ImageResources.TREE_FOLD,
-                                                                       ImageResources.TREE_FOLD,
-                                                                       null);
+                                                                       ImageResources.TREE_FOLD, null);
                                                        parent.callbackFold();
                                                }
                                        }
@@ -197,4 +202,13 @@ class DACustomChartBoardItemCell extends Composite {
                p = gc.textExtent(name, SWT.DRAW_DELIMITER);
                gc.drawText(name, pixcelX - p.x / 2, pixcelY - p.y / 2, true);
        }
+
+       public boolean isSelectCell() {
+               return selectCell;
+       }
+
+       public void setSelectCell(boolean selectCell) {
+               this.selectCell = selectCell;
+               nameCell.redraw();
+       }
 }
index 55bb649..da3e380 100644 (file)
@@ -38,37 +38,60 @@ public class ColorResources {
        public static final Color BLUE = getColor("blue", new RGB(0, 0, 255)); //$NON-NLS-1$\r
        public static final Color RED = getColor("red", new RGB(255, 0, 0)); //$NON-NLS-1$\r
        public static final Color PURPLE = getColor("PUPLE", new RGB(226, 101, 225)); //$NON-NLS-1$\r
-       \r
+\r
        // scale widget\r
-       public static Color SCALE_OUTLINE_COLOR = getColor("scale_outline_color", new RGB(150, 150, 150)); //$NON-NLS-1$\r
-       public static Color SCALE_BG_COLOR_START = getColor("scale_bg_color_start", new RGB(253,253,253)); //$NON-NLS-1$\r
-       public static Color SCALE_BG_COLOR_END = getColor("scale_bg_color_end", new RGB(186,186,186)); //$NON-NLS-1$\r
-       public static Color SCALE_AREA_COLOR = getColor("scale_area_color", new RGB(103, 103, 103)); //$NON-NLS-1$\r
-       public static Color SCALE_AREA_OUTLINE_COLOR = getColor("scale_area_outline_color", new RGB(250, 250, 250)); //$NON-NLS-1$\r
+       public static Color SCALE_OUTLINE_COLOR = getColor(\r
+                       "scale_outline_color", new RGB(150, 150, 150)); //$NON-NLS-1$\r
+       public static Color SCALE_BG_COLOR_START = getColor(\r
+                       "scale_bg_color_start", new RGB(253, 253, 253)); //$NON-NLS-1$\r
+       public static Color SCALE_BG_COLOR_END = getColor(\r
+                       "scale_bg_color_end", new RGB(186, 186, 186)); //$NON-NLS-1$\r
+       public static Color SCALE_AREA_COLOR = getColor(\r
+                       "scale_area_color", new RGB(103, 103, 103)); //$NON-NLS-1$\r
+       public static Color SCALE_AREA_OUTLINE_COLOR = getColor(\r
+                       "scale_area_outline_color", new RGB(250, 250, 250)); //$NON-NLS-1$\r
 \r
-       //timeline\r
-       public static Color TIMELINE_NUMBER_COLOR = getColor("timeline_number", new RGB(0, 45, 96)); //$NON-NLS-1$\r
-       public static Color TIMELINE_TICK_COLOR = getColor("timeline_tick", new RGB(159, 159, 159)); //$NON-NLS-1$\r
-       public static Color TIMELINE_BG_COLOR = getColor("timeline_bg", new RGB(247, 247, 247)); //$NON-NLS-1$\r
+       // timeline\r
+       public static Color TIMELINE_NUMBER_COLOR = getColor(\r
+                       "timeline_number", new RGB(0, 45, 96)); //$NON-NLS-1$\r
+       public static Color TIMELINE_TICK_COLOR = getColor(\r
+                       "timeline_tick", new RGB(159, 159, 159)); //$NON-NLS-1$\r
+       public static Color TIMELINE_BG_COLOR = getColor(\r
+                       "timeline_bg", new RGB(247, 247, 247)); //$NON-NLS-1$\r
+\r
+       // chart\r
+       public static Color CHART_NAME_BACK_START = getColor(\r
+                       "chart_name_back_start", new RGB(215, 215, 215)); //$NON-NLS-1$\r
+       public static Color CHART_NAME_BACK_END = getColor(\r
+                       "chart_name_back_end", new RGB(157, 166, 168)); //$NON-NLS-1$\r
+       public static Color CHART_NAME_SELECT_BACK_START = getColor(\r
+                       "chart_name_back_select_start", new RGB(180, 242, 254)); //$NON-NLS-1$\r
+       public static Color CHART_NAME_SELECT_BACK_END = getColor(\r
+                       "chart_name_back_select_end", new RGB(56, 178, 208)); //$NON-NLS-1$\r
+       public static Color CHART_NAME_CHILD_BACK = getColor(\r
+                       "chart_name_child_back", new RGB(103, 103, 103)); //$NON-NLS-1$\r
+\r
+       public static Color UI_EVENT_CHART_SEPERATE_LINE = getColor(\r
+                       "UI_event_chart_seperate_line", new RGB(189, 207, 213)); //$NON-NLS-1$\r
+       public static Color UI_EVENT_CHART_TEXT = getColor(\r
+                       "UI_event _chat_text", new RGB(83, 83, 83)); //$NON-NLS-1$\r
+\r
+       public static Color SCREENSHOT_CHART_SELECTED_LINE = getColor(\r
+                       "screenshot_chart_selected_line", new RGB(59, 188, 232)); //$NON-NLS-1$\r
+       public static Color SCREENSHOT_CHART_BORDER_LINE = getColor(\r
+                       "screenshot_chart_border_line", new RGB(117, 117, 117)); //$NON-NLS-1$\r
+\r
+       public static Color CHART_BOARD_BACK = getColor(\r
+                       "chart_board_back", new RGB(230, 230, 230)); //$NON-NLS-1$\r
+       public static Color CHART_BOARD_ITEM_LINE = getColor(\r
+                       "chart_board_item_line", new RGB(171, 171, 171)); //$NON-NLS-1$\r
 \r
-       //chart\r
-       public static Color CHART_NAME_BACK_START = getColor("chart_name_back_start", new RGB(215, 215, 215)); //$NON-NLS-1$\r
-       public static Color CHART_NAME_BACK_END = getColor("chart_name_back_end", new RGB(157, 166, 168)); //$NON-NLS-1$\r
-       public static Color CHART_NAME_CHILD_BACK = getColor("chart_name_child_back", new RGB(103, 103, 103)); //$NON-NLS-1$\r
-       \r
-       public static Color UI_EVENT_CHART_SEPERATE_LINE = getColor("UI_event_chart_seperate_line", new RGB(189, 207, 213)); //$NON-NLS-1$\r
-       public static Color UI_EVENT_CHART_TEXT = getColor("UI_event _chat_text", new RGB(83, 83, 83)); //$NON-NLS-1$\r
-       \r
-       public static Color SCREENSHOT_CHART_SELECTED_LINE = getColor("screenshot_chart_selected_line" , new RGB(59, 188, 232)); //$NON-NLS-1$\r
-       public static Color SCREENSHOT_CHART_BORDER_LINE = getColor("screenshot_chart_border_line" , new RGB(117, 117, 117)); //$NON-NLS-1$\r
-       \r
-       public static Color CHART_BOARD_BACK = getColor("chart_board_back", new RGB(230, 230, 230)); //$NON-NLS-1$\r
-       public static Color CHART_BOARD_ITEM_LINE = getColor("chart_board_item_line", new RGB(171, 171, 171)); //$NON-NLS-1$\r
-       \r
        public static Color CHART_BOARD_ITEM_NAME_FOLD_BG = getColor(\r
                        "chart_fold_bg", new RGB(186, 190, 191)); //$NON-NLS-1$\r
-\r
        \r
+       public static Color CHART_SELECTION_RANGE = getColor(\r
+                       "chart_selection_range", new RGB(23, 98, 132)); //$NON-NLS-1$\r
+\r
        // shell window background color\r
        public static final Color WINDOW_BG_COLOR = getColor(\r
                        "window_bg_color", new RGB(51, 52, 53)); //$NON-NLS-1$\r
@@ -77,8 +100,8 @@ public class ColorResources {
        // public static final Color TITLEBAR_TEXT_COLOR = getColor(\r
        //                      "titlebar_text_color", new RGB(64, 208, 255)); //$NON-NLS-1$\r
        //\r
-        public static final Color TITLEBAR_BG_COLOR = getColor(\r
-                               "titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$\r
+       public static final Color TITLEBAR_BG_COLOR = getColor(\r
+                       "titlebar_bg", new RGB(78, 79, 81)); //$NON-NLS-1$\r
        //\r
        // /** device and application combo specific colors start **/\r
        // public static final Color DEVICE_APPLICATION_ENABLE = WHITE;\r
@@ -279,8 +302,8 @@ public class ColorResources {
        //                      "barGRAY3", new RGB(216, 216, 216)); //$NON-NLS-1$\r
        //\r
        // /* Timeline */\r
-        public static final Color ITEM_BLUE_BRIGHT = getColor("item blue right",\r
-                               new RGB(131, 196, 218));//$NON-NLS-1$\r
+       public static final Color ITEM_BLUE_BRIGHT = getColor("item blue right",\r
+                       new RGB(131, 196, 218));//$NON-NLS-1$\r
        public static final Color ITEM_BLUE_DARK = getColor("item blue dark",\r
                        new RGB(38, 104, 138));//$NON-NLS-1$\r
 \r
index 35ca2b5..0a21cd6 100644 (file)
@@ -57,7 +57,6 @@ public class DACustomTimelineRenderer {
                gc.setFont(font);
                gc.setBackground(ColorResources.TIMELINE_BG_COLOR);
                gc.fillRectangle(rt);
-               gc.drawRectangle(0, 0, rt.width - 1, rt.height - 1);
 
                // draw underLine
                gc.drawLine(0, rt.height - 1, rt.width, rt.height - 1);
index 4e51443..44cdbd5 100644 (file)
@@ -302,10 +302,10 @@ public class ImageResources {
        public static final Image STOP_PROGRESS_LOADING_08 = getPngImage("loading_icon_08"); //$NON-NLS-1$\r
        \r
        /*** thread page ***/\r
-       public static final Image THREAD_LOCK_COMBO_DISABLE = getPngImage("thread_lock_dropdown_disable"); //$NON-NLS-1$\r
-       public static final Image THREAD_LOCK_COMBO_NORMAL = getPngImage("thread_lock_dropdown_normal"); //$NON-NLS-1$\r
-       public static final Image THREAD_LOCK_COMBO_HOVER = getPngImage("thread_lock_dropdown_hover"); //$NON-NLS-1$\r
-       public static final Image THREAD_LOCK_COMBO_PUSH = getPngImage("thread_lock_dropdown_push"); //$NON-NLS-1$\r
+//     public static final Image TIMELINE_DROPDOWN_DISABLE = getPngImage("time_line_dropdown_disable"); //$NON-NLS-1$\r
+       public static final Image TIMELINE_DROPDOWN_NORMAL = getPngImage("time_line_dropdown_normal"); //$NON-NLS-1$\r
+       public static final Image TIMELINE_DROPDOWN_HOVER = getPngImage("time_line_dropdown_hover"); //$NON-NLS-1$\r
+       public static final Image TIMELINE_DROPDOWN_PUSH = getPngImage("time_line_dropdown_push"); //$NON-NLS-1$\r
 \r
        private static Image getImage(String pluginId, String folderName,\r
                        String imageName, String extension) {\r
index 6e797d5..450be73 100644 (file)
@@ -29,7 +29,6 @@ import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
-import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.logparser.LogPackage;
 import org.tizen.dynamicanalyzer.model.DAView;
@@ -42,8 +41,6 @@ import org.tizen.dynamicanalyzer.ui.widgets.TitleComboPopupRenderer;
 import org.tizen.dynamicanalyzer.ui.widgets.TitleComboRenderer;
 import org.tizen.dynamicanalyzer.ui.widgets.ViewContainer;
 import org.tizen.dynamicanalyzer.widgets.chartBoard.DACustomChartBoard;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DACustomChartBoardItem;
-import org.tizen.dynamicanalyzer.widgets.chartBoard.DACustomChartBoardSelectionListener;
 import org.tizen.dynamicanalyzer.widgets.combo.DACustomCombo;
 
 public class ThreadChartView extends DAView {
@@ -69,29 +66,12 @@ public class ThreadChartView extends DAView {
                threadChart = new DACustomChartBoard(contents,
                                ThreadPageLabels.THREAD_CHART_TITLE);
 
-               threadChart
-                               .addSelectionListener(new DACustomChartBoardSelectionListener() {
-
-                                       @Override
-                                       public void handleSelectionEvent(DACustomChartBoardItem item) {
-                                               ThreadPageData itemData = (ThreadPageData) item
-                                                               .getData();
-                                               if (!(itemData instanceof ThreadPageData)) {
-                                                       System.out
-                                                                       .println("error : item selected but can't get data");
-                                                       return;
-                                               }
-                                               DASelectionData data = new DASelectionData(
-                                                               ThreadChartView.ID, 0, 0, itemData, threadChart);
-                                               AnalyzerManager.getCurrentPage().updatePage(data);
-                                       }
-                               });
                combo = new DACustomCombo(threadChart.getTitleComp(), SWT.NONE);
 
-               combo.setImages(ImageResources.THREAD_LOCK_COMBO_NORMAL,
-                               ImageResources.THREAD_LOCK_COMBO_HOVER,
-                               ImageResources.THREAD_LOCK_COMBO_PUSH,
-                               ImageResources.THREAD_LOCK_COMBO_DISABLE);
+               combo.setImages(ImageResources.TIMELINE_DROPDOWN_NORMAL,
+                               ImageResources.TIMELINE_DROPDOWN_HOVER,
+                               ImageResources.TIMELINE_DROPDOWN_PUSH,
+                               ImageResources.TIMELINE_DROPDOWN_NORMAL);
                combo.add("Thread");
                // combo.add("Lock"); //FIXME
                combo.select(0);
@@ -122,6 +102,11 @@ public class ThreadChartView extends DAView {
        }
 
        @Override
+       public void updateView(DASelectionData data) { // FIXME
+
+       }
+
+       @Override
        public void updateLog(LogPackage logPack) {
                tManager.parsePageData(logPack);
        }
index 1f2f6e9..ba7684a 100644 (file)
@@ -28,7 +28,11 @@ package org.tizen.dynamicanalyzer.ui.thread;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
+import org.tizen.dynamicanalyzer.common.DASelectionData;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.logparser.LogPackage;
 import org.tizen.dynamicanalyzer.logparser.Logs;
@@ -37,6 +41,7 @@ import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineConstants;
+import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineView;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChart;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartPlot;
 import org.tizen.dynamicanalyzer.widgets.chart.DACustomChartSeries;
@@ -83,8 +88,59 @@ public class ThreadPageDataManager {
                setChartStyle(chart);
                data.setItem(item);
                item.setData(data);
+               chart.setData(data);
                chart.redraw();
        }
+       
+       private void sendSelectionTimes(DACustomChart chart, double start, double end){
+               long startTime = (long) (start * TimelineConstants.MEGA);
+               long endTime = (long) (end * TimelineConstants.MEGA);
+               if(endTime < startTime){
+                       long temp = startTime;
+                       startTime = endTime;
+                       endTime = temp;
+               }
+               if(startTime < 0){
+                       startTime = 0;
+               }
+               AnalyzerManager.getCurrentPage().updatePage(new DASelectionData(TimelineView.ID, startTime, endTime, chart.getData(), chart));
+       }
+       
+       private Listener chartMouseListener = new Listener() {
+
+               @Override
+               public void handleEvent(Event event) {
+                       DACustomChart chart = (DACustomChart) event.widget;
+                       DACustomChartPlot plot = chart.getPlot();
+
+                       switch (event.type) {
+                       case SWT.MouseMove:
+                               if ((event.stateMask & SWT.BUTTON1) != 0) {
+                                       board.getIntervalMarker().setEndVal(plot.getXFromXPixcel(event.x));
+                               }
+                               break;
+                       case SWT.MouseDown:
+                               board.getIntervalMarker().setInterval(plot.getXFromXPixcel(event.x), plot.getXFromXPixcel(event.x));
+                               break;
+                       case SWT.MouseUp:
+                               double endVal = plot.getXFromXPixcel(event.x);
+                               if(endVal <= plot.getVisibleEndX()){
+                                       board.getIntervalMarker().setEndVal(endVal);
+                               }
+                               else{
+                                       board.getIntervalMarker().setEndVal(plot.getVisibleEndX());
+                               }
+                               sendSelectionTimes(chart, board.getIntervalMarker().getStartVal(),board.getIntervalMarker().getEndVal());
+                               break;
+                       case SWT.MouseEnter:
+                               break;
+                       case SWT.MouseExit:
+                               break;
+                       default:
+                               break;
+                       }
+               }
+       };
 
        protected void setChartStyle(DACustomChart chart) {
                if (null == chart) {
@@ -98,9 +154,15 @@ public class ThreadPageDataManager {
                plot.setBackgroundImage(ImageResources.BG_GRADIENT);
                plot.setAutoHeightRange(false);
                // plot.setTooltip(new DACustomChartPlotTooltip(-1));
-               chart.getPlot().setAxisRangeY(0, 101);
-               chart.getPlot().setAxisRangeX(board.getVisibleStartTime(),
+               plot.setAxisRangeY(0, 101);
+               plot.setAxisRangeX(board.getVisibleStartTime(),
                                board.getVisibleEndTime());
+               plot.setIntervalMarker(board.getIntervalMarker());
+               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);
        }
 
        private void setChartSeries(DACustomChart chart) {
diff --git a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_disable.png b/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_disable.png
deleted file mode 100644 (file)
index 3ed5f14..0000000
Binary files a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_disable.png and /dev/null differ
diff --git a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_hover.png b/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_hover.png
deleted file mode 100644 (file)
index 7072a7e..0000000
Binary files a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_hover.png and /dev/null differ
diff --git a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_normal.png b/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_normal.png
deleted file mode 100644 (file)
index 62584af..0000000
Binary files a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_normal.png and /dev/null differ
diff --git a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_push.png b/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_push.png
deleted file mode 100644 (file)
index b10be2f..0000000
Binary files a/org.tizen.dynamicanalyzer/theme/black/img/thread_lock_dropdown_push.png and /dev/null differ
diff --git a/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_hover.png b/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_hover.png
new file mode 100644 (file)
index 0000000..e3e52ba
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_hover.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_normal.png b/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_normal.png
new file mode 100644 (file)
index 0000000..e6da5b6
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_normal.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_push.png b/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_push.png
new file mode 100644 (file)
index 0000000..14e71c6
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/black/img/time_line_dropdown_push.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_hover.png b/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_hover.png
new file mode 100644 (file)
index 0000000..e3e52ba
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_hover.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_normal.png b/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_normal.png
new file mode 100644 (file)
index 0000000..e6da5b6
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_normal.png differ
diff --git a/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_push.png b/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_push.png
new file mode 100644 (file)
index 0000000..14e71c6
Binary files /dev/null and b/org.tizen.dynamicanalyzer/theme/white/img/time_line_dropdown_push.png differ