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

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

?? basictextfieldui.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)BasicTextFieldUI.java	1.95 03/12/19 * * Copyright 2004 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.95 12/19/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);	updateBackground((JTextComponent)c);    }    /**     * 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") ||	    evt.getPropertyName().equals("enabled")) {	    updateBackground((JTextComponent)evt.getSource());	}    }    private void updateBackground(JTextComponent c) {	Color background = c.getBackground();	if (background instanceof UIResource) {	    Color newColor = null;	    String prefix = getPropertyPrefix();	    if (!c.isEnabled()) {		newColor = DefaultLookup.getColor(c, this,						  prefix + ".disabledBackground",						  null);	    }	    if (newColor == null && !c.isEditable()) {		newColor = DefaultLookup.getColor(c, this,						  prefix + ".inactiveBackground",						  null);	    }	    if (newColor == null) {		newColor = DefaultLookup.getColor(c, this,						  prefix + ".background",						  null);	    }	    if (newColor != null && newColor != background) {		c.setBackground(newColor);	    }	}    }    /**     * 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一区二区三区免费野_久草精品视频
裸体健美xxxx欧美裸体表演| 欧美少妇性性性| 视频一区视频二区在线观看| 亚洲色图制服诱惑| 国产精品亲子伦对白| 国产精品国产自产拍高清av王其| 国产欧美日本一区二区三区| 国产亚洲欧美色| 国产精品网站在线观看| 免费日韩伦理电影| 国产精品系列在线观看| 国产精品亚洲第一| 欧美日韩国产高清一区二区| 91精品国产欧美日韩| 精品福利在线导航| 国产欧美精品区一区二区三区| 亚洲1区2区3区视频| 九九**精品视频免费播放| 国产不卡免费视频| 一本一本大道香蕉久在线精品| 欧美午夜精品久久久| 综合电影一区二区三区| 国产传媒久久文化传媒| 99精品热视频| 欧美一区二区视频在线观看2022| 亚洲免费伊人电影| 美女一区二区在线观看| 日本乱人伦aⅴ精品| 精品国精品国产尤物美女| 亚州成人在线电影| 欧美三级电影在线看| 国产亚洲欧美日韩俺去了| 国产一区在线不卡| 欧美性生交片4| 亚洲精品久久7777| 精品一区中文字幕| 日韩精品最新网址| 亚洲色图一区二区三区| 99久久婷婷国产| 亚洲日本欧美天堂| 日本高清视频一区二区| 一区二区不卡在线播放| 久久99精品国产.久久久久| 日韩欧美国产三级电影视频| 黄一区二区三区| 欧美日韩中文字幕一区二区| 亚洲一区二区美女| 成人动漫一区二区在线| 欧美大黄免费观看| 蜜桃av一区二区| 国产亚洲一区字幕| 成人激情图片网| 一区二区三区在线免费| 欧美日韩在线播放三区| 久久精品国产亚洲a| 久久久美女毛片| 蜜臀久久久久久久| 久久久久国产精品麻豆| av在线播放成人| 国产精品视频一二三区 | 白白色亚洲国产精品| 中文字幕在线不卡国产视频| 国产一区二区导航在线播放| 国产精品麻豆久久久| 在线观看视频一区二区欧美日韩| 日韩美女啊v在线免费观看| 精品视频色一区| 国内一区二区在线| 亚洲午夜精品在线| 色综合欧美在线| 麻豆久久久久久| 亚洲欧美另类图片小说| 日韩一区二区在线看| 久久精品国产亚洲a| 国产精品美日韩| 日韩三级视频在线看| 99视频精品全部免费在线| 日av在线不卡| 亚洲黄色av一区| 久久久久国产精品麻豆ai换脸| 91久久精品网| 国产高清成人在线| 日韩黄色小视频| 一区二区三区视频在线看| 久久亚洲春色中文字幕久久久| 国内精品国产成人国产三级粉色| 亚洲久本草在线中文字幕| 久久综合色婷婷| 欧美日韩成人在线| 96av麻豆蜜桃一区二区| 狠狠色丁香婷综合久久| 亚洲成人免费在线| 中文字幕视频一区| 国产午夜精品一区二区| 制服丝袜中文字幕一区| 老司机精品视频导航| 亚洲午夜久久久久久久久电影网 | 亚洲国产精华液网站w| 国产成人精品aa毛片| 日本 国产 欧美色综合| 亚洲电影中文字幕在线观看| 亚洲欧洲国产日韩| 国产欧美一区二区三区在线老狼| 欧美一区二区三区在线| 欧美欧美午夜aⅴ在线观看| av电影在线不卡| 成人福利电影精品一区二区在线观看| 国精产品一区一区三区mba视频| 日本欧美肥老太交大片| 国产精品视频免费看| 国产亚洲女人久久久久毛片| 久久影院午夜片一区| 欧美v国产在线一区二区三区| 成人av电影观看| 处破女av一区二区| 日产欧产美韩系列久久99| 亚洲福中文字幕伊人影院| 一区二区在线免费| 亚洲国产色一区| 午夜精品一区在线观看| 国产清纯美女被跳蛋高潮一区二区久久w| 日韩限制级电影在线观看| 91精品国产福利| 精品国产百合女同互慰| 久久精品人人做人人综合| 久久精品男人天堂av| 国产精品成人免费在线| 亚洲六月丁香色婷婷综合久久| 亚洲伦理在线精品| 午夜精品在线视频一区| 轻轻草成人在线| 国产精品影视网| 92国产精品观看| 欧美亚洲国产一区在线观看网站| 欧美老女人第四色| 成人免费看黄yyy456| av网站免费线看精品| 色呦呦一区二区三区| 欧美人狂配大交3d怪物一区| 51精品久久久久久久蜜臀| 亚洲精品一线二线三线| 日本一区二区免费在线观看视频| 日韩伦理av电影| 日韩精品一卡二卡三卡四卡无卡| 极品少妇一区二区| 国产白丝网站精品污在线入口| 91视视频在线观看入口直接观看www| 精品亚洲免费视频| 不卡一区二区三区四区| 欧美日韩免费电影| 精品sm捆绑视频| 亚洲免费伊人电影| 狠狠色丁香婷综合久久| 一本一道久久a久久精品 | 一区二区三区四区视频精品免费| 午夜激情久久久| 国产成人在线网站| 欧美日韩久久一区二区| 欧美激情综合在线| 香蕉加勒比综合久久| 处破女av一区二区| 91精品国产综合久久久蜜臀粉嫩| 国产欧美一区二区精品仙草咪 | 国产精品丝袜久久久久久app| 亚洲国产精品久久不卡毛片| 国产高清不卡一区二区| 欧美日韩精品系列| 中文无字幕一区二区三区| 天堂在线一区二区| 99视频在线观看一区三区| 精品日韩欧美一区二区| 亚洲午夜视频在线观看| 波多野结衣在线一区| 欧美va亚洲va| 日韩经典中文字幕一区| 91视视频在线直接观看在线看网页在线看 | 成人理论电影网| 日韩欧美中文一区二区| 亚洲国产欧美另类丝袜| 99久久免费国产| 久久久久久久久久久久久夜| 日韩高清不卡一区二区三区| 日本精品一级二级| 国产精品另类一区| 国产成人亚洲精品青草天美| 日韩精品专区在线影院观看| 亚洲高清一区二区三区| 色综合天天视频在线观看| 国产精品灌醉下药二区| 国产馆精品极品| 久久久久国产成人精品亚洲午夜 | 亚洲午夜激情网站| 91在线观看成人| 国产精品你懂的在线| 国产高清在线观看免费不卡| 久久影视一区二区| 国产一区二区三区四区在线观看| 欧美大黄免费观看| 久久99精品久久久| 2020国产成人综合网|