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

x33g5p2x  于2022-01-18 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(148)

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

Composite.setForegroundColor介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  for (int i = 0; i < itemCount; i++) {
    items[i].setForegroundColor (color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  for (int i = 0; i < itemCount; i++) {
    items[i].setForegroundColor (color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  for (int i = 0; i < itemCount; i++) {
    items[i].setForegroundColor (color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  ToolItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    items[i].setForegroundColor (color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  ToolItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    items[i].setForegroundColor (color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  TabItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    if (items[i] != null) {
      items[i].setForegroundColor (color);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  TabItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    if (items[i] != null) {
      items[i].setForegroundColor (color);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  ToolItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    items[i].setForegroundColor (color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setForegroundColor (GdkColor color) {
  super.setForegroundColor (color);
  TabItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    if (items[i] != null) {
      items[i].setForegroundColor (color);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setForegroundColor (long /*int*/ handle, GdkRGBA rgba) {
  /* For CSS foreground colors (GTK3.16+) we need to make sure the default
   * background color stays set if no background color is specified. If no
   * background color has been set, set cssBackground to be COLOR_WIDGET_BACKGROUND.
   */
  if (cssBackground == null) {
    GdkRGBA defaultBackground = display.toGdkRGBA (display.COLOR_WIDGET_BACKGROUND);
    cssBackground = "SwtFixed {background-color: " +
        display.gtk_rgba_to_css_string(defaultBackground) + ";}";
  }
  super.setForegroundColor (handle, rgba);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setForegroundColor (int /*long*/ handle, GdkRGBA rgba) {
  /* For CSS foreground colors (GTK3.16+) we need to make sure the default
   * background color stays set if no background color is specified. If no
   * background color has been set, set cssBackground to be COLOR_WIDGET_BACKGROUND.
   */
  if (cssBackground == null) {
    GdkRGBA defaultBackground = display.toGdkRGBA (display.COLOR_WIDGET_BACKGROUND);
    cssBackground = "SwtFixed {background-color: " +
        display.gtk_rgba_to_css_string(defaultBackground) + ";}";
  }
  super.setForegroundColor (handle, rgba);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setForegroundColor (int /*long*/ handle, GdkRGBA rgba) {
  /* For CSS foreground colors (GTK3.16+) we need to make sure the default
   * background color stays set if no background color is specified. If no
   * background color has been set, set cssBackground to be COLOR_WIDGET_BACKGROUND.
   */
  if (cssBackground == null) {
    GdkRGBA defaultBackground = display.toGdkRGBA (display.COLOR_WIDGET_BACKGROUND);
    cssBackground = "SwtFixed {background-color: " +
        display.gtk_rgba_to_css_string(defaultBackground) + ";}";
  }
  super.setForegroundColor (handle, rgba);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setForegroundColor (GdkColor color) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    GdkRGBA rgba = null;
    if (color != null) {
      rgba = display.toGdkRGBA (color);
    }
    /*
     * When using CSS, setting the foreground color on an empty label
     * widget prevents the background from being set. If a user wants
     * to specify a foreground color before the text is set, store the
     * color and wait until text is specified to apply it.
     */
    if (text.isEmpty()) {
      foreground = rgba;
    } else {
      setForegroundColor (labelHandle, rgba);
      foreground = rgba;
    }
  } else {
    super.setForegroundColor (color);
    setForegroundColor(labelHandle, color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setForegroundColor (GdkColor color) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    GdkRGBA rgba = null;
    if (color != null) {
      rgba = display.toGdkRGBA (color);
    }
    /*
     * When using CSS, setting the foreground color on an empty label
     * widget prevents the background from being set. If a user wants
     * to specify a foreground color before the text is set, store the
     * color and wait until text is specified to apply it.
     */
    if (text.isEmpty()) {
      foreground = rgba;
    } else {
      setForegroundColor (labelHandle, rgba);
      foreground = rgba;
    }
  } else {
    super.setForegroundColor (color);
    setForegroundColor(labelHandle, color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setForegroundColor (GdkColor color) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    GdkRGBA rgba = null;
    if (color != null) {
      rgba = display.toGdkRGBA (color);
    }
    /*
     * When using CSS, setting the foreground color on an empty label
     * widget prevents the background from being set. If a user wants
     * to specify a foreground color before the text is set, store the
     * color and wait until text is specified to apply it.
     */
    if (text.isEmpty()) {
      foreground = rgba;
    } else {
      setForegroundColor (labelHandle, rgba);
      foreground = rgba;
    }
  } else {
    super.setForegroundColor (color);
    setForegroundColor(labelHandle, color);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@Override
void setForegroundColor (GdkColor color) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    GdkRGBA rgba = null;
    if (color != null) {
      rgba = display.toGdkRGBA (color);
    }
    if (entryHandle != 0) {
      setForegroundColor (entryHandle, rgba);
    }
    OS.g_object_set (textRenderer, OS.foreground_rgba, rgba, 0);
  } else {
    super.setForegroundColor (handle, color, false);
    if (entryHandle != 0) {
      setForegroundColor (entryHandle, color, false);
    }
    if (OS.GTK3) {
      GdkRGBA rgba = null;
      if (color != null) {
        rgba = display.toGdkRGBA (color);
      }
      OS.g_object_set (textRenderer, OS.foreground_rgba, rgba, 0);
    } else  {
      OS.g_object_set (textRenderer, OS.foreground_gdk, color, 0);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@Override
void setForegroundColor (GdkColor color) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    GdkRGBA rgba = null;
    if (color != null) {
      rgba = display.toGdkRGBA (color);
    }
    if (entryHandle != 0) {
      setForegroundColor (entryHandle, rgba);
    }
    OS.g_object_set (textRenderer, OS.foreground_rgba, rgba, 0);
  } else {
    super.setForegroundColor (handle, color, false);
    if (entryHandle != 0) {
      setForegroundColor (entryHandle, color, false);
    }
    if (OS.GTK3) {
      GdkRGBA rgba = null;
      if (color != null) {
        rgba = display.toGdkRGBA (color);
      }
      OS.g_object_set (textRenderer, OS.foreground_rgba, rgba, 0);
    } else  {
      OS.g_object_set (textRenderer, OS.foreground_gdk, color, 0);
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@Override
void setForegroundColor (GdkColor color) {
  if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
    GdkRGBA rgba = null;
    if (color != null) {
      rgba = display.toGdkRGBA (color);
    }
    if (entryHandle != 0) {
      setForegroundColor (entryHandle, rgba);
    }
    OS.g_object_set (textRenderer, OS.foreground_rgba, rgba, 0);
  } else {
    super.setForegroundColor (handle, color, false);
    if (entryHandle != 0) {
      setForegroundColor (entryHandle, color, false);
    }
    if (OS.GTK3) {
      GdkRGBA rgba = null;
      if (color != null) {
        rgba = display.toGdkRGBA (color);
      }
      OS.g_object_set (textRenderer, OS.foreground_rgba, rgba, 0);
    } else  {
      OS.g_object_set (textRenderer, OS.foreground_gdk, color, 0);
    }
  }
}

相关文章

Composite类方法