⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nimrodradiobuttonmenuitemui.java

📁 一个java漂亮外观的源码
💻 JAVA
字号:
/*
 *                 (C) Copyright 2005 Nilo J. Gonzalez
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser Gereral Public Licence as published by the Free
 * Software Foundation; either version 2 of the Licence, or (at your opinion) any
 * later version.
 * 
 * This library is distributed in the hope that it will be usefull, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of merchantability or fitness for a
 * particular purpose. See the GNU Lesser General Public Licence for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public Licence along
 * with this library; if not, write to the Free Software Foundation, Inc., 59
 * Temple Place, Suite 330, Boston, Ma 02111-1307 USA.
 *
 * http://www.gnu.org/licenses/lgpl.html (English)
 * http://gugs.sindominio.net/gnu-gpl/lgpl-es.html (Espa駉l)
 *
 *
 * Original author: Nilo J. Gonz醠ez
 */

/**
 * Esta clase implementa los RadioButtons dentro de los menus desplegables.
 * En realidad lo unico que hace es pintar el fondo, que pinta liso o como una barra de color
 * segun este seleccionado o no. Los iconos se han cargado ya en los defaults al cargar
 * el LookAndFeel en la clase NimRODLookAndFeel 
 * @author Nilo J. Gonzalez
 */

package com.nilo.plaf.nimrod;

import java.awt.*;
import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.*;

public class NimRODRadioButtonMenuItemUI extends BasicRadioButtonMenuItemUI {
  public static ComponentUI createUI( JComponent x) {
    return new NimRODRadioButtonMenuItemUI();
  }
  
  protected void installDefaults() {
    super.installDefaults();
    
    menuItem.setBorderPainted( false);
    menuItem.setOpaque( false);
  }
  
  protected void uninstallDefaults() {
    super.uninstallDefaults();
    
    menuItem.setOpaque( true);
  }
  
  protected void paintBackground( Graphics g, JMenuItem menuItem, Color bgColor) {
    NimRODUtils.pintaBarraMenu( g, menuItem, bgColor);
  }

	/*
  protected void paintText( Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
    ButtonModel model = menuItem.getModel();
    if( !model.isEnabled() ) {
      super.paintText( g, menuItem, textRect, text);
    }
    else {
      FontMetrics fm = menuItem.getFontMetrics( g.getFont());
      NimRODLookAndFeel.paintShadowTitleThin( g, text, 
                                              textRect.x, textRect.y + fm.getAscent(),
                                              Color.black, Color.white, 0);
    }
  }
  */
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -