本文整理了Java中org.eclipse.swt.widgets.Shell.getBoundsInPixels()
方法的一些代码示例,展示了Shell.getBoundsInPixels()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getBoundsInPixels()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Shell
类名称:Shell
方法名:getBoundsInPixels
暂无
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void center () {
if (parent == null) return;
Rectangle rect = getBoundsInPixels ();
Rectangle parentRect = display.mapInPixels (parent, null, parent.getClientAreaInPixels());
int x = Math.max (parentRect.x, parentRect.x + (parentRect.width - rect.width) / 2);
int y = Math.max (parentRect.y, parentRect.y + (parentRect.height - rect.height) / 2);
Rectangle monitorRect = parent.getMonitor ().getClientArea();
if (x + rect.width > monitorRect.x + monitorRect.width) {
x = Math.max (monitorRect.x, monitorRect.x + monitorRect.width - rect.width);
} else {
x = Math.max (x, monitorRect.x);
}
if (y + rect.height > monitorRect.y + monitorRect.height) {
y = Math.max (monitorRect.y, monitorRect.y + monitorRect.height - rect.height);
} else {
y = Math.max (y, monitorRect.y);
}
setLocationInPixels (x, y);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
void center () {
if (parent == null) return;
Rectangle rect = getBoundsInPixels ();
Rectangle parentRect = display.mapInPixels (parent, null, parent.getClientAreaInPixels());
int x = Math.max (parentRect.x, parentRect.x + (parentRect.width - rect.width) / 2);
int y = Math.max (parentRect.y, parentRect.y + (parentRect.height - rect.height) / 2);
Rectangle monitorRect = DPIUtil.autoScaleUp(parent.getMonitor ().getClientArea());
if (x + rect.width > monitorRect.x + monitorRect.width) {
x = Math.max (monitorRect.x, monitorRect.x + monitorRect.width - rect.width);
} else {
x = Math.max (x, monitorRect.x);
}
if (y + rect.height > monitorRect.y + monitorRect.height) {
y = Math.max (monitorRect.y, monitorRect.y + monitorRect.height - rect.height);
} else {
y = Math.max (y, monitorRect.y);
}
setLocationInPixels (x, y);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
void center () {
if (parent == null) return;
Rectangle rect = getBoundsInPixels ();
Rectangle parentRect = display.mapInPixels (parent, null, parent.getClientAreaInPixels());
int x = Math.max (parentRect.x, parentRect.x + (parentRect.width - rect.width) / 2);
int y = Math.max (parentRect.y, parentRect.y + (parentRect.height - rect.height) / 2);
Rectangle monitorRect = DPIUtil.autoScaleUp(parent.getMonitor ().getClientArea());
if (x + rect.width > monitorRect.x + monitorRect.width) {
x = Math.max (monitorRect.x, monitorRect.x + monitorRect.width - rect.width);
} else {
x = Math.max (x, monitorRect.x);
}
if (y + rect.height > monitorRect.y + monitorRect.height) {
y = Math.max (monitorRect.y, monitorRect.y + monitorRect.height - rect.height);
} else {
y = Math.max (y, monitorRect.y);
}
setLocationInPixels (x, y);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
void center () {
if (parent == null) return;
Rectangle rect = getBoundsInPixels ();
Rectangle parentRect = display.mapInPixels (parent, null, parent.getClientAreaInPixels());
int x = Math.max (parentRect.x, parentRect.x + (parentRect.width - rect.width) / 2);
int y = Math.max (parentRect.y, parentRect.y + (parentRect.height - rect.height) / 2);
Rectangle monitorRect = DPIUtil.autoScaleUp(parent.getMonitor ().getClientArea());
if (x + rect.width > monitorRect.x + monitorRect.width) {
x = Math.max (monitorRect.x, monitorRect.x + monitorRect.width - rect.width);
} else {
x = Math.max (x, monitorRect.x);
}
if (y + rect.height > monitorRect.y + monitorRect.height) {
y = Math.max (monitorRect.y, monitorRect.y + monitorRect.height - rect.height);
} else {
y = Math.max (y, monitorRect.y);
}
setLocationInPixels (x, y);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
Rectangle rect = getBoundsInPixels ();
boolean sameOrigin = !move || (rect.x == x && rect.y == y);
boolean sameExtent = !resize || (rect.width == width && rect.height == height);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
Rectangle rect = getBoundsInPixels ();
boolean sameOrigin = !move || (rect.x == x && rect.y == y);
boolean sameExtent = !resize || (rect.width == width && rect.height == height);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
Rectangle rect = getBoundsInPixels ();
boolean sameOrigin = !move || (rect.x == x && rect.y == y);
boolean sameExtent = !resize || (rect.width == width && rect.height == height);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
Rectangle bounds = getBoundsInPixels();
int widthAdjustment = display.trimWidths[trimStyle] - trimWidth;
int heightAdjustment = display.trimHeights[trimStyle] - trimHeight;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
Rectangle bounds = getBoundsInPixels();
int widthAdjustment = display.trimWidths[trimStyle] - trimWidth;
int heightAdjustment = display.trimHeights[trimStyle] - trimHeight;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
Rectangle bounds = getBoundsInPixels();
int widthAdjustment = display.trimWidths[trimStyle] - trimWidth;
int heightAdjustment = display.trimHeights[trimStyle] - trimHeight;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
OS.gtk_widget_realize (parentHandle);
int /*long*/ window = gtk_widget_get_window (parentHandle);
Rectangle rect = getBoundsInPixels ();
GdkWindowAttr attributes = new GdkWindowAttr ();
attributes.width = rect.width;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
OS.gtk_widget_realize (parentHandle);
int /*long*/ window = gtk_widget_get_window (parentHandle);
Rectangle rect = getBoundsInPixels ();
GdkWindowAttr attributes = new GdkWindowAttr ();
attributes.width = rect.width;
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
OS.gtk_widget_realize (parentHandle);
long /*int*/ window = gtk_widget_get_window (parentHandle);
Rectangle rect = getBoundsInPixels ();
GdkWindowAttr attributes = new GdkWindowAttr ();
attributes.width = rect.width;
内容来源于网络,如有侵权,请联系作者删除!