本文整理匯總了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;
}