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

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

?? basictextfieldui.java

?? java jdk 1.4的源碼
?? JAVA
字號:
/* * @(#)BasicTextFieldUI.java	1.92 03/03/17 * * Copyright 2003 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.*;/** * 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.92 03/17/03 */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();    }    public void installUI(JComponent c) {        super.installUI(c);	editableChanged(c, ((JTextComponent)c).isEditable());    }    /**     * 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.     *     * @param evt the property change event     */    protected void propertyChange(PropertyChangeEvent evt) {        if (evt.getPropertyName().equals("editable")) {	    JComponent source = (JComponent)evt.getSource();	    Color background = source.getBackground();	    boolean editable =  ((Boolean)evt.getNewValue()).booleanValue();	    editableChanged( source, editable);        }    }    private void editableChanged(JComponent c, boolean editable) {	Color background = c.getBackground();	if (background instanceof UIResource) {	    if (editable == false) {		c.setBackground(UIManager.getColor("TextField.inactiveBackground"));	    } else {		c.setBackground(UIManager.getColor("TextField.background"));	    }	}    }    /**     * 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 ((i18nFlag != null) && i18nFlag.equals(Boolean.TRUE)) {	    // 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);    }    /**     * 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();	}	    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品影院一区二区久久久| 成人午夜电影网站| 精品一区二区久久| 国产不卡视频在线播放| 91一区在线观看| 日韩一二在线观看| 亚洲精品在线三区| |精品福利一区二区三区| 肉丝袜脚交视频一区二区| 国产黄人亚洲片| 欧美色综合天天久久综合精品| 日韩亚洲欧美成人一区| 最新高清无码专区| 视频一区二区中文字幕| 成人avav在线| 日韩一区二区在线看| 亚洲欧美日韩国产成人精品影院| 麻豆精品久久精品色综合| 91在线视频免费观看| 91精品国产综合久久香蕉的特点| 中文字幕一区免费在线观看| 一区二区成人在线视频| 福利电影一区二区| 日韩午夜在线观看视频| 亚洲免费看黄网站| 国产精品一区二区在线看| 欧美日本乱大交xxxxx| 国产精品美女久久久久aⅴ国产馆| 天堂在线亚洲视频| 91免费小视频| 日本一区二区三区高清不卡| 亚洲美女视频在线观看| 国产激情一区二区三区四区| 日韩三区在线观看| 国产精品久久久久久久久免费桃花 | 婷婷综合另类小说色区| 成人丝袜视频网| 精品一区二区免费看| 成人av资源网站| 亚洲精品在线三区| 久久精品国产亚洲a| 欧美人狂配大交3d怪物一区 | 欧美系列日韩一区| 国产精品你懂的在线| 国产伦精品一区二区三区视频青涩 | 久久九九全国免费| 国产在线精品一区在线观看麻豆| 欧美精品在线观看一区二区| 亚洲国产精品自拍| 欧美图区在线视频| 亚洲午夜在线观看视频在线| 一本到不卡免费一区二区| 亚洲色图欧洲色图婷婷| 成人av免费在线观看| 国产精品传媒入口麻豆| 成人综合在线观看| 中文字幕在线不卡视频| caoporm超碰国产精品| 国产精品久久久久久亚洲伦| 欧美午夜影院一区| 精品一区二区三区视频在线观看| 久久久久久久久久久电影| 成人av电影在线观看| 亚洲五码中文字幕| 久久品道一品道久久精品| 99国产欧美另类久久久精品| 亚洲va国产天堂va久久en| 久久日一线二线三线suv| 91网站视频在线观看| 久久成人麻豆午夜电影| 亚洲丝袜精品丝袜在线| 欧美高清视频一二三区 | 久久午夜国产精品| 91国产丝袜在线播放| 天堂av在线一区| 一区视频在线播放| 久久午夜免费电影| 欧美日韩国产片| 99re成人精品视频| 国产在线精品免费| 亚洲国产另类av| 国产精品国产a级| 日韩欧美激情在线| 欧美丝袜自拍制服另类| 国产精品资源网站| 日韩av一二三| 亚洲综合999| ●精品国产综合乱码久久久久| 日韩欧美资源站| 在线视频你懂得一区| 成人激情校园春色| 国产真实乱偷精品视频免| 午夜激情一区二区| 亚洲另类春色国产| 国产精品久久毛片a| 日韩精品一区二| 538prom精品视频线放| 91丝袜呻吟高潮美腿白嫩在线观看| 国内精品自线一区二区三区视频| 午夜精品成人在线视频| 一区二区三区精品在线观看| 中文字幕一区二区三区av| 精品播放一区二区| 日韩免费福利电影在线观看| 91精品国产色综合久久ai换脸| 91国偷自产一区二区三区观看| www.亚洲人| 99免费精品视频| 成人动漫一区二区三区| 成人av影院在线| 国产成人丝袜美腿| 国产一区高清在线| 国产成人午夜片在线观看高清观看| 男男视频亚洲欧美| 奇米影视在线99精品| 蜜桃久久久久久| 蜜臀a∨国产成人精品| 免费高清不卡av| 久久国内精品自在自线400部| 蜜臀久久久久久久| 乱一区二区av| 国产曰批免费观看久久久| 国产一区二区三区电影在线观看| 国产综合色视频| 成人动漫一区二区在线| 99精品国产一区二区三区不卡| 91网站视频在线观看| 欧美无乱码久久久免费午夜一区 | 亚洲二区在线视频| 日韩电影在线免费| 国产经典欧美精品| 色哟哟日韩精品| 欧美人与禽zozo性伦| 亚洲精品在线电影| 国产精品美女久久久久久久久久久 | 免费看欧美美女黄的网站| 国产精品一级片在线观看| 成人黄色国产精品网站大全在线免费观看 | 日本欧美大码aⅴ在线播放| 久久国产精品99精品国产| 国产xxx精品视频大全| 91久久一区二区| 欧美大黄免费观看| 国产精品色哟哟| 亚洲电影你懂得| 精品一区二区成人精品| 99re这里都是精品| 欧美一区二区三区视频免费 | 中文字幕不卡一区| 亚洲在线成人精品| 久久国产婷婷国产香蕉| av电影在线观看不卡| 7777精品伊人久久久大香线蕉| 国产日韩精品一区二区三区| 一区二区三区免费观看| 狠狠色丁香九九婷婷综合五月| 91免费版在线看| 精品99一区二区三区| 亚洲国产精品一区二区久久| 国产乱妇无码大片在线观看| 欧洲国产伦久久久久久久| 2020国产精品自拍| 五月天激情小说综合| 日韩中文字幕av电影| 久久青草国产手机看片福利盒子| 国产成人精品一区二| 粉嫩高潮美女一区二区三区| 在线免费观看日韩欧美| 蜜臀av国产精品久久久久| 国产一区在线观看视频| 欧美一区二区三区免费| 国产精品一二二区| 亚洲少妇屁股交4| 日韩精品一区二区三区蜜臀| 在线看国产一区| 国产成人日日夜夜| 国产一区在线看| 洋洋成人永久网站入口| 色综合欧美在线| 亚洲成av人综合在线观看| 3d动漫精品啪啪| 国产九色sp调教91| 国产精品久久网站| 欧美综合一区二区| 亚洲成人av一区| 3d动漫精品啪啪一区二区竹菊| 日韩成人伦理电影在线观看| 欧美电影免费观看高清完整版在线 | 国产天堂亚洲国产碰碰| 不卡大黄网站免费看| 亚洲一区二区三区四区在线免费观看| 91久久精品一区二区二区| 日韩中文字幕av电影| 精品国产a毛片| 91亚洲精华国产精华精华液| 亚洲国产精品精华液网站| 日韩欧美激情四射| eeuss影院一区二区三区| 亚洲高清免费视频| 久久伊人中文字幕|