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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? basictextui.java

?? java1.6眾多例子參考
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* * @(#)BasicTextUI.java	1.121 07/12/03 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.plaf.basic;import java.util.*;import java.awt.*;import java.awt.event.*;import java.awt.datatransfer.*;import java.awt.im.InputContext;import java.beans.*;import java.io.*;import javax.swing.*;import javax.swing.plaf.*;import javax.swing.text.*;import javax.swing.event.*;import javax.swing.border.Border;import javax.swing.plaf.UIResource;import sun.swing.DefaultLookup;import sun.awt.AppContext;import javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag;/** * <p> * Basis of a text components look-and-feel.  This provides the * basic editor view and controller services that may be useful * when creating a look-and-feel for an extension of * <code>JTextComponent</code>. * <p> * Most state is held in the associated <code>JTextComponent</code> * as bound properties, and the UI installs default values for the  * various properties.  This default will install something for * all of the properties.  Typically, a LAF implementation will * do more however.  At a minimum, a LAF would generally install * key bindings. * <p> * This class also provides some concurrency support if the  * <code>Document</code> associated with the JTextComponent is a subclass of * <code>AbstractDocument</code>.  Access to the View (or View hierarchy) is * serialized between any thread mutating the model and the Swing * event thread (which is expected to render, do model/view coordinate * translation, etc).  <em>Any access to the root view should first * acquire a read-lock on the AbstractDocument and release that lock * in a finally block.</em> * <p> * An important method to define is the {@link #getPropertyPrefix} method * which is used as the basis of the keys used to fetch defaults * from the UIManager.  The string should reflect the type of  * TextUI (eg. TextField, TextArea, etc) without the particular  * LAF part of the name (eg Metal, Motif, etc). * <p> * To build a view of the model, one of the following strategies  * can be employed. * <ol> * <li> * One strategy is to simply redefine the  * ViewFactory interface in the UI.  By default, this UI itself acts * as the factory for View implementations.  This is useful * for simple factories.  To do this reimplement the  * {@link #create} method. * <li> * A common strategy for creating more complex types of documents * is to have the EditorKit implementation return a factory.  Since * the EditorKit ties all of the pieces necessary to maintain a type * of document, the factory is typically an important part of that * and should be produced by the EditorKit implementation. * </ol> * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing.  As of 1.4, support for long term storage * of all JavaBeans<sup><font size="-2">TM</font></sup> * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @author Timothy Prinzing * @author Shannon Hickey (drag and drop) * @version 1.121 12/03/07 */public abstract class BasicTextUI extends TextUI implements ViewFactory {    /**     * Creates a new UI.     */    public BasicTextUI() {        painted = false;    }    /**     * Creates the object to use for a caret.  By default an     * instance of BasicCaret is created.  This method     * can be redefined to provide something else that implements     * the InputPosition interface or a subclass of JCaret.     *     * @return the caret object     */    protected Caret createCaret() {        return new BasicCaret();    }    /**     * Creates the object to use for adding highlights.  By default     * an instance of BasicHighlighter is created.  This method     * can be redefined to provide something else that implements     * the Highlighter interface or a subclass of DefaultHighlighter.     *     * @return the highlighter     */    protected Highlighter createHighlighter() {        return new BasicHighlighter();    }    /**     * Fetches the name of the keymap that will be installed/used      * by default for this UI. This is implemented to create a     * name based upon the classname.  The name is the the name     * of the class with the package prefix removed.     *     * @return the name     */    protected String getKeymapName() {	String nm = getClass().getName();	int index = nm.lastIndexOf('.');	if (index >= 0) {	    nm = nm.substring(index+1, nm.length());	}	return nm;    }    /**     * Creates the keymap to use for the text component, and installs     * any necessary bindings into it.  By default, the keymap is     * shared between all instances of this type of TextUI. The     * keymap has the name defined by the getKeymapName method.  If the     * keymap is not found, then DEFAULT_KEYMAP from JTextComponent is used.     * <p>     * The set of bindings used to create the keymap is fetched      * from the UIManager using a key formed by combining the     * {@link #getPropertyPrefix} method     * and the string <code>.keyBindings</code>.  The type is expected     * to be <code>JTextComponent.KeyBinding[]</code>.     *     * @return the keymap     * @see #getKeymapName     * @see javax.swing.text.JTextComponent     */    protected Keymap createKeymap() {	String nm = getKeymapName();	Keymap map = JTextComponent.getKeymap(nm);	if (map == null) {	    Keymap parent = JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP);	    map = JTextComponent.addKeymap(nm, parent);	    String prefix = getPropertyPrefix();	    Object o = DefaultLookup.get(editor, this,                prefix + ".keyBindings");	    if ((o != null) && (o instanceof JTextComponent.KeyBinding[])) {		JTextComponent.KeyBinding[] bindings = (JTextComponent.KeyBinding[]) o;		JTextComponent.loadKeymap(map, bindings, getComponent().getActions());	    }	}	return map;    }    /**     * This method gets called when a bound property is changed     * on the associated JTextComponent.  This is a hook     * which UI implementations may change to reflect how the     * UI displays bound properties of JTextComponent subclasses.     * This is implemented to do nothing (i.e. the response to     * properties in JTextComponent itself are handled prior     * to calling this method).     *     * This implementation updates the background of the text     * component if the editable and/or enabled state changes.     *     * @param evt the property change event     */    protected void propertyChange(PropertyChangeEvent evt) {        if (evt.getPropertyName().equals("editable") ||                evt.getPropertyName().equals("enabled")) {                        updateBackground((JTextComponent)evt.getSource());        }    }    /**     * Updates the background of the text component based on whether the     * text component is editable and/or enabled.     *     * @param c the JTextComponent that needs its background color updated     */    private void updateBackground(JTextComponent c) {        // This is a temporary workaround.        // This code does not correctly deal with Synth (Synth doesn't use        // properties like this), nor does it deal with the situation where        // the developer grabs the color from a JLabel and sets it as        // the background for a JTextArea in all look and feels. The problem        // scenario results if the Color obtained for the Label and TextArea        // is ==, which is the case for the windows look and feel.        // Until an appropriate solution is found, the code is being        // reverted to what it was before the original fix.        if (this instanceof sun.swing.plaf.synth.SynthUI ||                (c instanceof JTextArea)) {            return;        }        Color background = c.getBackground();        if (background instanceof UIResource) {            String prefix = getPropertyPrefix();            Color disabledBG =                DefaultLookup.getColor(c, this, prefix + ".disabledBackground", null);            Color inactiveBG =                DefaultLookup.getColor(c, this, prefix + ".inactiveBackground", null);            Color bg =                DefaultLookup.getColor(c, this, prefix + ".background", null);            /* In an ideal situation, the following check would not be necessary             * and we would replace the color any time the previous color was a             * UIResouce. However, it turns out that there is existing code that             * uses the following inadvisable pattern to turn a text area into             * what appears to be a multi-line label:             *             * JLabel label = new JLabel();             * JTextArea area = new JTextArea();             * area.setBackground(label.getBackground());             * area.setEditable(false);             *             * JLabel's default background is a UIResource. As such, just             * checking for UIResource would have us always changing the             * background away from what the developer wanted.             *             * Therefore, for JTextArea/JEditorPane, we'll additionally check             * that the color we're about to replace matches one that was             * installed by us from the UIDefaults.             */            if ((c instanceof JTextArea || c instanceof JEditorPane)                    && background != disabledBG                    && background != inactiveBG                    && background != bg) {                return;            }            Color newColor = null;            if (!c.isEnabled()) {                newColor = disabledBG;            }            if (newColor == null && !c.isEditable()) {                newColor = inactiveBG;            }            if (newColor == null) {                newColor = bg;            }            if (newColor != null && newColor != background) {                c.setBackground(newColor);            }        }    }    /**     * Gets the name used as a key to look up properties through the     * UIManager.  This is used as a prefix to all the standard     * text properties.     *     * @return the name     */    protected abstract String getPropertyPrefix();    /**     * Initializes component properties, e.g. font, foreground,      * background, caret color, selection color, selected text color,     * disabled text color, and border color.  The font, foreground, and     * background properties are only set if their current value is either null     * or a UIResource, other properties are set if the current     * value is null.     *      * @see #uninstallDefaults     * @see #installUI     */    protected void installDefaults()     {        String prefix = getPropertyPrefix();        Font f = editor.getFont();        if ((f == null) || (f instanceof UIResource)) {            editor.setFont(UIManager.getFont(prefix + ".font"));        }        Color bg = editor.getBackground();        if ((bg == null) || (bg instanceof UIResource)) {            editor.setBackground(UIManager.getColor(prefix + ".background"));        }                Color fg = editor.getForeground();        if ((fg == null) || (fg instanceof UIResource)) {            editor.setForeground(UIManager.getColor(prefix + ".foreground"));        }        Color color = editor.getCaretColor();        if ((color == null) || (color instanceof UIResource)) {            editor.setCaretColor(UIManager.getColor(prefix + ".caretForeground"));        }        Color s = editor.getSelectionColor();        if ((s == null) || (s instanceof UIResource)) {            editor.setSelectionColor(UIManager.getColor(prefix + ".selectionBackground"));        }        Color sfg = editor.getSelectedTextColor();        if ((sfg == null) || (sfg instanceof UIResource)) {            editor.setSelectedTextColor(UIManager.getColor(prefix + ".selectionForeground"));        }        Color dfg = editor.getDisabledTextColor();        if ((dfg == null) || (dfg instanceof UIResource)) {            editor.setDisabledTextColor(UIManager.getColor(prefix + ".inactiveForeground"));        }        Border b = editor.getBorder();        if ((b == null) || (b instanceof UIResource)) {            editor.setBorder(UIManager.getBorder(prefix + ".border"));        }        Insets margin = editor.getMargin();        if (margin == null || margin instanceof UIResource) {            editor.setMargin(UIManager.getInsets(prefix + ".margin"));        }        updateCursor();    }    private void installDefaults2() {	editor.addMouseListener(dragListener);	editor.addMouseMotionListener(dragListener);	        String prefix = getPropertyPrefix();        Caret caret = editor.getCaret();        if (caret == null || caret instanceof UIResource) {            caret = createCaret();            editor.setCaret(caret);                    int rate = DefaultLookup.getInt(getComponent(), this, prefix + ".caretBlinkRate", 500);            caret.setBlinkRate(rate);        }        Highlighter highlighter = editor.getHighlighter();        if (highlighter == null || highlighter instanceof UIResource) {            editor.setHighlighter(createHighlighter());        }	TransferHandler th = editor.getTransferHandler();	if (th == null || th instanceof UIResource) {	    editor.setTransferHandler(getTransferHandler());	}    }    /**     * Sets the component properties that haven't been explicitly overridden to      * null.  A property is considered overridden if its current value     * is not a UIResource.     *      * @see #installDefaults     * @see #uninstallUI     */    protected void uninstallDefaults()     {	editor.removeMouseListener(dragListener);	editor.removeMouseMotionListener(dragListener);        if (editor.getCaretColor() instanceof UIResource) {            editor.setCaretColor(null);        }                                                                                         

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91尤物视频在线观看| 国产精品初高中害羞小美女文| 欧美性大战xxxxx久久久| 波多野结衣在线一区| 国产成人h网站| 国产99一区视频免费| 福利电影一区二区| 丰满少妇在线播放bd日韩电影| 国产一区二区三区免费观看| 国产在线精品一区二区| 国产精品一区在线观看你懂的| 国产精品99久久久久久久女警 | 麻豆精品视频在线观看| 全部av―极品视觉盛宴亚洲| 日韩高清一级片| 男人操女人的视频在线观看欧美| 免费av网站大全久久| 国产欧美一区二区精品性色超碰| 91视频免费观看| 精品99久久久久久| 成人在线视频一区二区| 高清国产午夜精品久久久久久| 九色综合狠狠综合久久| 国产精品99久久久| 99久久久精品| 欧美三级资源在线| 欧美精品日韩精品| 久久久久久**毛片大全| 中文字幕第一区二区| 亚洲色图欧美偷拍| 日韩高清在线观看| 成人永久aaa| 欧美曰成人黄网| 欧美成人三级电影在线| 国产女人18毛片水真多成人如厕| 国产精品女上位| 亚洲第一精品在线| 国产精品一区二区三区四区| 欧美一级搡bbbb搡bbbb| 久久夜色精品国产欧美乱极品| 中文字幕在线免费不卡| 一区二区欧美精品| 捆绑紧缚一区二区三区视频| www.日韩精品| 欧美一区午夜视频在线观看| 亚洲国产精华液网站w| 亚洲综合色婷婷| 国产一区美女在线| 色呦呦网站一区| 精品国产免费久久 | 亚洲精品视频在线观看免费 | 成人精品高清在线| 欧美性大战久久久久久久| 久久午夜色播影院免费高清| 伊人性伊人情综合网| 精品在线亚洲视频| 91久久线看在观草草青青| 日韩美女一区二区三区四区| 亚洲三级久久久| 国产精品亚洲一区二区三区妖精| 欧美亚洲国产bt| 久久精品亚洲精品国产欧美kt∨| 亚洲一区二区黄色| av不卡一区二区三区| 欧美成人激情免费网| 亚洲高清视频的网址| 成人黄色片在线观看| 日韩精品一区二区三区三区免费 | 一区二区在线观看免费视频播放| 青青草国产精品亚洲专区无| 99国产精品国产精品毛片| 日韩精品一区二区三区在线| 亚洲成人www| 99re亚洲国产精品| 久久亚洲综合色| 蜜桃久久精品一区二区| 欧美性生活大片视频| 国产精品久久久一本精品| 久久国产精品免费| 日韩无一区二区| 天天爽夜夜爽夜夜爽精品视频| 波多野结衣中文一区| 国产欧美精品日韩区二区麻豆天美| 日韩精品国产精品| 欧美三级午夜理伦三级中视频| 欧美国产欧美亚州国产日韩mv天天看完整| av网站免费线看精品| 久久久久久一二三区| 久久国产生活片100| 欧美大白屁股肥臀xxxxxx| 天天色综合天天| 91麻豆精品久久久久蜜臀 | 91黄色免费网站| 国产精品欧美经典| 成人av网站免费| 中文字幕国产一区| 成人一区二区三区视频在线观看 | 最新不卡av在线| 不卡的av电影| 亚洲欧洲av色图| 99riav久久精品riav| 中文字幕一区二区不卡| 99视频精品免费视频| 亚洲色图制服丝袜| 色88888久久久久久影院野外| 国产精品嫩草影院av蜜臀| 福利视频网站一区二区三区| 欧美国产禁国产网站cc| 国产大陆a不卡| 国产欧美日韩视频在线观看| 国产99一区视频免费| 国产精品久久久久aaaa| 成人av动漫在线| 亚洲日本青草视频在线怡红院| 91色九色蝌蚪| 一级中文字幕一区二区| 欧美高清dvd| 韩日欧美一区二区三区| 日本一区免费视频| 99久久99久久精品国产片果冻| 最好看的中文字幕久久| 欧美日韩色一区| 免费在线观看日韩欧美| 久久男人中文字幕资源站| 国产成人av资源| 亚洲欧美日韩成人高清在线一区| 91视频com| 天天综合天天做天天综合| 精品精品国产高清a毛片牛牛| 国产成人丝袜美腿| 一区二区高清免费观看影视大全 | 亚洲欧美日韩久久精品| 欧美午夜在线一二页| 久久电影国产免费久久电影| 国产丝袜美腿一区二区三区| 99久久综合精品| 日韩精品色哟哟| 欧美韩日一区二区三区| 色88888久久久久久影院野外| 日本视频一区二区| 中文欧美字幕免费| 欧美日韩中文字幕精品| 国产激情91久久精品导航| 亚洲黄一区二区三区| 日韩午夜电影在线观看| 99久久综合国产精品| 美女视频第一区二区三区免费观看网站| 国产色91在线| 欧美片网站yy| 国产999精品久久久久久绿帽| 亚洲综合区在线| 国产亚洲欧美日韩日本| 欧洲精品一区二区| 国产一区二区三区免费播放| 亚洲综合在线观看视频| 欧美精品一区二区三区高清aⅴ| 99久久综合狠狠综合久久| 美腿丝袜亚洲三区| 亚洲日本一区二区三区| 久久综合久久综合亚洲| 欧美日韩免费不卡视频一区二区三区 | 亚洲欧洲美洲综合色网| 欧美精品三级在线观看| 91浏览器打开| 国产九九视频一区二区三区| 亚洲成人午夜影院| 国产欧美日韩精品在线| 69久久夜色精品国产69蝌蚪网| 成人网页在线观看| 国产综合色视频| 丝袜国产日韩另类美女| 1024亚洲合集| 国产欧美日韩另类一区| 精品国产伦一区二区三区观看方式 | 激情综合五月天| 亚洲国产精品一区二区尤物区| 国产精品毛片久久久久久| 日韩亚洲欧美在线观看| 精品视频免费在线| 91浏览器在线视频| 成人国产精品免费观看视频| 久久激五月天综合精品| 无码av免费一区二区三区试看| 亚洲欧洲精品一区二区精品久久久 | 久久久久久久网| 日韩欧美三级在线| 欧美另类变人与禽xxxxx| 91小视频免费看| 成人免费高清在线| 国产乱子轮精品视频| 久久成人麻豆午夜电影| 日韩电影在线看| 亚洲成a人v欧美综合天堂| 亚洲欧美另类小说| 国产精品白丝在线| 欧美激情综合五月色丁香小说| 精品sm捆绑视频| 久久久亚洲高清| xnxx国产精品| 久久色视频免费观看|