org.eclipse.swt.graphics.Font.dispose()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.eclipse.swt.graphics.Font.dispose()方法的一些代码示例,展示了Font.dispose()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Font.dispose()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Font
类名称:Font
方法名:dispose

Font.dispose介绍

暂无

代码示例

代码示例来源:origin: caoxinyu/RedisClient

/**
 * Dispose all of the cached {@link Font}'s.
 */
public static void disposeFonts() {
  // clear fonts
  for (Font font : m_fontMap.values()) {
    font.dispose();
  }
  m_fontMap.clear();
  // clear bold fonts
  for (Font font : m_fontToBoldFontMap.values()) {
    font.dispose();
  }
  m_fontToBoldFontMap.clear();
}
////////////////////////////////////////////////////////////////////////////

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * Free the managed resource if it hasn't already been done and if this is not a system font
 *
 */
public void dispose() {
 // System color and already disposed off colors don't need to be disposed!
 if ( !systemFont && !font.isDisposed() ) {
  font.dispose();
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
 public void widgetDisposed( DisposeEvent e ) {
  if ( clipboard != null ) {
   clipboard.dispose();
   clipboard = null;
  }
  if ( gridFont != null ) {
   gridFont.dispose();
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

public void dispose() {
 fixedFont.dispose();
 graphFont.dispose();
 noteFont.dispose();
 background.dispose();
 graphColor.dispose();
 tabColor.dispose();
 shell.dispose();
}

代码示例来源:origin: pentaho/pentaho-kettle

public void widgetDisposed( DisposeEvent arg0 ) {
  kettle_image.dispose();
  kettle_icon.dispose();
  exclamation_image.dispose();
  verFont.dispose();
  licFont.dispose();
  devWarningFont.dispose();
  versionWarningForegroundColor.dispose();
  versionWarningBackgroundColor.dispose();
 }
} );

代码示例来源: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: 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: 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 dispose() {
 gc.dispose();
 if ( transform != null && transform.isDisposed() == false ) {
  transform.dispose();
 }
 for ( Color color : colors ) {
  color.dispose();
 }
 for ( Font font : fonts ) {
  font.dispose();
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

public void dispose() {
 gc.dispose();
 if ( transform != null && transform.isDisposed() == false ) {
  transform.dispose();
 }
 for ( Color color : colors ) {
  color.dispose();
 }
 for ( Font font : fonts ) {
  font.dispose();
 }
}

代码示例来源: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

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[] { noteFontData } );
  FontData newfd = fd.open();
  if ( newfd != null ) {
   noteFontData = newfd;
   noteFont.dispose();
   noteFont = new Font( display, noteFontData );
   wNFont.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

public void dispose() {
 props.setScreen( new WindowProperty( shell ) );
 fontColor.dispose();
 bgColor.dispose();
 borderColor.dispose();
 if ( font != null && !font.isDisposed() ) {
  font.dispose();
 }
 shell.dispose();
}

代码示例来源:origin: pentaho/pentaho-kettle

licFontSize--;
if ( licFont != null ) {
 licFont.dispose();

代码示例来源: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: stackoverflow.com

Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
Label label = new Label(shell, SWT.NONE);
label.setText("I am italic");
FontData fontData = label.getFont().getFontData()[0];
Font font = new Font(display, new FontData(fontData.getName(), fontData
  .getHeight(), SWT.ITALIC));
label.setFont(font);
shell.open();
while (!shell.isDisposed()) {
 if (!display.readAndDispatch())
  display.sleep();
}
font.dispose();
display.dispose();

相关文章