From: joon.c.baek Date: Wed, 15 Jun 2016 00:51:22 +0000 (+0900) Subject: [SRADA-742] Apply #008aee tooltip outline X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e32aac403642334a861351d4f966197ec912f834;p=sdk%2Ftools%2Fdynamic-analyzer.git [SRADA-742] Apply #008aee tooltip outline Apply #008aee tooltip outline, Replace round rectangle to rectangle. Change-Id: I12035d4fd4f6523643efcdc0ba566273a2899ad8 Signed-off-by: joon.c.baek --- diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ColorResources.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ColorResources.java index 97661c7..cbdb178 100644 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ColorResources.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/helper/ColorResources.java @@ -3,7 +3,7 @@ * * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * - * Contact: + * Contact: * Jungwook Ryu * Jooyoul Lee * Juyoung Kim @@ -19,10 +19,10 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * Contributors: * - S-Core Co., Ltd - * + * */ package org.tizen.dynamicanalyzer.widgets.helper; @@ -42,15 +42,15 @@ public class ColorResources { public static final Color YELLOW = getColor("yellow", new RGB(250, 210, 10)); //$NON-NLS-1$ public static final Color DARK_YELLOW = getColor("dark_yellow", new RGB(219, 192, 10)); //$NON-NLS-1$ public static final Color CHART_INFO = getColor("chart_info", new RGB(121, 121, 121)); - + public static final Color GRAY_130 = getColor("gray_130", new RGB(130, 130, 130)); public static final Color GRAY_170 = getColor("gray_170", new RGB(170, 170, 170)); public static final Color GRAY_210 = getColor("gray_210", new RGB(210, 210, 210)); public static final Color GRAY_230 = getColor("gray_230", new RGB(230, 230, 230)); public static final Color GRAY_245 = getColor("gray_245", new RGB(245, 245, 245)); - + public static final Color POINT = getColor("point", new RGB(0, 138, 238)); - + // scale widget //[UX] 05 Feature list public static Color SCALE_OUTLINE_COLOR = getColor( "scale_outline_color", new RGB(177, 177, 177)); //$NON-NLS-1$ @@ -78,7 +78,7 @@ public class ColorResources { "chart_size_toggle_hover_stroke", new RGB(47, 85, 92)); //$NON-NLS-1$ public static Color CHART_SIZE_TOGGLE_PUSH_STROKE = getColor( "chart_size_toggle_push_stroke", new RGB(168, 168, 168)); //$NON-NLS-1$ - + // timeline public static Color TIMELINE_NUMBER_COLOR = getColor( "timeline_number", new RGB(92, 92, 92)); //$NON-NLS-1$ @@ -86,8 +86,8 @@ public class ColorResources { "timeline_tick", new RGB(168, 168, 168)); //$NON-NLS-1$ public static Color TIMELINE_BG_COLOR = getColor( "timeline_bg", new RGB(252, 252, 252)); //$NON-NLS-1$ - - // chart + + // chart public static Color CHART_BACKGROUND_NORMAL_TOP = getColor( "chart_background_normal_top", new RGB(244, 249, 251)); public static Color CHART_BACKGROUND_NORMAL_BOTTOM = getColor( @@ -106,7 +106,7 @@ public class ColorResources { "chart_name_parent_select_end", new RGB(129, 170, 186)); //$NON-NLS-1$ public static Color CHART_NAME_ADD_INFO_TEXT = getColor( "chart_name_add_info_text", new RGB(94, 94, 94)); //$NON-NLS-1$ - + public static Color CHART_NAME_CHILD_NORMAL_START = getColor( "chart_name_child_normal_start", new RGB(153, 165, 169)); //$NON-NLS-1$ public static Color CHART_NAME_CHILD_NORMAL_END = getColor( @@ -125,7 +125,7 @@ public class ColorResources { "screenshot_chart_selected_line", new RGB(59, 188, 232)); //$NON-NLS-1$ public static Color SCREENSHOT_CHART_BORDER_LINE = getColor( "screenshot_chart_border_line", new RGB(117, 117, 117)); //$NON-NLS-1$ - + public static Color SCREENSHOT_CHART_DOT = getColor( "screenshot_chart_dot", new RGB(142, 142, 142)); @@ -139,29 +139,29 @@ public class ColorResources { public static Color CHART_SELECTION_RANGE = getColor( "chart_selection_range", new RGB(23, 98, 132)); //$NON-NLS-1$ - + public static Color CHART_AXIS = getColor( "chart_axis", new RGB(94, 144, 160)); //$NON-NLS-1$ - + public static Color CHART_TOOLTIP_BACKGROUND_BACKGROUND = getColor( "chart_tooltip_background_background", new RGB(193, 193, 193)); //$NON-NLS-1$ - + public static Color CHART_TOOLTIP_BACKGROUND = getColor( "chart_tooltip_background", new RGB(204, 228, 247)); //$NON-NLS-1$ - + public static Color CHART_TOOLTIP_FOREGROUND = getColor( "chart_tooltip_foreground", new RGB(240, 249, 255)); //$NON-NLS-1$ - + public static Color CHART_TOOLTIP_LINE = getColor( "chart_tooltip_line", new RGB(0, 0, 0)); //$NON-NLS-1$ - + public static Color CHART_TOOLTIP_TEXT = getColor( "chart_tooltip_text", new RGB(108, 108, 108)); //$NON-NLS-1$ [UX] 06 chart area - 1 - + public static Color CHART_TOOLTIP_TIME = getColor( "chart_tooltip_time", new RGB(169, 169, 169)); //$NON-NLS-1$ [UX] 06 chart area - 2 - + public static Color CHART_TOOLTIP_TIME_NOW = getColor("chart_tooltip_time", new RGB(88, 88, 88)); // tooltip for feature dialog @@ -170,10 +170,10 @@ public class ColorResources { public static Color FEATURELIST_TOOLTIP_FOREGROUND = getColor( "featurelist_tooltip_foreground", new RGB(244, 244, 244)); public static Color FEATURELIST_TOOLTIP_LINE = getColor( - "featurelist_tooltip_line", new RGB(88, 88, 88)); + "featurelist_tooltip_line", new RGB(0, 138, 248)); public static Color FEATURELIST_TOOLTIP_TEXT = getColor( "featurelist_tooltip_text", new RGB(88, 88, 88)); - + // chart auto series color public static Color CHART_SERIES_BLUE = getColor( "chart_series_blue", new RGB(78, 129, 246)); //$NON-NLS-1$ diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/tooltip/DACustomTooltip.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/tooltip/DACustomTooltip.java index 6028731..f9b1b37 100644 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/tooltip/DACustomTooltip.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/tooltip/DACustomTooltip.java @@ -3,7 +3,7 @@ * * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. * - * Contact: + * Contact: * Heeyoung Hwang * Juyoung Kim * @@ -18,10 +18,10 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * Contributors: * - S-Core Co., Ltd - * + * */ package org.tizen.dynamicanalyzer.widgets.tooltip; @@ -54,7 +54,7 @@ public abstract class DACustomTooltip { public static final int TOOLTIP_TEXT_MARGIN = 8; public static final int TOOLTIP_LOCATION_LEFT = 10; public static final int TOOLTIP_LOCATION_TOP = 20; - + private int height = 0; private int width = 0; private Color backgroundColor = ColorResources.FEATURELIST_TOOLTIP_BACKGROUND; @@ -62,14 +62,14 @@ public abstract class DACustomTooltip { private Color strokeColor = ColorResources.FEATURELIST_TOOLTIP_LINE; private Color fontColor = ColorResources.FEATURELIST_TOOLTIP_TEXT; private Font font = FontResources.TIMELINE_FONT; - + protected Shell parent = null; protected Shell tooltipShell = null; protected Canvas tooltipCanvas = null; protected String selectedItem = null; protected List tooltipMessage = new ArrayList(); protected boolean hidden = false; - + public void openAndMove(Shell parent) { if (!tooltipMessage.isEmpty() && !hidden) { if (null == tooltipShell) { @@ -101,21 +101,21 @@ public abstract class DACustomTooltip { drawTooltip(e.gc); } }); - + tooltipCanvas.addKeyListener(keyListener); - + // tooltipShell open tooltipShell.open(); } } - - public void move() { + + public void move() { if (null != tooltipShell) { // set size size and location setTooltipShellSizeAndLocation(); } } - + public void close() { if (tooltipShell != null) tooltipShell.setVisible(false); @@ -127,7 +127,7 @@ public abstract class DACustomTooltip { public void setSeletedItem(String selectedItem) { this.selectedItem = selectedItem; - + if (null != selectedItem) { // update tooltip message setTooltipMessage(); @@ -140,30 +140,29 @@ public abstract class DACustomTooltip { // draw background Rectangle rect = tooltipCanvas.getClientArea(); gc.setAlpha(150); - gc.setForeground(foregroundColor); gc.setBackground(backgroundColor); - gc.fillGradientRectangle(rect.x, rect.y, rect.width, rect.height, true); - + gc.fillRectangle(rect.x, rect.y, rect.width, rect.height); + // draw stroke gc.setAlpha(255); gc.setForeground(strokeColor); - gc.drawRoundRectangle(rect.x, rect.y, rect.width-1, rect.height-1, 5, 5); + gc.drawRectangle(rect.x, rect.y, rect.width-1, rect.height-1); // draw text gc.setForeground(fontColor); gc.setFont(font); for (int i = 0; i < tooltipMessage.size(); i++) { - gc.drawText(tooltipMessage.get(i), TOOLTIP_HEIGHT_MARGIN, - TOOLTIP_HEIGHT_MARGIN + TOOLTIP_HEIGHT * i, + gc.drawText(tooltipMessage.get(i), TOOLTIP_HEIGHT_MARGIN, + TOOLTIP_HEIGHT_MARGIN + TOOLTIP_HEIGHT * i, SWT.DRAW_DELIMITER | SWT.DRAW_TRANSPARENT); } } - + private void setTooltipShellSizeAndLocation() { - generateTooltipSize(); + generateTooltipSize(); Point p = Display.getCurrent().getCursorLocation(); tooltipShell.setSize(width, height); - tooltipShell.setLocation(p.x + TOOLTIP_LOCATION_LEFT, + tooltipShell.setLocation(p.x + TOOLTIP_LOCATION_LEFT, p.y + TOOLTIP_LOCATION_TOP); } @@ -180,7 +179,7 @@ public abstract class DACustomTooltip { height = tooltipMessage.size() * TOOLTIP_TEXT_HEIGHT + (tooltipMessage.size() - 1) * TOOLTIP_TEXT_MARGIN + (TOOLTIP_HEIGHT_MARGIN * 2); - + // set width GC gc = new GC(parent.getDisplay(), SWT.NONE); gc.setFont(font); @@ -195,17 +194,17 @@ public abstract class DACustomTooltip { gc.dispose(); } } - + private KeyListener keyListener = new KeyListener() { @Override public void keyReleased(KeyEvent e) { // TODO Auto-generated method stub } - + @Override public void keyPressed(KeyEvent e) { - // TODO Auto-generated method stub + // TODO Auto-generated method stub } };