亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? propertysheetutilities.java

?? 具有不同語法高亮的編輯器實例
?? JAVA
字號:
/*
 * 03/30/2005
 *
 * PropertySheetUtilities.java - Utilities used by the Property Sheet classes.
 * 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.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import javax.swing.BorderFactory;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JTextField;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import javax.swing.table.TableCellEditor;


/**
 * Utility methods for use by property sheet classes.
 *
 * @author Robert Futrell
 * @version 0.1
 */
public class PropertySheetUtilities {

	private static Color cachedPanelBackground;
	private static Color borderColor;

	private static final Color PROPERTY_COLOR		= Color.WHITE;
	private static final String PROPERTY_PREFIX		= "Property.";

	private static final FocusAdapter textFieldFocusListener =
									new TextFieldFocusListener();


/*****************************************************************************/


	/**
	 * Creates a checkbox for use by a property sheet.
	 *
	 * @return A checkbox.
	 */
	public static JCheckBox createCheckBox() {
		JCheckBox checkBox = new JCheckBox();
		checkBox.setBackground(PropertySheetUtilities.getPropertyColor());
		//checkBox.setBorder(BorderFactory.createEmptyBorder());
		checkBox.setBorderPaintedFlat(true);
		return checkBox;
	}


/*****************************************************************************/


	/**
	 * Creates a combo box for use by a property sheet.
	 *
	 * @return A combo box.
	 */
	/*
	 * FIXME: We've hardcoded STRING_CHOICE_PROPERTY, but we may want to pass
	 * it in here so if other property types use this editor it'll be done
	 * for them too.
	 */
	public static JComboBox createComboBox() {
		final JComboBox combo = new JComboBox() {
			protected void processFocusEvent(FocusEvent e) {
				if (e.getID()==FocusEvent.FOCUS_LOST) {
					TableCellEditor editor =
						PropertySheetManager.getInstance().getEditor(
											String[].class);
					editor.cancelCellEditing();
				}
				super.processFocusEvent(e);
			}
		};
		// The label painted for the value for uneditable combo boxes takes
		// its background color from the combo box's background color.
		PropertySheetUtilities.setBorderAndBackground(combo);
		return combo;
	}


/*****************************************************************************/


	/**
	 * Creates a text field for use by a property sheet.
	 *
	 * @return The text field.
	 */
	public static JTextField createTextField() {
		JTextField field = new JTextField();
		field.addFocusListener(textFieldFocusListener);
		PropertySheetUtilities.setBorderAndBackground(field);
		return field;
	}


/*****************************************************************************/


	/**
	 * Returns the color to use for the borders of the property sheet.
	 *
	 * @return The border color.
	 */
	public static Color getBorderColor() {
		// Check in case user changes L&F, otherwise use cached value.
		Color c = UIManager.getColor("Panel.background");
		if (!c.equals(cachedPanelBackground)) {
			cachedPanelBackground = c;
			borderColor = new Color(c.getRed()-20,
								c.getGreen()-20, c.getBlue()-20);
		}
		return borderColor;
	}


/*****************************************************************************/


	/**
	 * Returns the color to use for the edges of borders of the property sheet.
	 *
	 * @return The border edge color.
	 */
	public static Color getBorderEdgeColor() {
		return getBorderColor().darker();
	}


/*****************************************************************************/


	/**
	 * Returns a "default" value for a given type (NOTE:  Is there a better
	 * way to do this?
	 *
	 * @param type The type.
	 * @return The default value.  Primitives are wrapped in their respective
	 *         wrapper classes.
	 */
	public static Object getDefaultValueForType(Class type) {
		if (type.equals(int.class)) {
			return new Integer(0);
		}
		else if (type.equals(boolean.class)) {
			return Boolean.TRUE;
		}
		else if (type.equals(float.class)) {
			return new Float(3.4f);
		}
		else if (type.equals(double.class)) {
			return new Double(69.7);
		}
		else if (type.equals(long.class)) {
			return new Long(300l);
		}
		else if (type.equals(short.class)) {
			return new Short((short)3);
		}
		else if (type.equals(String.class)) {
			return "Hello world";
		}
		else if (type.equals(Color.class)) {
			return Color.MAGENTA;
		}
		return null;
	}


/*****************************************************************************/


	/**
	 * Returns a string representing a <code>Dimension</code>.
	 *
	 * @param dim The dimension.
	 * @return The string.
	 */
	public static String getDimensionString(Dimension dim) {
		return "(" + dim.width + ", " + dim.height + ")";
	}


/*****************************************************************************/


