There are 9 code examples for org.eclipse.swt.graphics.Font.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: OpenII Package: org.mitre.openii.editors.unity
Source Code: ContextPane.java (Click to view .java file)
Method Code:
public void createContextPane(Composite parent){
GridLayout viewlayout=new GridLayout(2,false);
viewlayout.marginHeight=0;
viewlayout.marginWidth=0;
viewlayout.verticalSpacing=0;
viewlayout.horizontalSpacing=0;
viewlayout.marginBottom=0;
parent.setLayout(viewlayout);
GridData viewGridData=new GridData();
viewGridData.horizontalAlignment=GridData.FILL;
viewGridData.verticalAlignment=GridData.FILL;
viewGridData.grabExcessHorizontalSpace=true;
viewGridData.grabExcessVerticalSpace=true;
parent.setLayoutData(viewGridData);
Composite synsetLabelC=new Composite(parent,SWT.NONE);
RowLayout labellayout=new RowLayout();
synsetLabelC.setLayout(labellayout);
synsetLabelC.setLayoutData(new GridData(SWT.BEGINNING,SWT.CENTER,true,false));
synsetLabel3=new Label(synsetLabelC,SWT.NONE);
synsetLabel3.setText("");
synsetLabel3.setFont(LargeBoldFont);
Composite buttons=new Composite(parent,SWT.NONE);
RowLayout tableButtonlayout=new RowLayout();
buttons.setLayout(tableButtonlayout);
buttons.setLayoutData(new GridData(SWT.END,SWT.CENTER,false,false));
contextView=new ScrolledComposite(parent,SWT.V_SCROLL | SWT.H_SCROLL);
contextViewGridData=new GridData();
contextViewGridData.horizontalSpan=2;
contextViewGridData.minimumHeight=0;
contextViewGridData.verticalIndent=0;
contextViewGridData.horizontalAlignment=GridData.FILL;
contextViewGridData.verticalAlignment=GridData.BEGINNING;
contextViewGridData.grabExcessHorizontalSpace=true;
contextViewGridData.grabExcessVerticalSpace=true;
contextView.setLayoutData(contextViewGridData);
contextViewLayout=new GridLayout(2,false);
contextViewLayout.marginHeight=4;
contextViewLayout.marginWidth=4;
contextView.setLayout(contextViewLayout);
new Composite(contextView,SWT.NONE);
contextView.setExpandVertical(true);
contextView.setExpandHorizontal(true);
addListeners();
}
Project Name: OpenII Package: org.mitre.openii.editors.unity
Source Code: UnityCanvas.java (Click to view .java file)
Method Code:
public void populateRow(TableItem item,boolean showTerms){
Term term=vocab.getTerm((Integer)item.getData("uid"));
String termName=term.getName();
AssociatedElement[] elements=term.getElements();
if (checkStatus.containsKey(item.getData("uid"))) {
item.setImage(0,CheckIcon);
}
else {
item.setImage(0,null);
}
for (int j=0; j < this.getWorkspace().getTable().getColumnCount(); j++) {
int ID=((Integer)this.getWorkspace().getTable().getColumn(j).getData("uid")).intValue();
if (ID == -202) {
}
else if (ID == -201) {
item.setText(j,termName);
item.setFont(j,boldFont);
}
else if (showTerms) {
String terms="";
for (int i=0; i < elements.length; i++) {
if (elements[i].getSchemaID() == ID) {
if (terms == "") {
terms=elements[i].getName();
}
else {
terms=terms + ", " + elements[i].getName();
}
}
}
item.setText(j,terms);
}
}
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal
Source Code: OwlUI.java (Click to view .java file)
Method Code:
/**
* @param drawable
* @param text
* @param font
* @return The size of the Text as Point.
*/
public static Point getTextSize(Drawable drawable,Font font,String text){
GC gc=new GC(drawable);
gc.setFont(font);
Point p=gc.textExtent(text);
gc.dispose();
return p;
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal
Source Code: SplashHandler.java (Click to view .java file)
Method Code:
@Override public void dispose(){
super.dispose();
fVersionColor.dispose();
fVersionFont.dispose();
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.dialogs
Source Code: PreviewFeedDialog.java (Click to view .java file)
Method Code:
private void createFonts(){
int fontHeight=10;
Font newsFont=OwlUI.getThemeFont(OwlUI.NEWS_TEXT_FONT_ID,SWT.NORMAL);
FontData[] fontData=newsFont.getFontData();
if (fontData.length > 0) {
fNewsFontFamily=fontData[0].getName();
fontHeight=fontData[0].getHeight();
}
int normal=fontHeight;
String fontUnit="pt";
fNormalFontCSS="font-size: " + normal + fontUnit+ ";";
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: NewsBrowserLabelProvider.java (Click to view .java file)
Method Code:
private void createFonts(){
int fontHeight=10;
Font newsFont=OwlUI.getThemeFont(OwlUI.NEWS_TEXT_FONT_ID,SWT.NORMAL);
FontData[] fontData=newsFont.getFontData();
if (fontData.length > 0) {
fNewsFontFamily=fontData[0].getName();
fontHeight=fontData[0].getHeight();
}
int normal=fontHeight;
int verysmall=normal - 2;
int small=normal - 1;
int bigger=normal + 1;
int biggest=bigger + 2;
String fontUnit="pt";
fNormalFontCSS="font-size: " + normal + fontUnit+ ";";
fVerySmallFontCSS="font-size: " + verysmall + fontUnit+ ";";
fSmallFontCSS="font-size: " + small + fontUnit+ ";";
fBiggerFontCSS="font-size: " + bigger + fontUnit+ ";";
fBiggestFontCSS="font-size: " + biggest + fontUnit+ ";";
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: NewsTableLabelProvider.java (Click to view .java file)
Method Code:
/**
* @param element
* @param columnIndex
* @return Font
*/
protected Font getFont(Object element,int columnIndex){
if (element instanceof INews) {
INews news=(INews)element;
INews.State state=news.getState();
if (state == null) return null;
if (state == INews.State.NEW || state == INews.State.UPDATED || state == INews.State.UNREAD) return fBoldFont;
}
if (element instanceof EntityGroup) return fBoldFont;
return null;
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.editors.feed
Source Code: BrowserBar.java (Click to view .java file)
Method Code:
private void setBusy(boolean busy){
if (fLocationInput.isDisposed()) return;
String url=fLocationInput.getText();
if (busy && StringUtils.isSet(url) && !ApplicationServer.getDefault().isNewsServerUrl(url)&& !URIUtils.ABOUT_BLANK.equals(url)) fLocationInput.setFont(fItalicFont);
else fLocationInput.setFont(null);
}
Project Name: rssowl.ui Package: org.rssowl.ui.internal.util
Source Code: CCLabel.java (Click to view .java file)
Method Code:
@Override public void setFont(Font font){
super.setFont(font);
redraw();
}