Java 类javax.swing.plaf.basic.BasicMenuItemUI 实例源码

项目:intellij-ce-playground    文件:GtkPaintingUtil.java   
public static void paintDisabledText(final BasicMenuItemUI originalUI,
                                     final Graphics g,
                                     final JMenuItem menuItem,
                                     final Rectangle textRect,
                                     final String text) {
  final FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g);
  final int index = menuItem.getDisplayedMnemonicIndex();

  final Color fg = getForeground(originalUI, menuItem);
  final Color shadow = UIUtil.shade(menuItem.getBackground(), 1.24, 0.5);

  g.setColor(shadow);
  SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, index, textRect.x + 1, textRect.y + fm.getAscent() + 1);
  g.setColor(fg);
  SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, index, textRect.x, textRect.y + fm.getAscent());
}
项目:tools-idea    文件:GtkPaintingUtil.java   
public static void paintDisabledText(final BasicMenuItemUI originalUI,
                                     final Graphics g,
                                     final JMenuItem menuItem,
                                     final Rectangle textRect,
                                     final String text) {
  final FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g);
  final int index = menuItem.getDisplayedMnemonicIndex();

  final Color fg = getForeground(originalUI, menuItem);
  final Color shadow = UIUtil.shade(menuItem.getBackground(), 1.24, 0.5);

  g.setColor(shadow);
  SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, index, textRect.x + 1, textRect.y + fm.getAscent() + 1);
  g.setColor(fg);
  SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, index, textRect.x, textRect.y + fm.getAscent());
}
项目:consulo    文件:GtkPaintingUtil.java   
public static void paintDisabledText(final BasicMenuItemUI originalUI,
                                     final Graphics g,
                                     final JMenuItem menuItem,
                                     final Rectangle textRect,
                                     final String text) {
  final FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g);
  final int index = menuItem.getDisplayedMnemonicIndex();

  final Color fg = getForeground(originalUI, menuItem);
  final Color shadow = UIUtil.shade(menuItem.getBackground(), 1.24, 0.5);

  g.setColor(shadow);
  SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, index, textRect.x + 1, textRect.y + fm.getAscent() + 1);
  g.setColor(fg);
  SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, index, textRect.x, textRect.y + fm.getAscent());
}
项目:intellij-ce-playground    文件:GtkMenuItemUI.java   
private static Icon getCheckIconFromContext(final BasicMenuItemUI originalUI, final JCheckBoxMenuItem item) {
  if (myCachedCheckIcon == null) {
    final SynthContext context = GtkPaintingUtil.getSynthContext(originalUI, item);
    myCachedCheckIcon = context.getStyle().getIcon(context, "CheckBoxMenuItem.checkIcon");
  }
  return myCachedCheckIcon;
}
项目:tools-idea    文件:GtkMenuItemUI.java   
private static Icon getCheckIconFromContext(final BasicMenuItemUI originalUI, final JCheckBoxMenuItem item) {
  if (myCachedCheckIcon == null) {
    final SynthContext context = GtkPaintingUtil.getSynthContext(originalUI, item);
    myCachedCheckIcon = context.getStyle().getIcon(context, "CheckBoxMenuItem.checkIcon");
  }
  return myCachedCheckIcon;
}
项目:consulo    文件:GtkMenuItemUI.java   
private static Icon getCheckIconFromContext(final BasicMenuItemUI originalUI, final JCheckBoxMenuItem item) {
  if (myCachedCheckIcon == null) {
    final SynthContext context = GtkPaintingUtil.getSynthContext(originalUI, item);
    myCachedCheckIcon = context.getStyle().getIcon(context, "CheckBoxMenuItem.checkIcon");
  }
  return myCachedCheckIcon;
}
项目:intellij-ce-playground    文件:GtkPaintingUtil.java   
public static Color getForeground(final BasicMenuItemUI ui, final JMenuItem menuItem) {
  final SynthContext context = getSynthContext(ui, menuItem);
  return context.getStyle().getColor(context, ColorType.TEXT_FOREGROUND);
}
项目:intellij-ce-playground    文件:GtkMenuItemUI.java   
public static boolean isUiAcceptable(final MenuItemUI ui) {
  return ui instanceof BasicMenuItemUI && GtkPaintingUtil.isSynthUI(ui);
}
项目:tools-idea    文件:GtkPaintingUtil.java   
public static Color getForeground(final BasicMenuItemUI ui, final JMenuItem menuItem) {
  final SynthContext context = getSynthContext(ui, menuItem);
  return context.getStyle().getColor(context, ColorType.TEXT_FOREGROUND);
}
项目:tools-idea    文件:GtkMenuItemUI.java   
public static boolean isUiAcceptable(final MenuItemUI ui) {
  return ui instanceof BasicMenuItemUI && GtkPaintingUtil.isSynthUI(ui);
}
项目:consulo    文件:GtkPaintingUtil.java   
public static Color getForeground(final BasicMenuItemUI ui, final JMenuItem menuItem) {
  final SynthContext context = getSynthContext(ui, menuItem);
  return context.getStyle().getColor(context, ColorType.TEXT_FOREGROUND);
}
项目:consulo    文件:GtkMenuItemUI.java   
public static boolean isUiAcceptable(final MenuItemUI ui) {
  return ui instanceof BasicMenuItemUI && GtkPaintingUtil.isSynthUI(ui);
}