protected void installDefaults() {
   super.installDefaults();
   Integer integer = UIUtil.getPropertyMaxGutterIconWidth(getPropertyPrefix());
   if (integer != null) {
     myMaxGutterIconWidth = integer.intValue();
   }
 }
Пример #2
0
 @Override
 protected void uninstallListeners() {
   super.uninstallListeners();
   if (this.mouseRolloverListener != null) {
     this.menuItem.removeMouseListener(this.mouseRolloverListener);
     this.mouseRolloverListener = null;
   }
 }
Пример #3
0
  public void paint(Graphics g, JComponent comp) {
    // paint to the buffered image
    comp.setForeground(UIHelper.DARK_GREEN_COLOR);
    comp.setBackground(UIHelper.BG_COLOR);
    comp.setFont(UIHelper.VER_12_BOLD);

    super.paint(g, comp);
    // do an alpha composite

  }
Пример #4
0
  /**
   * Paints the given component.
   *
   * @param g The graphics context to use.
   * @param c The component to paint.
   */
  public void paint(Graphics g, JComponent c) {
    super.paint(g, c);
    // Container parent = menuItem.getParent();

    // Paint the horizontal highlight gradient:
    // MetouiaGradients.drawHighlight(
    //  g, new Rectangle(0, -1, parent.getWidth(), parent.getHeight() / 2),
    //  true, true);

    // Paint the horizontal shadow gradient:
    // MetouiaGradients.drawShadow(
    //  g,
    //  new Rectangle(
    //    0, parent.getHeight() / 2 - 1,
    //    parent.getWidth(), parent.getHeight() / 2),
    //  true, false);
  }
Пример #5
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);
   }
 }
Пример #6
0
 public void uninstallUI(JComponent c) {
   c.setOpaque(true);
   super.uninstallUI(c);
 }
Пример #7
0
 public void installUI(JComponent c) {
   super.installUI(c);
   c.setOpaque(false);
 }
Пример #8
0
 @Override
 protected void installDefaults() {
   super.installDefaults();
 }
Пример #9
0
 @Override
 protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
   super.paintText(g, menuItem, textRect, text);
 }
Пример #10
0
 @Override
 protected void installListeners() {
   super.installListeners();
   this.mouseRolloverListener = new MenuMouseHandler();
   this.menuItem.addMouseListener(this.mouseRolloverListener);
 }
Пример #11
0
 @Override
 public void uninstallUI(JComponent c) {
   super.uninstallUI(c);
 }
Пример #12
0
 @Override
 public void installUI(JComponent c) {
   super.installUI(c);
   this.menuItem.setRolloverEnabled(true);
 }