本文整理了Java中org.eclipse.swt.widgets.Tree.getFont()
方法的一些代码示例,展示了Tree.getFont()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getFont()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:getFont
暂无
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
private int computeItemHeight() {
BoxDimensions padding = getCellPadding();
int paddingHeight = padding.top + padding.bottom;
int textHeight = TextSizeUtil.getCharHeight( getFont() );
textHeight += TEXT_MARGIN.height + paddingHeight;
int itemImageHeight = getItemImageSize().y + paddingHeight;
int result = Math.max( itemImageHeight, textHeight );
if( hasCheckBoxes( 0 ) ) {
result = Math.max( getCheckImageOuterSize().height, result );
}
result += 1; // The space needed for horizontal gridline is always added, even if not visible
result = Math.max( result, MIN_ITEM_HEIGHT );
return result;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
/**
* Returns the font that the receiver will use to paint textual information for this item.
*
* @return the receiver's font
*
* @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>
*
* @since 3.0
*/
public Font getFont () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
return font != null ? font : parent.getFont ();
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/**
* Returns the font that the receiver will use to paint textual information for this item.
*
* @return the receiver's font
*
* @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>
*
* @since 3.0
*/
public Font getFont () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
return font != null ? font : parent.getFont ();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
/**
* Returns the font that the receiver will use to paint textual information for this item.
*
* @return the receiver's font
*
* @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>
*
* @since 3.0
*/
public Font getFont () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
return font != null ? font : parent.getFont ();
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Returns the font that the receiver will use to paint textual information for this item.
*
* @return the receiver's font
*
* @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>
*
* @since 3.0
*/
public Font getFont () {
checkWidget ();
if (!parent.checkData (this, true)) error (SWT.ERROR_WIDGET_DISPOSED);
return font != null ? font : parent.getFont ();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
/**
* Returns the font that the receiver will use to paint textual information for this item.
*
* @return the receiver's font
*
* @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>
*
* @since 3.0
*/
public Font getFont () {
checkWidget ();
if (!parent.checkData (this)) error (SWT.ERROR_WIDGET_DISPOSED);
return font != null ? font : parent.getFont ();
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
void setItemHeight (Image image, NSFont font, boolean set) {
if (font == null) font = getFont ().handle;
double /*float*/ ascent = font.ascender ();
double /*float*/ descent = -font.descender () + font.leading ();
int height = (int)Math.ceil (ascent + descent) + 1;
Rectangle bounds = image != null ? image.getBounds () : imageBounds;
if (bounds != null) {
imageBounds = bounds;
height = Math.max (height, bounds.height);
}
NSTableView widget = (NSTableView)view;
if (set || widget.rowHeight () < height) {
widget.setRowHeight (height);
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Returns the font that the receiver will use to paint textual information
* for this item.
*
* @return the receiver's font
* @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 Font getFont() {
checkWidget();
if( !parent.checkData( this, index ) ) {
error( SWT.ERROR_WIDGET_DISPOSED );
}
Font result;
if( font == null ) {
result = parent.getFont();
} else {
result = font;
}
return result;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Returns the font that the receiver will use to paint textual information
* for the specified cell in this item.
*
* @param index the column index
* @return the receiver's font
* @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 Font getFont( int index ) {
checkWidget();
if( !parent.checkData( this, this.index ) ) {
error( SWT.ERROR_WIDGET_DISPOSED );
}
Font result;
if( hasData( index ) && data[ index ].font != null ) {
result = data[ index ].font;
} else if( font == null ) {
result = parent.getFont();
} else {
result = font;
}
return result;
}
代码示例来源:origin: ifedorenko/p2-browser
toolkit.paintBordersFor( tree );
Font font = tree.getFont();
FontData[] fontDatas = font.getFontData();
for ( FontData fontData : fontDatas )
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
gc.setFont(tree.getFont());
FontMetrics fontMetrics = gc.getFontMetrics();
gc.dispose();
代码示例来源:origin: org.eclipse/org.eclipse.wst.server.ui
textEditor.setFont(tree.getFont());
textEditorParent.setBackground(textEditor.getBackground());
textEditor.addListener(SWT.Modify, new Listener() {
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
textEditor.setFont(navigatorTree.getFont());
textEditorParent.setBackground(textEditor.getBackground());
textEditor.addListener(SWT.Modify, e -> {
代码示例来源:origin: BiglySoftware/BiglyBT
FontData[] fontData = tree.getFont().getFontData();
fontData[0].setStyle(SWT.BOLD);
filterFoundFont = new Font(d, fontData);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui
viewer.setContentProvider(contentProvider);
RepositoryViewLabelProvider labelProvider = new RepositoryViewLabelProvider(viewer.getTree().getFont());
viewer.setLabelProvider(new DecoratingStyledCellLabelProvider(labelProvider,
PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator(), null));
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide
filterView.setColumnProperties(FilterTypeUtil.columnNames);
plainFont = filterView.getTree().getFont();
FontData[] boldFontData= getModifiedFontData(plainFont.getFontData(), SWT.BOLD);
boldFont = new Font(Display.getCurrent(), boldFontData);
代码示例来源:origin: BiglySoftware/BiglyBT
tree.setForeground(fg);
fontHeader = FontUtils.getFontWithStyle(tree.getFont(), SWT.BOLD, 1.0f);
代码示例来源:origin: BiglySoftware/BiglyBT
Font font = tree.getFont();
if (font != null && !font.isDisposed()) {
gc.setFont(font);
内容来源于网络,如有侵权,请联系作者删除!