本文整理汇总了Java中org.eclipse.jface.resource.JFaceResources.getDialogFont方法的典型用法代码示例。如果您正苦于以下问题:Java JFaceResources.getDialogFont方法的具体用法?Java JFaceResources.getDialogFont怎么用?Java JFaceResources.getDialogFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.resource.JFaceResources
的用法示例。
在下文中一共展示了JFaceResources.getDialogFont方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeSizeConstraints
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
/**
*
* @see
* org.eclipse.jface.text.IInformationControlExtension5#computeSizeConstraints(int,
* int)
*/
public Point computeSizeConstraints(int widthInChars, int heightInChars) {
if (fSymbolicFontName == null) {
return null;
}
GC gc= new GC(fBrowser);
Font font= fSymbolicFontName == null ? JFaceResources.getDialogFont() : JFaceResources.getFont(fSymbolicFontName);
gc.setFont(font);
int width= gc.getFontMetrics().getAverageCharWidth();
int height= gc.getFontMetrics().getHeight();
gc.dispose();
return new Point(widthInChars * width, heightInChars * height);
}
示例2: computeSizeConstraints
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
public Point computeSizeConstraints(int widthInChars, int heightInChars)
{
if (fSymbolicFontName == null)
return null;
GC gc = new GC(fBrowser);
Font font = fSymbolicFontName == null ? JFaceResources.getDialogFont() : JFaceResources
.getFont(fSymbolicFontName);
gc.setFont(font);
int width = gc.getFontMetrics().getAverageCharWidth();
int height = gc.getFontMetrics().getHeight();
gc.dispose();
return new Point(widthInChars * width, heightInChars * height);
}
示例3: newDefaultFont
import org.eclipse.jface.resource.JFaceResources; //导入方法依赖的package包/类
private Font newDefaultFont(int id) {
Display display = Display.getCurrent();
int bump = 0;
Font fontCopy = null;
switch (id) {
case DIALOG_FONT:
fontCopy = JFaceResources.getDialogFont();
break;
case TABLE_FONT:
fontCopy = JFaceResources.getDefaultFont();
if (GUI.isMac())
bump = -1;
break;
case TEXT_FONT:
fontCopy = JFaceResources.getTextFont();
break;
case HEADER_FONT:
fontCopy = JFaceResources.getDefaultFont();
break;
case TREE_FONT:
fontCopy = JFaceResources.getTextFont();
break;
default:
break;
}
FontData fd;
if (fontCopy != null)
fd = fontCopy.getFontData()[0];
else
fd = display.getSystemFont().getFontData()[0];
int size = Math.round(fd.getHeight()) + bump;
Font f = new Font(display, fd.getName(), size, 0);
FontData ff = f.getFontData()[0];
return f;
}