Esempio n. 1
0
 protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
   Graphics2D g2D = (Graphics2D) g;
   Object savedRenderingHint = null;
   if (AbstractLookAndFeel.getTheme().isTextAntiAliasingOn()) {
     savedRenderingHint = g2D.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
     g2D.setRenderingHint(
         RenderingHints.KEY_TEXT_ANTIALIASING,
         AbstractLookAndFeel.getTheme().getTextAntiAliasingHint());
   }
   if (menuItem.isSelected() && menuItem.isArmed()) {
     g.setColor(AbstractLookAndFeel.getMenuSelectionForegroundColor());
   } else {
     g.setColor(AbstractLookAndFeel.getMenuForegroundColor());
   }
   super.paintText(g, menuItem, textRect, text);
   if (AbstractLookAndFeel.getTheme().isTextAntiAliasingOn()) {
     g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, savedRenderingHint);
   }
 }
Esempio n. 2
0
 public void uninstallUI(JComponent c) {
   c.setOpaque(true);
   super.uninstallUI(c);
 }
Esempio n. 3
0
 public void installUI(JComponent c) {
   super.installUI(c);
   c.setOpaque(false);
 }