	/**
	 * Returns a string representing an <code>Insets</code>.
	 *
	 * @param insets The insets.
	 * @return The string.
	 */
	public static String getInsetsString(final Insets insets) {
		return "[" + insets.top + ", " + insets.left+ ", " +
				insets.bottom + ", " + insets.right+ "]";
	}


/*****************************************************************************/


	/**
	 * Returns the property sheet that owns the specified component.
	 *
	 * @param comp The component.
	 * @return The property sheet.
	 */
	public static PropertySheet getParentPropertySheet(Component comp) {
		Container parent = comp.getParent();
		while (parent!=null && !(parent instanceof PropertySheet))
			parent = parent.getParent();
		// Could be null non-PropertySheet (but shouldn't be).
		if (parent instanceof PropertySheet)
			return (PropertySheet)parent;
		return null;
	}


/*****************************************************************************/


	/**
	 * Returns the color to use as the background for property names and
	 * editors.
	 *
	 * @return The background color.
	 */
	public static final Color getPropertyColor() {
		return PROPERTY_COLOR;
	}


/*****************************************************************************/


	/**
	 * Returns a string that is the prefix for any property modified in this
	 * property sheet.  A property change listener can then distinguish
	 * between properties being modified that are editable in this property
	 * sheet, and properties of the property sheet itself (and its components)
	 * changing.
	 */
	public static final String getPropertyPrefix() {
		return PROPERTY_PREFIX;
	}


/*****************************************************************************/


	/**
	 * Returns a string representing a <code>Rectangle</code>.
	 *
	 * @param r The rectangle.
	 * @return The string.
	 */
	public static String getRectangleString(final Rectangle r) {
		if (r==null)
			return "<null>";
		return "[" + r.x + ", " + r.y + ", " +
				r.width + ", " + r.height + "]";
	}


/*****************************************************************************/


	private static final void setBorderAndBackground(JComponent comp) {
		comp.setBorder(BorderFactory.createEmptyBorder());
		comp.setBackground(PropertySheetUtilities.getPropertyColor());
	}


/*****************************************************************************/
/********************* INNER CLASSES *****************************************/
/*****************************************************************************/


	/**
	 * Listens for a text field receiving focus and selects its text.
	 */
	static class TextFieldFocusListener extends FocusAdapter {

