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

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

?? imageview.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * @(#)ImageView.java	1.56 03/12/19 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.text.html;import java.awt.*;import java.awt.event.*;import java.awt.image.ImageObserver;import java.io.*;import java.net.*;import java.util.Dictionary;import javax.swing.*;import javax.swing.text.*;import javax.swing.event.*;/** * View of an Image, intended to support the HTML &lt;IMG&gt; tag. * Supports scaling via the HEIGHT and WIDTH attributes of the tag. * If the image is unable to be loaded any text specified via the * <code>ALT</code> attribute will be rendered. * <p> * While this class has been part of swing for a while now, it is public * as of 1.4. * * @author  Scott Violet * @version 1.56 12/19/03 * @see IconView * @since 1.4 */public class ImageView extends View {    /**     * If true, when some of the bits are available a repaint is done.     * <p>     * This is set to false as swing does not offer a repaint that takes a     * delay. If this were true, a bunch of immediate repaints would get     * generated that end up significantly delaying the loading of the image     * (or anything else going on for that matter).     */    private static boolean sIsInc = false;    /**     * Repaint delay when some of the bits are available.     */    private static int sIncRate = 100;    /**     * Icon used while the image is being loaded.     */    private static Icon sPendingImageIcon;    /**     * Icon used if the image could not be found.     */    private static Icon sMissingImageIcon;    /**     * File name for <code>sPendingImageIcon</code>.     */    private static final String PENDING_IMAGE_SRC = "icons/image-delayed.gif";    /**     * File name for <code>sMissingImageIcon</code>.     */    private static final String MISSING_IMAGE_SRC = "icons/image-failed.gif";    /**     * Document property for image cache.     */    private static final String IMAGE_CACHE_PROPERTY = "imageCache";        // Height/width to use before we know the real size, these should at least    // the size of <code>sMissingImageIcon</code> and    // <code>sPendingImageIcon</code>    private static final int DEFAULT_WIDTH = 38;    private static final int DEFAULT_HEIGHT= 38;    /**     * Default border to use if one is not specified.     */    private static final int DEFAULT_BORDER = 2;    // Bitmask values    private static final int LOADING_FLAG = 1;    private static final int LINK_FLAG = 2;    private static final int WIDTH_FLAG = 4;    private static final int HEIGHT_FLAG = 8;    private static final int RELOAD_FLAG = 16;    private static final int RELOAD_IMAGE_FLAG = 32;    private static final int SYNC_LOAD_FLAG = 64;    private AttributeSet attr;    private Image image;    private int width;    private int height;    /** Bitmask containing some of the above bitmask values. Because the     * image loading notification can happen on another thread access to     * this is synchronized (at least for modifying it). */    private int state;    private Container container;    private Rectangle fBounds;    private Color borderColor;    // Size of the border, the insets contains this valid. For example, if    // the HSPACE attribute was 4 and BORDER 2, leftInset would be 6.    private short borderSize;    // Insets, obtained from the painter.    private short leftInset;    private short rightInset;    private short topInset;    private short bottomInset;    /**     * We don't directly implement ImageObserver, instead we use an instance     * that calls back to us.     */    private ImageObserver imageObserver;    /**     * Used for alt text. Will be non-null if the image couldn't be found,     * and there is valid alt text.     */    private View altView;    /** Alignment along the vertical (Y) axis. */    private float vAlign;    /**     * Creates a new view that represents an IMG element.     *     * @param elem the element to create a view for     */    public ImageView(Element elem) {    	super(elem);	fBounds = new Rectangle();        imageObserver = new ImageHandler();        state = RELOAD_FLAG | RELOAD_IMAGE_FLAG;    }    /**     * Returns the text to display if the image can't be loaded. This is     * obtained from the Elements attribute set with the attribute name     * <code>HTML.Attribute.ALT</code>.     */    public String getAltText() {        return (String)getElement().getAttributes().getAttribute            (HTML.Attribute.ALT);    }    /**     * Return a URL for the image source,      * or null if it could not be determined.     */    public URL getImageURL() { 	String src = (String)getElement().getAttributes().                             getAttribute(HTML.Attribute.SRC); 	if (src == null) {            return null;        }	URL reference = ((HTMLDocument)getDocument()).getBase();        try { 	    URL u = new URL(reference,src);	    return u;        } catch (MalformedURLException e) {	    return null;        }    }        /**     * Returns the icon to use if the image couldn't be found.     */    public Icon getNoImageIcon() {        loadDefaultIconsIfNecessary();        return sMissingImageIcon;    }    /**     * Returns the icon to use while in the process of loading the image.     */    public Icon getLoadingImageIcon() {        loadDefaultIconsIfNecessary();        return sPendingImageIcon;    }    /**     * Returns the image to render.     */    public Image getImage() {        sync();        return image;    }    /**     * Sets how the image is loaded. If <code>newValue</code> is true,     * the image we be loaded when first asked for, otherwise it will     * be loaded asynchronously. The default is to not load synchronously,     * that is to load the image asynchronously.     */    public void setLoadsSynchronously(boolean newValue) {        synchronized(this) {            if (newValue) {                state |= SYNC_LOAD_FLAG;            }            else {                state = (state | SYNC_LOAD_FLAG) ^ SYNC_LOAD_FLAG;            }        }    }    /**     * Returns true if the image should be loaded when first asked for.     */    public boolean getLoadsSynchronously() {        return ((state & SYNC_LOAD_FLAG) != 0);    }    /**     * Convenience method to get the StyleSheet.     */    protected StyleSheet getStyleSheet() {	HTMLDocument doc = (HTMLDocument) getDocument();	return doc.getStyleSheet();    }    /**     * Fetches the attributes to use when rendering.  This is     * implemented to multiplex the attributes specified in the     * model with a StyleSheet.     */    public AttributeSet getAttributes() {        sync();	return attr;    }    /**     * For images the tooltip text comes from text specified with the     * <code>ALT</code> attribute. This is overriden to return     * <code>getAltText</code>.     *     * @see JTextComponent#getToolTipText     */    public String getToolTipText(float x, float y, Shape allocation) {        return getAltText();    }    /**     * Update any cached values that come from attributes.     */    protected void setPropertiesFromAttributes() {        StyleSheet sheet = getStyleSheet();        this.attr = sheet.getViewAttributes(this);        // Gutters        borderSize = (short)getIntAttr(HTML.Attribute.BORDER, isLink() ?                                       DEFAULT_BORDER : 0);        leftInset = rightInset = (short)(getIntAttr(HTML.Attribute.HSPACE,                                                    0) + borderSize);        topInset = bottomInset = (short)(getIntAttr(HTML.Attribute.VSPACE,                                                    0) + borderSize);        borderColor = ((StyledDocument)getDocument()).getForeground                      (getAttributes());        AttributeSet attr = getElement().getAttributes();        // Alignment.        // PENDING: This needs to be changed to support the CSS versions        // when conversion from ALIGN to VERTICAL_ALIGN is complete.        Object alignment = attr.getAttribute(HTML.Attribute.ALIGN);        vAlign = 1.0f;        if (alignment != null) {            alignment = alignment.toString();            if ("top".equals(alignment)) {                vAlign = 0f;            }            else if ("middle".equals(alignment)) {                vAlign = .5f;            }        }        AttributeSet anchorAttr = (AttributeSet)attr.getAttribute(HTML.Tag.A);        if (anchorAttr != null && anchorAttr.isDefined            (HTML.Attribute.HREF)) {            synchronized(this) {                state |= LINK_FLAG;            }        }        else {            synchronized(this) {                state = (state | LINK_FLAG) ^ LINK_FLAG;            }        }    }    /**     * Establishes the parent view for this view.     * Seize this moment to cache the AWT Container I'm in.     */    public void setParent(View parent) {        View oldParent = getParent();	super.setParent(parent);	container = (parent != null) ? getContainer() : null;        if (oldParent != parent) {            synchronized(this) {                state |= RELOAD_FLAG;            }        }    }    /**     * Invoked when the Elements attributes have changed. Recreates the image.     */    public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) {    	super.changedUpdate(e,a,f);        synchronized(this) {            state |= RELOAD_FLAG | RELOAD_IMAGE_FLAG;        }        // Assume the worst.        preferenceChanged(null, true, true);    }    /**     * Paints the View.     *     * @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) {        sync();	Rectangle rect = (a instanceof Rectangle) ? (Rectangle)a :                         a.getBounds();        Image image = getImage();        Rectangle clip = g.getClipBounds();	fBounds.setBounds(rect);        paintHighlights(g, a);        paintBorder(g, rect);        if (clip != null) {            g.clipRect(rect.x + leftInset, rect.y + topInset,                       rect.width - leftInset - rightInset,                       rect.height - topInset - bottomInset);        }        if (image != null) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级韩国三级日本三斤| 欧美性视频一区二区三区| 日韩中文欧美在线| 亚洲成av人片在线观看| 亚洲国产中文字幕在线视频综合 | 日本在线不卡视频一二三区| 亚洲一级二级三级在线免费观看| 亚洲免费在线观看| 亚洲老司机在线| 亚洲永久精品大片| 日韩经典中文字幕一区| 蜜臀久久久99精品久久久久久| 亚洲123区在线观看| 丝袜美腿亚洲综合| 老司机免费视频一区二区三区| 久久99精品久久久久久动态图| 国产一区二区三区观看| 成人高清视频在线| 欧美日韩视频专区在线播放| 在线成人免费视频| 欧美电影免费观看高清完整版在 | 亚洲mv大片欧洲mv大片精品| 日韩在线一区二区三区| 国产精品资源在线| 91麻豆免费看片| 欧美疯狂做受xxxx富婆| 久久久久久久久久久电影| 最新不卡av在线| 蜜桃av噜噜一区| av在线播放成人| 91精品国产综合久久久久久| 久久久精品黄色| 亚洲一区二区三区美女| 精品一区二区免费视频| 91在线视频播放| 51午夜精品国产| 综合网在线视频| 激情av综合网| 欧美精品色一区二区三区| 国产精品丝袜在线| 免费黄网站欧美| 91女厕偷拍女厕偷拍高清| 26uuu亚洲综合色欧美| 一二三区精品视频| 成人深夜视频在线观看| 日韩一区二区三区视频在线| 亚洲欧美日韩国产成人精品影院 | 日本特黄久久久高潮| 99re8在线精品视频免费播放| 欧美一区午夜视频在线观看| 亚洲免费在线播放| 成人毛片在线观看| 精品免费国产二区三区 | 精品成人在线观看| 午夜精品福利在线| 色综合天天综合| 国产欧美久久久精品影院| 日本一区中文字幕 | 久久精品国产色蜜蜜麻豆| 欧洲精品在线观看| 成人免费在线视频观看| 国产一区二区美女| 欧美成人video| 免费精品视频最新在线| 8x福利精品第一导航| 亚洲精品中文在线| 一本大道久久a久久精品综合| 久久综合色综合88| 九色|91porny| 精品国产在天天线2019| 麻豆成人久久精品二区三区红| 在线免费观看日韩欧美| 一区二区三区在线观看欧美| 成人免费av在线| 成人欧美一区二区三区1314| av在线不卡免费看| 亚洲日本护士毛茸茸| 在线看不卡av| 亚洲国产综合视频在线观看| 欧美日韩一级大片网址| 日韩和欧美一区二区| 正在播放亚洲一区| 精品一区二区三区久久久| 欧美成人综合网站| 国产精品123区| 中文字幕一区二区不卡| 色综合久久久久久久久| 偷拍亚洲欧洲综合| 日韩欧美国产精品一区| 国产裸体歌舞团一区二区| 国产欧美中文在线| 色综合久久久久综合| 日韩国产在线一| 欧美v日韩v国产v| 成人一级视频在线观看| 亚洲天堂福利av| 欧美精品一二三| 国产高清不卡一区| 亚洲精品久久久蜜桃| 69堂精品视频| 国产激情视频一区二区在线观看| 中文字幕日韩一区二区| 7777精品伊人久久久大香线蕉 | 精品国产精品网麻豆系列| 丰满少妇在线播放bd日韩电影| 中文字幕免费不卡在线| 欧美亚洲综合另类| 精品一区二区日韩| 一个色在线综合| 精品国产亚洲在线| 色偷偷久久人人79超碰人人澡| 午夜婷婷国产麻豆精品| 欧美韩日一区二区三区| 欧美性感一类影片在线播放| 国产在线精品国自产拍免费| 亚洲精品视频在线看| www一区二区| 欧美三级乱人伦电影| 懂色av中文字幕一区二区三区 | 国内精品伊人久久久久av影院| 日韩一区有码在线| 日韩欧美第一区| 91精彩视频在线| av网站一区二区三区| 久久99精品久久久| 视频一区中文字幕国产| 国产精品久久久久久久久免费相片 | 天天综合日日夜夜精品| 一区在线中文字幕| 久久久久88色偷偷免费| 欧美另类z0zxhd电影| 91污片在线观看| 粉嫩欧美一区二区三区高清影视| 午夜一区二区三区在线观看| 国产精品福利影院| 久久久久久久久岛国免费| 欧美精品久久久久久久久老牛影院| www.欧美精品一二区| 精品亚洲国内自在自线福利| 婷婷综合另类小说色区| 一区二区三区欧美在线观看| 国产精品免费久久| 国产精品日日摸夜夜摸av| 久久青草欧美一区二区三区| 日韩欧美二区三区| 精品久久国产字幕高潮| 日韩免费高清视频| 日韩一区二区三区三四区视频在线观看 | 日本中文在线一区| 免费欧美日韩国产三级电影| 免费欧美高清视频| 久久成人免费日本黄色| 精品一区二区日韩| 国产一区二区三区免费播放| 国产一区中文字幕| 国产乱妇无码大片在线观看| 国产自产高清不卡| 国产精品888| 成人a级免费电影| 97久久精品人人澡人人爽| 色菇凉天天综合网| 欧美日韩日本视频| 91精品久久久久久久久99蜜臂| 欧美日韩高清一区| 精品国产一区二区三区忘忧草 | 日韩精品一区二区三区三区免费| 日韩免费电影网站| 国产亚洲精品bt天堂精选| 亚洲国产高清aⅴ视频| 亚洲人123区| 午夜a成v人精品| 韩国精品久久久| 成人精品在线视频观看| 日本精品视频一区二区三区| 欧美在线看片a免费观看| 欧美日韩国产综合视频在线观看| 91 com成人网| 中文在线免费一区三区高中清不卡| 亚洲免费在线播放| 麻豆91精品视频| 99在线热播精品免费| 欧美日韩中文一区| 久久久久亚洲综合| 亚洲精品国产第一综合99久久| 天天色天天爱天天射综合| 国内精品伊人久久久久av一坑| 成人激情开心网| 91精品婷婷国产综合久久竹菊| 国产午夜精品一区二区| 一区二区欧美在线观看| 国内成人免费视频| 欧美视频第二页| 中文字幕欧美三区| 日本欧美一区二区在线观看| 粉嫩绯色av一区二区在线观看| 欧美午夜视频网站| 中文字幕一区二区三区四区不卡| 午夜国产不卡在线观看视频| www.日本不卡| 国产女人18水真多18精品一级做|