Codota Logo
Font.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.eclipse.swt.graphics.Font
constructor

Best Java code snippets using org.eclipse.swt.graphics.Font.<init> (Showing top 20 results out of 738)

  • Common ways to obtain Font
private void myMethod () {
Font f =
  • Codota IconComposite parent;parent.getFont()
  • Codota IconJFaceResources.getDialogFont()
  • Codota IconGC gc;gc.getFont()
  • Smart code suggestions by Codota
}
origin: pentaho/pentaho-kettle

/**
 * Create a new managed font by using fontdata
 *
 * @param display
 *          the display to use
 * @param fontData
 *          The fontdata to create the font with.
 */
public ManagedFont( Display display, FontData fontData ) {
 this.font = new Font( display, fontData );
 this.systemFont = false;
}
origin: pentaho/pentaho-kettle

public void setFont( String fontName, int fontSize, boolean fontBold, boolean fontItalic ) {
 int swt = SWT.NORMAL;
 if ( fontBold ) {
  swt = SWT.BOLD;
 }
 if ( fontItalic ) {
  swt = swt | SWT.ITALIC;
 }
 Font font = new Font( PropsUI.getDisplay(), fontName, fontSize, swt );
 int index = fonts.indexOf( font );
 if ( index < 0 ) {
  fonts.add( font );
 } else {
  font.dispose();
  font = fonts.get( index );
 }
 gc.setFont( font );
}
origin: pentaho/pentaho-kettle

public void setFont( String fontName, int fontSize, boolean fontBold, boolean fontItalic ) {
 int swt = SWT.NORMAL;
 if ( fontBold ) {
  swt = SWT.BOLD;
 }
 if ( fontItalic ) {
  swt = swt | SWT.ITALIC;
 }
 Font font = new Font( PropsUI.getDisplay(), fontName, fontSize, swt );
 int index = fonts.indexOf( font );
 if ( index < 0 ) {
  fonts.add( font );
 } else {
  font.dispose();
  font = fonts.get( index );
 }
 gc.setFont( font );
}
origin: caoxinyu/RedisClient

font = new Font(Display.getCurrent(), fontData);
m_fontMap.put(fontName, font);
origin: pentaho/pentaho-kettle

 public void widgetSelected( SelectionEvent arg0 ) {
  graphFont.dispose();
  graphFontData = props.getDefaultFontData();
  graphFont = new Font( display, graphFontData );
  wGFont.redraw();
 }
} );
origin: pentaho/pentaho-kettle

 public void widgetSelected( SelectionEvent arg0 ) {
  noteFontData = props.getDefaultFontData();
  noteFont.dispose();
  noteFont = new Font( display, noteFontData );
  wNFont.redraw();
 }
} );
origin: caoxinyu/RedisClient

/**
 * Returns a bold version of the given {@link Font}.
 * 
 * @param baseFont
 *            the {@link Font} for which a bold version is desired
 * @return the bold version of the given {@link Font}
 */