		public void focusGained(FocusEvent e) {
			JTextField tf = (JTextField)e.getSource();
			tf.setCaretPosition(0);
			tf.moveCaretPosition(tf.getDocument().getLength());
		}

	}


/*****************************************************************************/

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
综合色天天鬼久久鬼色| 久久网站最新地址| 国产高清亚洲一区| 韩国精品主播一区二区在线观看 | 久久99精品久久久| 视频一区二区国产| 日韩av高清在线观看| 亚洲成年人影院| 亚洲国产欧美一区二区三区丁香婷| 亚洲丝袜精品丝袜在线| 亚洲日本成人在线观看| 亚洲人成伊人成综合网小说| 亚洲女性喷水在线观看一区| 亚洲一区二区三区四区在线观看 | 日韩一区二区在线看片| 欧美一级理论片| www国产精品av| 欧美国产综合色视频| 国产精品久久久久毛片软件| 亚洲精品videosex极品| 视频在线在亚洲| 韩国欧美国产一区| 99热精品国产| 91精品国产乱| 亚洲国产成人午夜在线一区| 亚洲精品成人悠悠色影视| 日日夜夜一区二区| 国产最新精品免费| 91视频国产资源| 日韩一区二区三区视频在线观看| 26uuu国产电影一区二区| 中文字幕日韩精品一区| 午夜精品免费在线| 免费看日韩a级影片| 丁香网亚洲国际| 欧美日韩国产美| 日本一区二区三区国色天香| 亚洲制服丝袜在线| 国产一区二区精品久久| 色综合激情五月| 2021久久国产精品不只是精品| 国产精品高潮呻吟| 日本成人中文字幕在线视频| 成人高清伦理免费影院在线观看| 欧美高清视频不卡网| 国产精品视频你懂的| 美女在线观看视频一区二区| 91国偷自产一区二区三区成为亚洲经典| 欧美一区二区三区视频在线观看| 中文字幕精品一区二区精品绿巨人| 日韩国产在线一| 97se狠狠狠综合亚洲狠狠| 欧美电影免费观看完整版| 伊人婷婷欧美激情| 成人av在线一区二区三区| 日韩一区二区免费在线观看| 亚洲一区二区视频在线观看| 成人av先锋影音| 精品国产91洋老外米糕| 日韩一区精品字幕| av激情综合网| 中文字幕av资源一区| 精品一区中文字幕| 91精品国产综合久久福利软件| 亚洲在线视频网站| 99国内精品久久| 国产精品国产馆在线真实露脸| 国产激情精品久久久第一区二区 | 欧美日韩免费视频| 中文字幕亚洲在| 国产成人夜色高潮福利影视| 精品人在线二区三区| 日本亚洲一区二区| 欧美日韩高清一区二区不卡| 午夜激情综合网| 91精品国产免费| 免费在线观看日韩欧美| 欧美一区二区在线看| 免费av网站大全久久| 91精品国产综合久久婷婷香蕉| 丝袜亚洲另类丝袜在线| 欧美视频在线不卡| 香蕉久久一区二区不卡无毒影院| 欧美午夜电影网| 五月天丁香久久| 欧美成人女星排名| 午夜精品久久久久久久99水蜜桃| 99视频在线精品| 91精彩视频在线| 欧美高清在线精品一区| 麻豆一区二区在线| 精品日本一线二线三线不卡| 国产jizzjizz一区二区| 国产精品女主播av| 91色乱码一区二区三区| 亚洲国产aⅴ天堂久久| 日韩欧美国产综合一区| 国产综合色视频| 国产精品久久国产精麻豆99网站| 91视频国产资源| 日本三级亚洲精品| 久久影音资源网| 91麻豆国产福利精品| 午夜精品视频在线观看| 2021中文字幕一区亚洲| 95精品视频在线| 日韩电影在线免费看| 久久夜色精品一区| 99视频一区二区三区| 日本特黄久久久高潮| 国产丝袜欧美中文另类| 欧美视频你懂的| 国产精一区二区三区| 亚洲欧美精品午睡沙发| 日韩一级片网站| 色综合久久天天| 狂野欧美性猛交blacked| 国产精品你懂的在线| 欧美老肥妇做.爰bbww| 国内国产精品久久| 一区二区三区在线播放| 精品国产伦一区二区三区免费| 99国产精品久| 激情综合网激情| 亚洲成人免费在线观看| 国产日韩欧美综合在线| 欧美日韩一级黄| av在线不卡电影| 韩国女主播一区二区三区| 亚洲高清免费观看 | 国产一区二区三区精品欧美日韩一区二区三区| 中文字幕在线不卡一区 | 国产精品入口麻豆九色| 欧美精三区欧美精三区| 一本大道久久a久久综合婷婷| 国产麻豆视频精品| 日本aⅴ亚洲精品中文乱码| 亚洲一区在线视频| 中文字幕亚洲欧美在线不卡| 国产视频一区在线播放| 精品国产免费久久 | 国产日韩精品久久久| 欧美人牲a欧美精品| 日本道色综合久久| av中文字幕在线不卡| 成人三级伦理片| 国产精品18久久久| 精品一区二区影视| 青青草国产成人99久久| 午夜精品久久久久影视| 午夜精品aaa| 热久久国产精品| 男女性色大片免费观看一区二区 | 久久精品欧美一区二区三区麻豆| 欧美一级日韩不卡播放免费| 日韩一区二区三区四区| 日韩一区二区三区免费看| 7777精品伊人久久久大香线蕉最新版| 欧美色图一区二区三区| 在线免费观看日本一区| 欧美中文字幕一区二区三区| 欧美三级三级三级| 欧美日韩亚洲综合| 制服丝袜av成人在线看| 91精品国产麻豆国产自产在线| 欧美一二三四区在线| 精品国产一区久久| 国产欧美久久久精品影院| 国产女人18水真多18精品一级做 | 欧美日韩和欧美的一区二区| 欧美三级韩国三级日本一级| 欧美一级在线视频| 久久亚洲一区二区三区明星换脸 | 91老司机福利 在线| 在线观看视频一区二区| 欧美理论在线播放| 亚洲精品一区二区三区精华液| 日本一区二区视频在线观看| 亚洲免费观看高清| 爽好多水快深点欧美视频| 国产一区二区三区不卡在线观看| 成人app在线| 91精品免费观看| 欧美激情一区二区| 一区二区三区国产精品| 日韩精品色哟哟| 成人激情黄色小说| 欧美日韩国产一级片| 国产亚洲一二三区| 亚洲电影第三页| 国产精品一区专区| 欧美在线视频不卡| xnxx国产精品| 偷拍日韩校园综合在线| 粉嫩13p一区二区三区| 欧美日韩亚州综合| 日本一区二区在线不卡| 日韩中文字幕区一区有砖一区| 成人毛片视频在线观看| 91精品在线麻豆|