From a5cf7a9c04fa001c273164b952c454063e9291c9 Mon Sep 17 00:00:00 2001 From: dongkyu6 lee Date: Tue, 16 Feb 2016 13:25:17 +0900 Subject: [PATCH] Modified text position on chart title Change-Id: I533f092adb116490872bbccfdfc77b2eec88828a --- .../widgets/chartBoard/DAChartBoardItemCell.java | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardItemCell.java b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardItemCell.java index 13a5970..cb15d98 100755 --- a/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardItemCell.java +++ b/org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/chartBoard/DAChartBoardItemCell.java @@ -52,7 +52,7 @@ import org.tizen.dynamicanalyzer.widgets.helper.ImageResources; public class DAChartBoardItemCell extends Composite { private final static int DEFAULT_FOLD_TOGGLE_BUTTON_SIZE = 10; private final static int DEFAULT_EXPAND_TOGGLE_BUTTON_SIZE = 16; - private final static int DEFAULT_TOGGLE_BUTTON_MARGIN = 4; + private final static int DEFAULT_TOGGLE_BUTTON_MARGIN = 1; private final static int DEFAULT_TOGGLE_BUTTON_TOP_MARGIN = 3; private final static int DEFAULT_TOGGLE_BUTTON_RIGHT_MARGIN = 2; private final static int DEFAULT_FOLD_TOGGLE_BUTTON_MARGIN = 23; @@ -118,19 +118,21 @@ public class DAChartBoardItemCell extends Composite { Rectangle rect = ((Canvas) (e.widget)).getClientArea(); drawNameCellBackGround(e.gc, rect); int startY = rect.height / 2; - if (rect.height > NAME_CELL_IMAGE_NAME_MARGIN) { - //drawNameImage(e.gc, itemIcon, rect, NAME_ICON_X, NAME_ICON_Y); - e.gc.drawImage(itemIcon, NAME_ICON_X, (rect.height / 2) - 18); + if (rect.height > NAME_CELL_IMAGE_NAME_MARGIN && itemIcon != null) { + e.gc.drawImage(itemIcon, NAME_ICON_X, (rect.height / 2) - 19); startY = NAME_ICON_Y + NAME_CELL_IMAGE_NAME_MARGIN; } - if (itemIcon == null) { - Point allNamep = e.gc.textExtent(itemName, SWT.DRAW_DELIMITER); - startY = rect.height / 2 - allNamep.y / 2 + NAME_CELL_DEFAULT_MARGIN; - } + e.gc.setForeground(ColorResources.BLACK); e.gc.setFont(parent.getNameFont()); - //drawText(e.gc, itemName, rect, rect.height / 2 - NAME_CELL_DEFAULT_MARGIN); - e.gc.drawText(itemName, 49, rect.height / 2 - NAME_CELL_DEFAULT_MARGIN, true); + + if (itemIcon == null) { + drawText(e.gc, itemName, rect, rect.height / 2 - 20); + } + else { + e.gc.drawText(itemName, 49, rect.height / 2 - NAME_CELL_DEFAULT_MARGIN, true); + } + } }); nameCell.addPaintListener(nameCellPaintListener); @@ -232,8 +234,7 @@ public class DAChartBoardItemCell extends Composite { FormData data = new FormData(); if (hasAdditionalInfo == false) { - data.top = new FormAttachment(50, - -(DEFAULT_FOLD_TOGGLE_BUTTON_SIZE / 2)); + data.top = new FormAttachment(100, -DEFAULT_FOLD_TOGGLE_BUTTON_SIZE); } else { data.top = new FormAttachment(0, DEFAULT_FOLD_TOGGLE_BUTTON_MARGIN); } @@ -378,7 +379,7 @@ public class DAChartBoardItemCell extends Composite { String[] temp = text.split("\n"); int lineLength = temp.length; Point[] p = new Point[lineLength]; - int middleX = rect.width / 2; + int middleX = (rect.width / 2) - 5; for (int i = 0; i < lineLength; i++) { p[i] = gc.textExtent(temp[i]); -- 2.7.4