ASM #508 - Fix DialogAreaComposite for sizing and accessibility of controls
Change-Id: I53291acaa40c5bba926b31937674b1ece5864127 Former-commit-id:34069a96be
[formerly2ea1c1fa60
] [formerly34069a96be
[formerly2ea1c1fa60
] [formerly96d1555012
[formerly df46f9fc541a47e5f31210663ef69c4c5863fa28]]] Former-commit-id:96d1555012
Former-commit-id:0ba9da16b0
[formerly473496b99a
] Former-commit-id:be10c8d49c
This commit is contained in:
parent
412ee7d428
commit
120a23223b
1 changed files with 15 additions and 17 deletions
|
@ -60,6 +60,7 @@ import com.raytheon.viz.gfe.smartscript.FieldDefinition.FieldType;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* May 30, 2012 randerso Initial creation
|
* May 30, 2012 randerso Initial creation
|
||||||
|
* May 12, 2014 16167 ryu Fix sizing and accessibility of content.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -72,7 +73,7 @@ public class DialogAreaComposite extends ScrolledComposite {
|
||||||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(DialogAreaComposite.class);
|
.getHandler(DialogAreaComposite.class);
|
||||||
|
|
||||||
private static final double MAX_HEIGHT_RATIO = 0.85;
|
private static final double MAX_HEIGHT_RATIO = 0.80;
|
||||||
|
|
||||||
private static final double MAX_WIDTH_RATIO = 0.85;
|
private static final double MAX_WIDTH_RATIO = 0.85;
|
||||||
|
|
||||||
|
@ -225,30 +226,27 @@ public class DialogAreaComposite extends ScrolledComposite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Point compositeSize = varFrame.computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
||||||
|
int xSize = compositeSize.x;
|
||||||
|
int ySize = compositeSize.y;
|
||||||
|
|
||||||
|
this.setMinSize(new Point(xSize, ySize));
|
||||||
|
this.setExpandHorizontal(true);
|
||||||
|
this.setExpandVertical(true);
|
||||||
|
|
||||||
Rectangle monitorBounds = this.getDisplay().getPrimaryMonitor()
|
Rectangle monitorBounds = this.getDisplay().getPrimaryMonitor()
|
||||||
.getBounds();
|
.getBounds();
|
||||||
int maxXSize = (int) (monitorBounds.width * MAX_WIDTH_RATIO);
|
int maxXSize = (int) (monitorBounds.width * MAX_WIDTH_RATIO);
|
||||||
int maxYSize = (int) (monitorBounds.height * MAX_HEIGHT_RATIO);
|
int maxYSize = (int) (monitorBounds.height * MAX_HEIGHT_RATIO);
|
||||||
|
|
||||||
Point compositeSize = varFrame.computeSize(SWT.DEFAULT, SWT.DEFAULT);
|
maxXSize = Math.min(maxXSize, xSize);
|
||||||
int xSize = compositeSize.x;
|
maxYSize = Math.min(maxYSize, ySize);
|
||||||
int ySize = compositeSize.y;
|
|
||||||
if (xSize > maxXSize) {
|
|
||||||
xSize = maxXSize;
|
|
||||||
}
|
|
||||||
if (ySize > maxYSize) {
|
|
||||||
ySize = maxYSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||||
gd.heightHint = ySize;
|
gd.heightHint = maxYSize;
|
||||||
gd.widthHint = xSize;
|
gd.widthHint = maxXSize;
|
||||||
this.setLayoutData(gd);
|
this.setLayoutData(gd);
|
||||||
|
|
||||||
this.setMinSize(new Point(xSize, ySize));
|
|
||||||
this.setExpandHorizontal(true);
|
|
||||||
this.setExpandVertical(true);
|
|
||||||
|
|
||||||
// Make sure widgets are scrolled into view when they gain focus
|
// Make sure widgets are scrolled into view when they gain focus
|
||||||
// see:
|
// see:
|
||||||
// http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/ScrollSWTwidgetsintoviewwhentheygetfocus.htm
|
// http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/ScrollSWTwidgetsintoviewwhentheygetfocus.htm
|
||||||
|
|
Loading…
Add table
Reference in a new issue