[SRADA-550] Set location of feature dialog to center
authorjoon.c.baek <joon.c.baek@samsung.com>
Fri, 13 May 2016 04:18:33 +0000 (13:18 +0900)
committerdongkyu6 lee <dongkyu6.lee@samsung.com>
Tue, 17 May 2016 09:07:43 +0000 (18:07 +0900)
Set location of feature dialog to center
Location is specified left-top coordinate, x.y.
Feature dialog get parent's left-top and size.
Decide location using size, left-top of parent, own.

Change-Id: I30779934dd4c18912051a6c69ca02c4e409814f5
Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/FlatFeatureDialog.java

index ca25a93..91236b3 100644 (file)
@@ -123,6 +123,10 @@ public class FlatFeatureDialog extends DAMessageBox {
                        return false;
                }
                IDECommunicator.setOpenWelcomeDlg(true);
+
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - 1010)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - 620)/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
                shell.setSize(1010, 620);
                shell.setLayout(new FormLayout());
                shell.setBackground(ColorResources.WHITE);