org.eclipse.swt.widgets.Button.getForeground()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(138)

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

Button.getForeground介绍

暂无

代码示例

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void handleEvent(Event event){
    if(encryptToggle.getSelection()){
      Messages.setLanguageText(encryptToggle,"SpeedTestWizard.test.panel.encrypted");
      originalColor = encryptToggle.getForeground();
      //Color highlightColor = ColorCache.getColor(display,178,78,127);
      Color highlightColor = Colors.getSystemColor(display, SWT.COLOR_DARK_YELLOW);
      encryptToggle.setBackground(highlightColor);
    }else{
      Messages.setLanguageText(encryptToggle,"SpeedTestWizard.test.panel.standard");
      if(originalColor!=null){
        encryptToggle.setBackground(originalColor);
      }
    }
  }//handleEvent
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.tips.ui

private void paintButton(GC gc, Composite providerButton, TipProvider provider) {
  gc.setAdvanced(true);
  if (!gc.getAdvanced()) {
    throw new RuntimeException(Messages.Slider_13);
  }
  if (provider.equals(fSelectedProvider)) {
    gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT));
    gc.setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION));
    gc.drawRectangle(0, 0, fIconSize + 3, fIconSize + 3);
  } else {
    gc.setForeground(fLeftButton.getForeground());
    gc.setBackground(fLeftButton.getBackground());
    boolean mouseIn = getDisplay().getCursorControl() == providerButton;
    if (mouseIn) {
      gc.drawRectangle(0, 0, fIconSize + 3, fIconSize + 3);
    } else {
      gc.setBackground(fScroller.getBackground());
    }
  }
  gc.fillRectangle(2, 2, fIconSize, fIconSize);
  Image overlay = getUnreadOverlay(providerButton, provider);
  gc.drawImage(overlay, 2, 2);
  if (overlay != getProviderImage(provider, selectProviderImage(provider))) {
    overlay.dispose();
  }
}

相关文章

Button类方法