📄 propertysheetbutton.java
字号:
/*
* 08/10/2005
*
* PropertySheetButton.java - Base button class for all buttons used by editors
* and renderers in a property sheet.
* Copyright (C) 2005 Robert Futrell
* email@address.com
* www.website.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.fife.ui.propertysheet;
import java.awt.Font;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.plaf.ButtonUI;
/**
* Base button class for all buttons used by editors and renderers in a
* property sheet.
*
* @author Robert Futrell
* @version 1.0
*/
public class PropertySheetButton extends JButton {
/**
*
*/
private static final long serialVersionUID = 2508092444689488815L;
private static final Border BORDER = BorderFactory.
createEmptyBorder(2,2,2,2);
/*****************************************************************************/
/**
* Constructor.
*/
public PropertySheetButton() {
setBorder(BORDER);
setHorizontalAlignment(SwingConstants.LEFT);
setBackground(PropertySheetUtilities.getPropertyColor());
}
/*****************************************************************************/
/**
* Overridden so we use the same font as all other property editors and
* renderers. This is because labels use ugly bold fonts in the JRE5.0
* Ocean theme.
*
* @return The font of this button.
*/
public Font getFont() {
return UIManager.getFont("TextField.font");
}
/*****************************************************************************/
/**
* Overridden so that we always use our special UI.
*
* @param ui This parameter is ignored.
*/
public void setUI(ButtonUI ui) {
super.setUI(new EditorRendererButtonUI());
}
/*****************************************************************************/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -