Java Code Examples for org.pentaho.di.ui.core.PropsUI#getDisplay()

The following examples show how to use org.pentaho.di.ui.core.PropsUI#getDisplay() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SWTDirectGC.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
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 );
}
 
Example 2
Source File: SWTGC.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
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 );
}
 
Example 3
Source File: SWTDirectGC.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private Color getColor( int r, int g, int b ) {
  Color color = new Color( PropsUI.getDisplay(), new RGB( r, g, b ) );
  int index = colors.indexOf( color );
  if ( index < 0 ) {
    colors.add( color );
  } else {
    color.dispose();
    color = colors.get( index );
  }
  return color;
}
 
Example 4
Source File: SWTGC.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private Color getColor( int r, int g, int b ) {
  Color color = new Color( PropsUI.getDisplay(), new RGB( r, g, b ) );
  int index = colors.indexOf( color );
  if ( index < 0 ) {
    colors.add( color );
  } else {
    color.dispose();
    color = colors.get( index );
  }
  return color;
}
 
Example 5
Source File: GUIResource.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public static GUIResource getInstance() {
  if ( guiResource != null ) {
    return guiResource;
  }
  guiResource = new GUIResource( PropsUI.getDisplay() );
  return guiResource;
}