Adjust trivial dialog location to center
authorjoon.c.baek <joon.c.baek@samsung.com>
Wed, 1 Jun 2016 02:35:23 +0000 (11:35 +0900)
committerjoon.c baek <joon.c.baek@samsung.com>
Wed, 1 Jun 2016 02:37:07 +0000 (11:37 +0900)
Adjust trivial dialog location.
(prepare to tracing, Warning, Getting UI infomation etc,.)
These located at the center of DA body.

Change-Id: Icf4a9aac79a4067866e25aab3ee7bba3cdc4ccbe
Signed-off-by: joon.c.baek <joon.c.baek@samsung.com>
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/base/DADialog.java
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/base/ProgressDialog.java

index 980e186..17fb67e 100644 (file)
@@ -83,6 +83,9 @@ public class DADialog {
        
        public boolean setDialog(boolean isExport) {
                shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - this.width)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - this.height)/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
                shell.setSize(width, height);
                shell.setLayout(new FormLayout());
                shell.setText(titleText);
index 38d1e3a..8def1cd 100644 (file)
@@ -60,6 +60,9 @@ import org.tizen.dynamicanalyzer.widgets.animation.DAAnimationIcon;
 import org.tizen.dynamicanalyzer.widgets.progress.Progress;
 
 public class ProgressDialog {
+       private final int WIDTH = 300;
+       private final int HEIGHT = 110;
+
        public static final int PROGRESS_STYLE_DEFAULT = 0;// default
        public static final int PROGRESS_STYLE_CANCEL = 1; 
        public static final int PROGRESS_STYLE_WARNING = 2;
@@ -189,7 +192,10 @@ public class ProgressDialog {
        
        public void createProgress(boolean isIndeterminate) {
                shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.NO_TRIM );
-               shell.setSize(300, 110);
+               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);
                
                progressComp = new Composite(shell, SWT.NONE);
                progressComp.setLayout(new FormLayout());
@@ -302,6 +308,9 @@ public class ProgressDialog {
                }
                
                shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.NO_TRIM );
+               int dialogLocationX = shell.getParent().getLocation().x + (shell.getParent().getSize().x - 350)/2;
+               int dialogLocationY = shell.getParent().getLocation().y + (shell.getParent().getSize().y - sizeInfo.get(0))/2;
+               shell.setLocation(dialogLocationX, dialogLocationY);
                shell.setSize(350, sizeInfo.get(0));
                
                msgComp = new Composite(shell, SWT.NONE);