Adjust dialog location(preference, about)
authorjoon.c.baek <joon.c.baek@samsung.com>
Tue, 31 May 2016 06:56:52 +0000 (15:56 +0900)
committergihun chang <gihun.chang@samsung.com>
Tue, 31 May 2016 10:48:57 +0000 (19:48 +0900)
Adjust dialog location(preference dialog, about dialog)
to center of DA body.

Change-Id: I2789d7d88c57833ba941e982435d34a8065cd4fb
Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/AboutDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ProcessExplorerDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/RemoteDeviceDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/SaveAsDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/PreferencesDialog.java

index f513a47..5d189db 100755 (executable)
@@ -73,6 +73,9 @@ public class AboutDialog extends DAMessageBox {
        private static String daBuildIDInfo = CommonConstants.EMPTY;
        private static String daVersionInfo = CommonConstants.EMPTY;
 
+       final private int WIDTH = 430;
+       final private int HEIGHT = 330;
+
        final static String daAboutFilePath = PathManager.getWorkbenchPluginPath() + File.separator + "about.mappings";
 
        final static String daVersionFilePath = PathManager.DA_INSTALL_PATH + File.separator + "version";
@@ -87,7 +90,11 @@ public class AboutDialog extends DAMessageBox {
                if (opened) {
                        return false;
                }
-               shell.setSize(430, 330);
+
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - WIDTH)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - HEIGHT)/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
+               shell.setSize(WIDTH, HEIGHT);
                shell.setLayout(new FormLayout());
                shell.setText(AnalyzerLabels.ABOUT_DIALOG_TITLE);
                shell.addDisposeListener(new DisposeListener() {
index 213e69b..d6125f0 100644 (file)
@@ -52,14 +52,21 @@ import org.tizen.dynamicanalyzer.widgets.da.base.DAButton;
 import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
 
 public class ProcessExplorerDialog extends DAMessageBox {
+       final private int WIDTH = 446;
+       final private int HEIGHT = 600;
+
        private ProcessExplorer explorer = null;
        private DACustomButton okButton = null;
        private DACustomButton cancelButton = null;
 
        public ProcessExplorerDialog(Shell parentShell) {
                super(parentShell);
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - WIDTH)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - HEIGHT)/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
+
                shell.setLayout(new FormLayout());
-               shell.setSize(446, 600);
+               shell.setSize(WIDTH, HEIGHT);
                shell.setBackground(ColorResources.DIALOG_BG_UPPER);
                shell.setText(AnalyzerLabels.SELECT_PROCESS);
 
index d38bcf3..275bf8c 100644 (file)
@@ -52,6 +52,8 @@ import org.tizen.dynamicanalyzer.widgets.da.base.DATextBox;
 import org.tizen.dynamicanalyzer.widgets.helper.ImageResources;
 
 public class RemoteDeviceDialog extends DAMessageBox {
+       private final int WIDTH = 430;
+       private final int HEIGHT = 190;
 
        private final int EDITBOX_TOP_MARGIN = 18;
        private final int EDITBOX_INTERVAL = 10;
@@ -84,9 +86,11 @@ public class RemoteDeviceDialog extends DAMessageBox {
                super(parentShell);
 
                self = this;
-
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - WIDTH)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - HEIGHT)/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
                shell.setLayout(new FormLayout());
-               shell.setSize(430, 190);
+               shell.setSize(WIDTH, HEIGHT);
                shell.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
                shell.setText(AnalyzerLabels.REMOTE_DEVICE);
 
index ae9f3bf..8e4b431 100644 (file)
@@ -59,6 +59,9 @@ import org.tizen.dynamicanalyzer.widgets.da.base.DAMessageBox;
 import org.tizen.dynamicanalyzer.widgets.da.base.DATextBox;
 
 public class SaveAsDialog extends DAMessageBox {
+       private final int WIDTH = 446;
+       private final int HEIGHT = 145 + 22;
+
        private DATextBox textBox = null;
        private String saveFileName = null;
        private DAButton okButton = null;
@@ -70,8 +73,13 @@ public class SaveAsDialog extends DAMessageBox {
        }
 
        protected boolean run() {
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - WIDTH)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - HEIGHT)/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
+
+               shell.setSize(WIDTH, HEIGHT);
                shell.setLayout(new FormLayout());
-               shell.setSize(446, 145 + 22);
+               shell.setSize(WIDTH, HEIGHT);
                shell.setText(AnalyzerLabels.SAVE_TRACE_TITLE);
                shell.setBackground(ColorResources.DIALOG_BG_UPPER);
 
index 9933a48..29d60fb 100644 (file)
@@ -99,6 +99,9 @@ public class PreferencesDialog extends DAMessageBox {
                        return false;
                }
 
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - DIALOG_WIDTH)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - DIALOG_HEIGT)/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
                shell.setSize(DIALOG_WIDTH, DIALOG_HEIGT);
                shell.setLayout(new FormLayout());
                shell.setText(PreferencesDialogLabels.TITLE);
@@ -729,4 +732,4 @@ public class PreferencesDialog extends DAMessageBox {
 
                }
        };
-}
\ No newline at end of file
+}