public static Font getBoldFont(Font baseFont) {
  Font font = m_fontToBoldFontMap.get(baseFont);
  if (font == null) {
    FontData fontDatas[] = baseFont.getFontData();
    FontData data = fontDatas[0];
    font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
    m_fontToBoldFontMap.put(baseFont, font);
  }
  return font;
}
/**
origin: pentaho/pentaho-kettle

public static void setGCFont( GC gc, Device device, FontData fontData ) {
 if ( Const.getOS().startsWith( "Windows" ) ) {
  Font font = new Font( device, fontData );
  gc.setFont( font );
  font.dispose();
 } else {
  gc.setFont( device.getSystemFont() );
 }
}
origin: pentaho/pentaho-kettle

public void getData() {
 fixedFontData = props.getFixedFont();
 fixedFont = new Font( display, fixedFontData );
 graphFontData = props.getGraphFont();
 graphFont = new Font( display, graphFontData );
 noteFontData = props.getNoteFont();
 noteFont = new Font( display, noteFontData );
 backgroundRGB = props.getBackgroundRGB();
 if ( backgroundRGB == null ) {
  backgroundRGB = display.getSystemColor( SWT.COLOR_WIDGET_BACKGROUND ).getRGB();
 }
 background = new Color( display, backgroundRGB );
 graphColorRGB = props.getGraphColorRGB();
 graphColor = new Color( display, graphColorRGB );
 tabColorRGB = props.getTabColorRGB();
 tabColor = new Color( display, tabColorRGB );
}
origin: pentaho/pentaho-kettle

 public void widgetSelected( SelectionEvent arg0 ) {
  FontDialog fd = new FontDialog( shell );
  fd.setFontList( new FontData[] { noteFontData } );
  FontData newfd = fd.open();
  if ( newfd != null ) {
   noteFontData = newfd;
   noteFont.dispose();
   noteFont = new Font( display, noteFontData );
   wNFont.redraw();
  }
 }
} );
origin: pentaho/pentaho-kettle

 public void widgetSelected( SelectionEvent arg0 ) {
  FontDialog fd = new FontDialog( shell );
  fd.setFontList( new FontData[] { graphFontData } );
  FontData newfd = fd.open();
  if ( newfd != null ) {
   graphFontData = newfd;
   graphFont.dispose();
   graphFont = new Font( display, graphFontData );
   wGFont.redraw();
  }
 }
} );
origin: pentaho/pentaho-kettle

 public void widgetSelected( SelectionEvent arg0 ) {
  FontDialog fd = new FontDialog( shell );
  fd.setFontList( new FontData[] { fixedFontData } );
  FontData newfd = fd.open();
  if ( newfd != null ) {
   fixedFontData = newfd;
   fixedFont.dispose();
   fixedFont = new Font( display, fixedFontData );
   wFFont.redraw();
  }
 }
} );
origin: pentaho/pentaho-kettle

 private void refreshTextNote() {
  int swt = SWT.NORMAL;
  if ( wFontBold.getSelection() ) {
   swt = SWT.BOLD;
  }
  if ( wFontItalic.getSelection() ) {
   swt = swt | SWT.ITALIC;
  }
  // dispose of old font only after setting it on wDesc
  Font oldFont = font;
  font = new Font( shell.getDisplay(), wFontName.getText(), wFontSize.getSelection(), swt );
  wDesc.setFont( font );
  if ( oldFont != null && !oldFont.isDisposed() ) {
   oldFont.dispose();
  }
  for ( Control control : wDesc.getChildren() ) {
   control.setBackground( bgColor );
  }

  wFontColor.setBackground( fontColor );
  wBackGroundColor.setBackground( bgColor );
  wBorderColor.setBackground( borderColor );
 }
}
origin: pentaho/pentaho-kettle

 licFont.dispose();
licFont = new Font( e.display, "Helvetica", licFontSize, SWT.NORMAL );
e.gc.setFont( licFont );
origin: pentaho/pentaho-kettle

verFont = new Font( display, "Helvetica", 11, SWT.BOLD );
licFont = new Font( display, "Helvetica", licFontSize, SWT.NORMAL );
devWarningFont = new Font( display, "Helvetica", 10, SWT.NORMAL );
origin: pentaho/pentaho-kettle

 public void widgetSelected( SelectionEvent arg0 ) {
  fixedFontData = new FontData( PropsUI.getInstance().getFixedFont().getName(),
   PropsUI.getInstance().getFixedFont().getHeight(), PropsUI.getInstance().getFixedFont().getStyle() );
  fixedFont.dispose();
  fixedFont = new Font( display, fixedFontData );
  wFFont.redraw();
 }
} );
origin: pentaho/pentaho-kettle

private void setHelpLink( Display display, String helpLink, int maxTextWidth, EnvironmentCase environment ) {
 link = new Link( shell, SWT.SINGLE | SWT.WRAP );
 link.setText( helpLink );
 if ( environment == EnvironmentCase.MAC_OS_X || environment == EnvironmentCase.MAC_OS_X_THIN ) {
  FontData[] fD = link.getFont().getFontData();
  fD[0].setHeight( 13 );
  link.setFont( new Font( display, fD[0] ) );
 }
 FormData fdlink = new FormData();
 fdlink.left = new FormAttachment( warningIcon, margin ); // Link should be below description right of icon
 fdlink.top = new FormAttachment( description, margin );
 fdlink.width = maxTextWidth;
 link.setLayoutData( fdlink );
 props.setLook( link );
 link.addListener( SWT.Selection, new Listener() {
  public void handleEvent( Event event ) {
   if ( Desktop.isDesktopSupported() ) {
    try {
     Desktop.getDesktop().browse( new URI( Const.getDocUrl( URI_PATH ) ) );
    } catch ( Exception e ) {
     log.logError( "Error opening external browser", e );
    }
   }
  }
 } );
}
origin: pentaho/pentaho-kettle

helpLabel.setFont( new Font( display, "Open Sans Regular", 11, SWT.NORMAL ) );
helpLabel.setForeground( new Color( display, 0, 94, 170 ) );
FormData helpLabelFormData = new FormData();
origin: pentaho/pentaho-kettle

TableView.dummyGC = new GC( TableView.dummyImage );
gridFont = new Font( disp, props.getGridFont() );
TableView.dummyGC.setFont( gridFont );
origin: BiglySoftware/BiglyBT

public static Font getAnyFontBoldItalic(GC gc) {
  if (fontBoldItalic == null || fontBoldItalic.isDisposed()) {
    FontData[] fontData = gc.getFont().getFontData();
    for (FontData fd : fontData) {
      fd.setStyle(SWT.BOLD | SWT.ITALIC);
    }
    fontBoldItalic = new Font(gc.getDevice(), fontData);
  }
  return fontBoldItalic;
}

org.eclipse.swt.graphicsFont<init>

Javadoc

Prevents uninitialized instances from being created outside the package.

Popular methods of Font

  • getFontData
    Returns an array of FontDatas representing the receiver. On Windows, only one FontData will be retur
  • dispose
  • isDisposed
    Returns true if the font has been disposed, and false otherwise. This method gets the dispose state
  • equals
    Compares the argument to the receiver, and returns true if they represent the same object using a c
  • getDevice
  • hashCode
    Returns an integer hash code for the receiver. Any two objects that return true when passed toequal
  • init
  • gtk_new
    Invokes platform specific functionality to allocate a new font.IMPORTANT: This method is not part of
  • addTraits
  • checkDevice
  • cocoa_new
    Invokes platform specific functionality to allocate a new font.IMPORTANT: This method is not part of
  • findFontData
  • cocoa_new,
  • findFontData,
  • win32_new

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now