本文整理了Java中org.eclipse.swt.widgets.Group.checkWidget()
方法的一些代码示例,展示了Group.checkWidget()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Group.checkWidget()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Group
类名称:Group
方法名:checkWidget
暂无
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Returns the receiver's text, which is the string that the
* is used as the <em>title</em>. If the text has not previously
* been set, returns an empty string.
*
* @return the text
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public String getText() {
checkWidget();
return text;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Returns the receiver's text, which is the string that the
* is used as the <em>title</em>. If the text has not previously
* been set, returns an empty string.
*
* @return the text
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public String getText () {
checkWidget();
return text;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Returns the receiver's text, which is the string that the
* is used as the <em>title</em>. If the text has not previously
* been set, returns an empty string.
*
* @return the text
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public String getText () {
checkWidget ();
return text;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Returns the receiver's text, which is the string that the
* is used as the <em>title</em>. If the text has not previously
* been set, returns an empty string.
*
* @return the text
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public String getText () {
checkWidget();
return text;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Returns the receiver's text, which is the string that the
* is used as the <em>title</em>. If the text has not previously
* been set, returns an empty string.
*
* @return the text
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public String getText () {
checkWidget();
return text;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/**
* Returns the receiver's text, which is the string that the
* is used as the <em>title</em>. If the text has not previously
* been set, returns an empty string.
*
* @return the text
*
* @exception SWTException <ul>
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*/
public String getText () {
checkWidget ();
return text;
}
boolean isTransparent() {
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
public Rectangle getClientArea () {
checkWidget();
NSRect rect = contentView.bounds();
int width = Math.max (0, (int) rect.width - hMargin * 2);
int height = Math.max (0, (int) rect.height - vMargin * 2);
return new Rectangle((int)(rect.x) + hMargin, (int)(rect.y) + vMargin, width, height);
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
checkWidget();
if( text == null ) {
SWT.error( SWT.ERROR_NULL_ARGUMENT );
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public Rectangle getClientArea() {
checkWidget();
Rectangle bounds = getBounds();
BoxDimensions trimmings = getThemeAdapter().getTrimmingSize( this );
int trimmingsWidth = trimmings.left + trimmings.right;
int trimmingsHeight = trimmings.top + trimmings.bottom;
BoxDimensions border = getBorder();
int borderWidth = border.left + border.right;
int borderHeight = border.top + border.bottom;
int width = Math.max( 0, bounds.width - trimmingsWidth - borderWidth );
int height = Math.max( 0, bounds.height - trimmingsHeight - borderHeight );
return new Rectangle( trimmings.left, trimmings.top, width, height );
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
public Point computeSize( int wHint, int hHint, boolean changed ) {
checkWidget();
Point result = super.computeSize( wHint, hHint, changed );
int length = text.length();
if( length != 0 ) {
Font font = getFont();
Point stringExtent = TextSizeUtil.stringExtent( font, text );
BoxDimensions headTrimmings = getThemeAdapter().getHeaderTrimmingSize( this );
int headerWidth = stringExtent.x + headTrimmings.left + headTrimmings.right;
result.x = Math.max( result.x, headerWidth );
}
return result;
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
NSBox widget = (NSBox)view;
NSRect newRect = new NSRect();
newRect.x = x;
newRect.y = y;
newRect.width = width;
newRect.height = height;
NSRect oldRect = widget.frame();
ignoreResize = true;
widget.setFrameFromContentFrame(newRect);
newRect = widget.frame();
widget.setFrame(oldRect);
ignoreResize = false;
x = (int) Math.ceil(newRect.x) - hMargin;
y = (int) Math.ceil(newRect.y) - vMargin;
width = (int) Math.ceil(newRect.width) + (hMargin * 2);
height = (int) Math.ceil(newRect.height) + (vMargin * 2);
return super.computeTrim(x, y, width, height);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
Rectangle computeTrimInPixels (int x, int y, int width, int height) {
checkWidget();
forceResize ();
GtkAllocation allocation = new GtkAllocation();
OS.gtk_widget_get_allocation (clientHandle, allocation);
int clientX = allocation.x;
int clientY = allocation.y;
x -= clientX;
y -= clientY;
width += clientX + clientX;
height += clientX + clientY;
return new Rectangle (x, y, width, height);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
Rectangle computeTrimInPixels (int x, int y, int width, int height) {
checkWidget();
forceResize ();
GtkAllocation allocation = new GtkAllocation();
OS.gtk_widget_get_allocation (clientHandle, allocation);
int clientX = allocation.x;
int clientY = allocation.y;
x -= clientX;
y -= clientY;
width += clientX + clientX;
height += clientX + clientY;
return new Rectangle (x, y, width, height);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
Rectangle computeTrimInPixels (int x, int y, int width, int height) {
checkWidget();
forceResize ();
GtkAllocation allocation = new GtkAllocation();
OS.gtk_widget_get_allocation (clientHandle, allocation);
int clientX = allocation.x;
int clientY = allocation.y;
x -= clientX;
y -= clientY;
width += clientX + clientX;
height += clientX + clientY;
return new Rectangle (x, y, width, height);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
public void setFont (Font font) {
checkWidget ();
Rectangle oldRect = getClientAreaInPixels ();
super.setFont (font);
Rectangle newRect = getClientAreaInPixels ();
if (!oldRect.equals (newRect)) sendResize ();
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
checkWidget();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
text = string;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override Rectangle getClientAreaInPixels () {
checkWidget ();
forceResize ();
RECT rect = new RECT ();
OS.GetClientRect (handle, rect);
int /*long*/ newFont, oldFont = 0;
int /*long*/ hDC = OS.GetDC (handle);
newFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont);
TEXTMETRIC tm = OS.IsUnicode ? (TEXTMETRIC) new TEXTMETRICW () : new TEXTMETRICA ();
OS.GetTextMetrics (hDC, tm);
if (newFont != 0) OS.SelectObject (hDC, oldFont);
OS.ReleaseDC (handle, hDC);
int offsetY = OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed () ? 0 : 1;
int x = CLIENT_INSET, y = tm.tmHeight + offsetY;
int width = Math.max (0, rect.right - CLIENT_INSET * 2);
int height = Math.max (0, rect.bottom - y - CLIENT_INSET);
return new Rectangle (x, y, width, height);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
checkWidget ();
Point size = super.computeSizeInPixels (wHint, hHint, changed);
int length = text.length ();
if (length != 0) {
String string = fixText (false);
/*
* If the group has text, and the text is wider than the
* client area, pad the width so the text is not clipped.
*/
TCHAR buffer = new TCHAR (getCodePage (), string == null ? text : string, true);
int /*long*/ newFont, oldFont = 0;
int /*long*/ hDC = OS.GetDC (handle);
newFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont);
RECT rect = new RECT ();
int flags = OS.DT_CALCRECT | OS.DT_SINGLELINE;
OS.DrawText (hDC, buffer, -1, rect, flags);
if (newFont != 0) OS.SelectObject (hDC, oldFont);
OS.ReleaseDC (handle, hDC);
int offsetY = OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed () ? 0 : 1;
size.x = Math.max (size.x, rect.right - rect.left + CLIENT_INSET * 6 + offsetY);
}
return size;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
checkWidget ();
if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
text = string;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override Rectangle computeTrimInPixels (int x, int y, int width, int height) {
checkWidget ();
Rectangle trim = super.computeTrimInPixels (x, y, width, height);
int /*long*/ newFont, oldFont = 0;
int /*long*/ hDC = OS.GetDC (handle);
newFont = OS.SendMessage (handle, OS.WM_GETFONT, 0, 0);
if (newFont != 0) oldFont = OS.SelectObject (hDC, newFont);
TEXTMETRIC tm = OS.IsUnicode ? (TEXTMETRIC) new TEXTMETRICW () : new TEXTMETRICA ();
OS.GetTextMetrics (hDC, tm);
if (newFont != 0) OS.SelectObject (hDC, oldFont);
OS.ReleaseDC (handle, hDC);
int offsetY = OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed () ? 0 : 1;
trim.x -= CLIENT_INSET;
trim.y -= tm.tmHeight + offsetY;
trim.width += CLIENT_INSET * 2;
trim.height += tm.tmHeight + CLIENT_INSET + offsetY;
return trim;
}
内容来源于网络,如有侵权,请联系作者删除!