public CurrentStyle ( final Image image, final Color foreground, final Color background, final Font font )
{
this.image = image;
this.foreground = foreground;
this.background = background;
this.font = font;
}
java类org.eclipse.swt.graphics.Font的实例源码
StyleBlinker.java 文件源码
项目:neoscada
阅读 20
收藏 0
点赞 0
评论 0
StyleHandler.java 文件源码
项目:neoscada
阅读 54
收藏 0
点赞 0
评论 0
public Style ( final Image[] images, final Color[] foregroundColor, final Color[] backgroundColor, final Font[] font )
{
this.images = images;
this.foregroundColor = foregroundColor;
this.backgroundColor = backgroundColor;
this.font = font;
}
ViewLabelProvider.java 文件源码
项目:convertigo-eclipse
阅读 29
收藏 0
点赞 0
评论 0
public Font getFont(Object element) {
if (element instanceof DatabaseObjectTreeObject) {
DatabaseObjectTreeObject databaseObjectTreeObject = (DatabaseObjectTreeObject) element;
DatabaseObject databaseObject = databaseObjectTreeObject.getObject();
if (databaseObject.hasChanged) return fontModifiedDatabaseObject;
if (databaseObjectTreeObject.isDetectedObject) return fontDetectedDatabaseObject;
}
return fontSystem;
}
CicsConnectorComposite.java 文件源码
项目:convertigo-eclipse
阅读 27
收藏 0
点赞 0
评论 0
protected void initialize() {
GridData gridData = new org.eclipse.swt.layout.GridData();
gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
cicsData = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
cicsData.setEditable(false);
cicsData.setBackground(new Color(null,253,253,244));
cicsData.setFont(new Font(null,"Courier New",10,1));
cicsData.setLayoutData(gridData);
cicsData.setText("");
this.setLayout(new GridLayout());
setSize(new Point(300, 200));
}
DefaultViewZone.java 文件源码
项目:codelens-eclipse
阅读 21
收藏 0
点赞 0
评论 0
@Override
public void draw(int paintX, int paintSpaceLeadingX, int paintY, GC gc) {
StyledText styledText = super.getTextViewer().getTextWidget();
Rectangle client = styledText.getClientArea();
gc.setBackground(styledText.getDisplay().getSystemColor(SWT.COLOR_WHITE));
styledText.drawBackground(gc, paintX, paintY, client.width, super.getHeightInPx());
gc.setForeground(styledText.getDisplay().getSystemColor(SWT.COLOR_GRAY));
Font font = new Font(styledText.getDisplay(), "Arial", 9, SWT.ITALIC);
gc.setFont(font);
gc.drawText(this.getText(), paintX, paintY + 4);
}
StyledTextPatcher.java 文件源码
项目:codelens-eclipse
阅读 23
收藏 0
点赞 0
评论 0
private static Method getSetFontMethod(Object styledTextRenderer) throws NoSuchMethodException {
// if (SET_FONT_METHOD == null) {
Method SET_FONT_METHOD = styledTextRenderer.getClass().getDeclaredMethod("setFont",
new Class[] { Font.class, int.class });
SET_FONT_METHOD.setAccessible(true);
// }
return SET_FONT_METHOD;
}
KaviListColumns.java 文件源码
项目:eclipse-plugin-commander
阅读 33
收藏 0
点赞 0
评论 0
private Font createColumnFont(final ColumnOptions<T> options, ViewerCell cell) {
Font font = options.getFont();
if (font == null) {
FontDescriptor fontDescriptor = FontDescriptor.createFrom(cell.getFont()).setStyle(options.getFontStyle());
font = fontDescriptor.createFont(cell.getControl().getDisplay());
options.setFont(font);
}
return font;
}
ValueLabel.java 文件源码
项目:pandionj
阅读 24
收藏 0
点赞 0
评论 0
private void setAutoFont(int size, String text, FontStyle ... styles) {
Font f = FontManager.getFont(size, styles);
while(FigureUtilities.getTextWidth(text, f) > PandionJConstants.POSITION_WIDTH-4 && size > 8) {
size--;
f = FontManager.getFont(size, styles);
}
setFont(f);
}
KaviList.java 文件源码
项目:eclipse-plugin-commander
阅读 23
收藏 0
点赞 0
评论 0
private int averageCharacterWidth(Font font) {
int width;
GC gc = new GC(Display.getDefault());
gc.setFont(font);
FontMetrics fontMetrics = gc.getFontMetrics();
width = fontMetrics.getAverageCharWidth();
gc.dispose();
return width;
}
FontShop.java 文件源码
项目:openaudible
阅读 29
收藏 0
点赞 0
评论 0
private Font swapFont(Font old, Font newFont) {
if (old == newFont)
logger.error("font swap error.");
if (isset(old))
old.dispose();
return newFont;
}