propertybeaneditor.java
来自「openmap java写的开源数字地图程序. 用applet实现,可以像g」· Java 代码 · 共 69 行
JAVA
69 行
/* ********************************************************************** * * Use, duplication, or disclosure by the Government is subject to * restricted rights as set forth in the DFARS. * * BBNT Solutions LLC * A Part of * Verizon * 10 Moulton Street * Cambridge, MA 02138 * (617) 873-3000 * * Copyright (C) 2002 by BBNT Solutions, LLC * All Rights Reserved. * ********************************************************************** */package com.bbn.openmap.tools.beanbox;import java.awt.*;import java.beans.*;/** Custom property editor for a bean property that is itself a bean. */public class PropertyBeanEditor extends PropertyEditorSupport { private GenericPropertySheet propSheet; /** * returns true; */ public boolean isPaintable() { return true; } /** * represents the face of the custom property editor as a * rectangular box containing the text "Click to Edit". */ public void paintValue(Graphics g, Rectangle box) { Color oldColor = g.getColor(); Font oldFont = g.getFont(); g.setColor(Color.blue); g.setFont(new Font(oldFont.getFontName(), Font.BOLD, oldFont.getSize())); g.drawRect(box.x - 1, box.y + 1, box.width - 2, box.height - 2); g.setColor(Color.white); g.drawString("Click to Edit", box.x + 10, box.y + box.height / 2 + 4); g.setFont(oldFont); g.setColor(oldColor); } /** * returns true. */ public boolean supportsCustomEditor() { return true; } /** * returns an instance of the * {@link com.bbn.openmap.tools.beanbox.GenericPropertySheet} * which serves as the custom editor component for the bean * property associated with this editor. */ public Component getCustomEditor() { if (propSheet == null) propSheet = new GenericPropertySheet(getValue(), 575, 20, this, null); return propSheet; }};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?