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

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

?? basictextfieldui.java

?? JAVA 所有包
?? JAVA
字號:
/* * @(#)BasicTextFieldUI.java	1.98 06/04/20 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.plaf.basic;import java.awt.*;import java.awt.event.KeyEvent;import java.awt.event.FocusEvent;import java.awt.event.InputEvent;import java.beans.PropertyChangeEvent;import java.io.Reader;import javax.swing.*;import javax.swing.border.*;import javax.swing.event.*;import javax.swing.text.*;import javax.swing.plaf.*;import sun.swing.DefaultLookup;/** * Basis of a look and feel for a JTextField. * <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 * @version 1.98 04/20/06 */public class BasicTextFieldUI extends BasicTextUI {    /**     * Creates a UI for a JTextField.     *     * @param c the text field     * @return the UI     */    public static ComponentUI createUI(JComponent c) {        return new BasicTextFieldUI();    }    /**     * Creates a new BasicTextFieldUI.     */    public BasicTextFieldUI() {	super();    }    /**     * Fetches the name used as a key to lookup properties through the     * UIManager.  This is used as a prefix to all the standard     * text properties.     *     * @return the name ("TextField")     */    protected String getPropertyPrefix() {	return "TextField";    }    /**     * Creates a view (FieldView) based on an element.     *     * @param elem the element     * @return the view     */    public View create(Element elem) {	Document doc = elem.getDocument();	Object i18nFlag = doc.getProperty("i18n"/*AbstractDocument.I18NProperty*/);	if (Boolean.TRUE.equals(i18nFlag)) {	    // To support bidirectional text, we build a more heavyweight	    // representation of the field.	    String kind = elem.getName();	    if (kind != null) {		if (kind.equals(AbstractDocument.ContentElementName)) {		    return new GlyphView(elem);		} else if (kind.equals(AbstractDocument.ParagraphElementName)) {		    return new I18nFieldView(elem);		}	    }	    // this shouldn't happen, should probably throw in this case.	}	return new FieldView(elem);    }    /**     * Returns the baseline.     *     * @throws NullPointerException {@inheritDoc}     * @throws IllegalArgumentException {@inheritDoc}     * @see javax.swing.JComponent#getBaseline(int, int)     * @since 1.6     */    public int getBaseline(JComponent c, int width, int height) {        super.getBaseline(c, width, height);        View rootView = getRootView((JTextComponent)c);        if (rootView.getViewCount() > 0) {            Insets insets = c.getInsets();            height = height - insets.top - insets.bottom;            if (height > 0) {                int baseline = insets.top;                View fieldView = rootView.getView(0);                int vspan = (int)fieldView.getPreferredSpan(View.Y_AXIS);                if (height != vspan) {                    int slop = height - vspan;                    baseline += slop / 2;                }                if (fieldView instanceof I18nFieldView) {                    int fieldBaseline = BasicHTML.getBaseline(                            fieldView, width - insets.left - insets.right,                            height);                    if (fieldBaseline < 0) {                        return -1;                    }                    baseline += fieldBaseline;                }                else {                    FontMetrics fm = c.getFontMetrics(c.getFont());                    baseline += fm.getAscent();                }                return baseline;            }        }        return -1;    }    /**     * Returns an enum indicating how the baseline of the component     * changes as the size changes.     *     * @throws NullPointerException {@inheritDoc}     * @see javax.swing.JComponent#getBaseline(int, int)     * @since 1.6     */    public Component.BaselineResizeBehavior getBaselineResizeBehavior(            JComponent c) {        super.getBaselineResizeBehavior(c);        return Component.BaselineResizeBehavior.CENTER_OFFSET;    }    /**     * A field view that support bidirectional text via the     * support provided by ParagraphView.     */    static class I18nFieldView extends ParagraphView {	I18nFieldView(Element elem) {	    super(elem);	}	/**	 * Fetch the constraining span to flow against for	 * the given child index.  There is no limit for	 * a field since it scrolls, so this is implemented to	 * return <code>Integer.MAX_VALUE</code>.	 */        public int getFlowSpan(int index) {	    return Integer.MAX_VALUE;	}	protected void setJustification(int j) {	    // Justification is done in adjustAllocation(), so disable 	    // ParagraphView's justification handling by doing nothing here.	}	static boolean isLeftToRight( java.awt.Component c ) {	    return c.getComponentOrientation().isLeftToRight();	}	/**	 * Adjusts the allocation given to the view	 * to be a suitable allocation for a text field.	 * If the view has been allocated more than the 	 * preferred span vertically, the allocation is	 * changed to be centered vertically.  Horizontally	 * the view is adjusted according to the horizontal	 * alignment property set on the associated JTextField	 * (if that is the type of the hosting component).	 *	 * @param a the allocation given to the view, which may need	 *  to be adjusted.	 * @return the allocation that the superclass should use.	 */        Shape adjustAllocation(Shape a) {	    if (a != null) {		Rectangle bounds = a.getBounds();		int vspan = (int) getPreferredSpan(Y_AXIS);		int hspan = (int) getPreferredSpan(X_AXIS);		if (bounds.height != vspan) {		    int slop = bounds.height - vspan;		    bounds.y += slop / 2;		    bounds.height -= slop;		}				// horizontal adjustments		Component c = getContainer();		if (c instanceof JTextField) {		    JTextField field = (JTextField) c;		    BoundedRangeModel vis = field.getHorizontalVisibility();		    int max = Math.max(hspan, bounds.width);		    int value = vis.getValue();		    int extent = Math.min(max, bounds.width - 1);		    if ((value + extent) > max) {			value = max - extent;		    }		    vis.setRangeProperties(value, extent, vis.getMinimum(),					   max, false);		    if (hspan < bounds.width) {			// horizontally align the interior			int slop = bounds.width - 1 - hspan;						int align = ((JTextField)c).getHorizontalAlignment();			if(isLeftToRight(c)) {			    if(align==LEADING) {				align = LEFT;			    }			    else if(align==TRAILING) {				align = RIGHT;			    }			}			else {			    if(align==LEADING) {				align = RIGHT;			    }			    else if(align==TRAILING) {				align = LEFT;			    }			}			switch (align) {			case SwingConstants.CENTER:			    bounds.x += slop / 2;			    bounds.width -= slop;			    break;			case SwingConstants.RIGHT:			    bounds.x += slop;			    bounds.width -= slop;			    break;			}		    } else {			// adjust the allocation to match the bounded range.			bounds.width = hspan;			bounds.x -= vis.getValue();		    }		}		return bounds;	    }	    return null;	}	/**	 * Update the visibility model with the associated JTextField	 * (if there is one) to reflect the current visibility as a	 * result of changes to the document model.  The bounded	 * range properties are updated.  If the view hasn't yet been	 * shown the extent will be zero and we just set it to be full	 * until determined otherwise.	 */	void updateVisibilityModel() {	    Component c = getContainer();	    if (c instanceof JTextField) {		JTextField field = (JTextField) c;		BoundedRangeModel vis = field.getHorizontalVisibility();		int hspan = (int) getPreferredSpan(X_AXIS);		int extent = vis.getExtent();		int maximum = Math.max(hspan, extent);		extent = (extent == 0) ? maximum : extent;		int value = maximum - extent;		int oldValue = vis.getValue();		if ((oldValue + extent) > maximum) {		    oldValue = maximum - extent;		}		value = Math.max(0, Math.min(value, oldValue));		vis.setRangeProperties(value, extent, 0, maximum, false);	    }	}	// --- View methods -------------------------------------------		/**	 * Renders using the given rendering surface and area on that surface.	 * The view may need to do layout and create child views to enable	 * itself to render into the given allocation.	 *	 * @param g the rendering surface to use	 * @param a the allocated region to render into	 *	 * @see View#paint	 */        public void paint(Graphics g, Shape a) {	    Rectangle r = (Rectangle) a;	    g.clipRect(r.x, r.y, r.width, r.height);	    super.paint(g, adjustAllocation(a));	}		/**	 * Determines the resizability of the view along the	 * given axis.  A value of 0 or less is not resizable.	 *	 * @param axis View.X_AXIS or View.Y_AXIS	 * @return the weight -> 1 for View.X_AXIS, else 0	 */        public int getResizeWeight(int axis) {	    if (axis == View.X_AXIS) {		return 1;	    }	    return 0;	}		/**	 * Provides a mapping from the document model coordinate space	 * to the coordinate space of the view mapped to it.	 *	 * @param pos the position to convert >= 0	 * @param a the allocated region to render into	 * @return the bounding box of the given position	 * @exception BadLocationException  if the given position does not	 *   represent a valid location in the associated document	 * @see View#modelToView	 */        public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException {	    return super.modelToView(pos, adjustAllocation(a), b);	}	        /**         * Provides a mapping from the document model coordinate space         * to the coordinate space of the view mapped to it.         *         * @param p0 the position to convert >= 0         * @param b0 the bias toward the previous character or the         *  next character represented by p0, in case the          *  position is a boundary of two views.          * @param p1 the position to convert >= 0         * @param b1 the bias toward the previous character or the         *  next character represented by p1, in case the          *  position is a boundary of two views.          * @param a the allocated region to render into         * @return the bounding box of the given position is returned         * @exception BadLocationException  if the given position does         *   not represent a valid location in the associated document         * @exception IllegalArgumentException for an invalid bias argument         * @see View#viewToModel         */        public Shape modelToView(int p0, Position.Bias b0,                                  int p1, Position.Bias b1, Shape a)             throws BadLocationException         {            return super.modelToView(p0, b0, p1, b1, adjustAllocation(a));        }	/**	 * Provides a mapping from the view coordinate space to the logical	 * coordinate space of the model.	 *	 * @param fx the X coordinate >= 0.0f	 * @param fy the Y coordinate >= 0.0f	 * @param a the allocated region to render into	 * @return the location within the model that best represents the	 *  given point in the view	 * @see View#viewToModel	 */        public int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias) {	    return super.viewToModel(fx, fy, adjustAllocation(a), bias);	}		/**	 * Gives notification that something was inserted into the document	 * in a location that this view is responsible for.	 *	 * @param changes the change information from the associated document	 * @param a the current allocation of the view	 * @param f the factory to use to rebuild if the view has children	 * @see View#insertUpdate	 */        public void insertUpdate(DocumentEvent changes, Shape a, ViewFactory f) {	    super.insertUpdate(changes, adjustAllocation(a), f);	    updateVisibilityModel();	}		/**	 * Gives notification that something was removed from the document	 * in a location that this view is responsible for.	 *	 * @param changes the change information from the associated document	 * @param a the current allocation of the view	 * @param f the factory to use to rebuild if the view has children	 * @see View#removeUpdate	 */        public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory f) {	    super.removeUpdate(changes, adjustAllocation(a), f);	    updateVisibilityModel();	}	    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲三级免费电影| 一区二区视频免费在线观看| 欧美在线一二三| 国产一区在线观看麻豆| 亚洲国产精品久久一线不卡| 亚洲精品一区二区三区精华液| 色妞www精品视频| 国产成人精品三级麻豆| 奇米色一区二区三区四区| 亚洲精品国产精品乱码不99| 久久久久一区二区三区四区| 欧美高清www午色夜在线视频| av综合在线播放| 国产精品白丝jk黑袜喷水| 男女性色大片免费观看一区二区 | 免费成人在线网站| 亚洲精品一二三区| 国产精品女同一区二区三区| 精品国产免费一区二区三区四区| 欧美三级电影一区| 色视频一区二区| 一本色道久久综合亚洲91| 国产69精品久久99不卡| 国产曰批免费观看久久久| 调教+趴+乳夹+国产+精品| 亚洲一区自拍偷拍| 亚洲一区中文在线| 亚洲一区二区三区四区在线观看| 综合激情成人伊人| 国产精品乱子久久久久| 中文字幕乱码久久午夜不卡 | 99综合电影在线视频| 国产精品一区二区三区网站| 久久精品国产亚洲一区二区三区| 爽好久久久欧美精品| 夜色激情一区二区| 亚洲一区二区三区激情| 亚洲午夜久久久| 午夜视频在线观看一区二区| 亚洲成av人片一区二区梦乃| 亚洲大型综合色站| 天天亚洲美女在线视频| 免费观看成人av| 韩国成人福利片在线播放| 国产伦精品一区二区三区视频青涩 | 欧美精品一卡两卡| 欧美日高清视频| 91 com成人网| 欧美成人性战久久| 久久亚洲春色中文字幕久久久| 久久久久久免费毛片精品| 国产人妖乱国产精品人妖| 中国av一区二区三区| 亚洲欧美一区二区三区极速播放| 亚洲一区影音先锋| 免费精品视频最新在线| 国产在线精品免费av| 成人精品免费看| 91搞黄在线观看| 欧美日韩夫妻久久| 欧美大肚乱孕交hd孕妇| 国产丝袜欧美中文另类| 亚洲另类在线制服丝袜| 丝袜诱惑制服诱惑色一区在线观看 | 精品视频一区二区三区免费| 欧美日韩国产中文| 欧美成人官网二区| 亚洲欧洲日韩综合一区二区| 亚洲一区二区3| 精品一区二区三区免费观看| 成人av在线资源网站| 欧美三级欧美一级| 久久久美女毛片| 一区二区三区视频在线观看| 免费日韩伦理电影| www.成人网.com| 欧美日韩视频在线一区二区| 久久综合久久综合九色| 亚洲精品中文在线观看| 九九久久精品视频| 色综合久久综合| 欧美α欧美αv大片| 国产精品传媒视频| 水野朝阳av一区二区三区| 国产黄人亚洲片| 欧美日韩精品免费观看视频| 久久综合九色综合97婷婷女人 | 国产精品久久二区二区| 图片区日韩欧美亚洲| 成人免费视频视频| 91精品国产入口| 中文字幕亚洲欧美在线不卡| 麻豆极品一区二区三区| 色偷偷88欧美精品久久久| 亚洲精品在线一区二区| 一区二区三区在线不卡| 国产成人夜色高潮福利影视| 欧美日韩国产综合一区二区 | 麻豆免费精品视频| 91在线看国产| 2020国产精品久久精品美国| 一区二区三区精品| 欧美精品三级日韩久久| 欧美极品aⅴ影院| 久久爱www久久做| 欧美日韩免费高清一区色橹橹| 中文天堂在线一区| 狠狠狠色丁香婷婷综合激情| 欧美久久一区二区| 一区二区三区在线影院| 成人免费视频视频在线观看免费| 欧美mv日韩mv国产网站app| 亚洲一区二区三区国产| www.成人在线| 中文成人综合网| 国产成人在线视频网站| 91精品黄色片免费大全| 亚洲午夜久久久久久久久久久| 99精品欧美一区二区蜜桃免费| 久久久久9999亚洲精品| 玖玖九九国产精品| 欧美男生操女生| 亚洲mv在线观看| 欧美四级电影在线观看| 亚洲综合一区在线| 色综合色综合色综合| 亚洲婷婷综合久久一本伊一区| 国产成人久久精品77777最新版本| 久久影院电视剧免费观看| 免费成人av资源网| 欧美电影精品一区二区| 日韩影院精彩在线| 9191久久久久久久久久久| 香蕉影视欧美成人| 欧美日韩国产精品自在自线| 亚洲第一狼人社区| 欧美美女bb生活片| 青青草91视频| 欧美不卡激情三级在线观看| 精品一区中文字幕| 2020国产精品| 成人午夜碰碰视频| 亚洲欧美另类综合偷拍| 在线免费视频一区二区| 午夜精品一区二区三区免费视频| 欧美日韩激情一区二区三区| 视频在线在亚洲| 日韩精品一区在线观看| 久久成人免费网| 国产欧美一区二区精品秋霞影院| 懂色av一区二区夜夜嗨| 日韩美女视频一区二区| 欧洲一区在线电影| 日本中文在线一区| 久久久影院官网| 91原创在线视频| 一区二区在线观看不卡| 欧美日韩你懂得| 国产在线精品不卡| 综合电影一区二区三区 | 日韩精品亚洲专区| 日韩精品一区在线观看| 懂色av中文字幕一区二区三区| 亚洲女人的天堂| 91精品国产麻豆| 寂寞少妇一区二区三区| 中文字幕免费观看一区| 欧美伊人久久久久久午夜久久久久| 日本不卡在线视频| 国产欧美精品一区二区色综合朱莉| 91老师国产黑色丝袜在线| 三级成人在线视频| 国产欧美日韩亚州综合| 欧美日韩在线一区二区| 国产精品1区2区| 亚洲精品成人少妇| 精品久久人人做人人爽| 91一区二区三区在线观看| 日本aⅴ亚洲精品中文乱码| 中文一区一区三区高中清不卡| 欧美日韩精品综合在线| 国产成人免费视频精品含羞草妖精| 一卡二卡欧美日韩| 久久色在线观看| 日韩美一区二区三区| 91在线你懂得| 国内精品国产三级国产a久久| 亚洲精品自拍动漫在线| 欧美精品一区二| 精品视频在线看| av在线综合网| 国产在线麻豆精品观看| 亚洲成av人**亚洲成av**| 国产精品麻豆网站| 欧美成人bangbros| 欧美日韩性生活| jlzzjlzz亚洲日本少妇| 精品一区二区三区蜜桃| 亚洲高清视频在线| 亚洲视频免费在线观看|