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);
 }