?? nimrodradiobuttonui.java
字號(hào):
/* * (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. * En realidad lo unico que hace es asociar los iconos que se usaran en cada estado, y el trabajo * duro lo hace la clase NimRODIconFactory. * @author Nilo J. Gonzalez */ package com.nilo.plaf.nimrod;import java.awt.event.MouseEvent;import javax.swing.*;import javax.swing.event.MouseInputAdapter;import javax.swing.plaf.*;import javax.swing.plaf.metal.*;public class NimRODRadioButtonUI extends MetalRadioButtonUI { protected MiML miml; private final static NimRODRadioButtonUI radioButtonUI = new NimRODRadioButtonUI(); public void installDefaults( AbstractButton b) { super.installDefaults( b); icon = NimRODIconFactory.getRadioButtonIcon(); } public void uninstallDefaults( AbstractButton b) { super.uninstallDefaults( b); icon = MetalIconFactory.getRadioButtonIcon(); } public void installListeners( AbstractButton b) { super.installListeners( b); miml = new MiML( b); b.addMouseListener( miml); } public static ComponentUI createUI( JComponent c) { return radioButtonUI; ///////////////////////////////////// public class MiML extends MouseInputAdapter { private AbstractButton papi; MiML( AbstractButton b) { papi = b; } public void mouseEntered( MouseEvent e) { papi.getModel().setRollover( true); } public void mouseExited( MouseEvent e) { papi.getModel().setRollover( false); papi.repaint(); } } }
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -