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

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

?? frameview.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
字號:
/* * @(#)FrameView.java	1.28 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.util.*;import java.net.*;import java.io.*;import javax.swing.*;import javax.swing.text.*;import javax.swing.event.*;/** * Implements a FrameView, intended to support the HTML * &lt;FRAME&gt; tag.  Supports the frameborder, scrolling, * marginwidth and marginheight attributes. * * @author    Sunita Mani * @version   1.28, 12/19/03 */class FrameView extends ComponentView implements HyperlinkListener {    JEditorPane htmlPane;    JScrollPane scroller;    boolean editable;    float width;    float height;    URL src;    /** Set to true when the component has been created. */    private boolean createdComponent;    /**     * Creates a new Frame.     *     * @param elem the element to represent.     */    public FrameView(Element elem) {	super(elem);    }    protected Component createComponent() {	Element elem = getElement();	AttributeSet attributes = elem.getAttributes();	String srcAtt = (String)attributes.getAttribute(HTML.Attribute.SRC);	if ((srcAtt != null) && (!srcAtt.equals(""))) {	    try {		URL base = ((HTMLDocument)elem.getDocument()).getBase();		src = new URL(base, srcAtt);                htmlPane = new FrameEditorPane();                htmlPane.addHyperlinkListener(this);                JEditorPane host = getHostPane();                boolean isAutoFormSubmission = true;                if (host != null) {                    htmlPane.setEditable(host.isEditable());		    String charset = (String) host.getClientProperty("charset");		    if (charset != null) {			htmlPane.putClientProperty("charset", charset);		    }                    HTMLEditorKit hostKit = (HTMLEditorKit)host.getEditorKit();		    if (hostKit != null) {			isAutoFormSubmission = hostKit.isAutoFormSubmission();		    }                }                htmlPane.setPage(src);                HTMLEditorKit kit = (HTMLEditorKit)htmlPane.getEditorKit();		if (kit != null) {		    kit.setAutoFormSubmission(isAutoFormSubmission);		}		Document doc = htmlPane.getDocument();		if (doc instanceof HTMLDocument) {		    ((HTMLDocument)doc).setFrameDocumentState(true);		}		setMargin();		createScrollPane();		setBorder();	    } catch (MalformedURLException e) {		e.printStackTrace();	    } catch (IOException e1) {		e1.printStackTrace();	    }	}	createdComponent = true;	return scroller;    }    JEditorPane getHostPane() {	Container c = getContainer();	while ((c != null) && ! (c instanceof JEditorPane)) {	    c = c.getParent();	}	return (JEditorPane) c;    }    /**     * Sets the parent view for the FrameView.     * Also determines if the FrameView should be editable     * or not based on whether the JTextComponent that     * contains it is editable.     *     * @param parent View     */    public void setParent(View parent) {	if (parent != null) {	    JTextComponent t = (JTextComponent)parent.getContainer();	    editable = t.isEditable();	}	super.setParent(parent);    }        /**     * Also determines if the FrameView should be editable     * or not based on whether the JTextComponent that     * contains it is editable. And then proceeds to call     * the superclass to do the paint().     *     * @param parent View     * @see text.ComponentView#paint     */    public void paint(Graphics g, Shape allocation) {	Container host = getContainer();	if (host != null && htmlPane != null &&	    htmlPane.isEditable() != ((JTextComponent)host).isEditable()) {	    editable = ((JTextComponent)host).isEditable();	    htmlPane.setEditable(editable);	}        super.paint(g, allocation);    }    /**     * If the marginwidth or marginheight attributes have been specified,     * then the JEditorPane's margin's are set to the new values.     */    private void setMargin() {	int margin = 0;	Insets in = htmlPane.getMargin();	Insets newInsets;	boolean modified = false;	AttributeSet attributes = getElement().getAttributes();	String marginStr = (String)attributes.getAttribute(HTML.Attribute.MARGINWIDTH);	if ( in != null) {	    newInsets = new Insets(in.top, in.left, in.right, in.bottom);	} else {	    newInsets = new Insets(0,0,0,0);	}	if (marginStr != null) {	    margin = Integer.parseInt(marginStr);	    if (margin > 0) {		newInsets.left = margin;		newInsets.right = margin;		modified = true;	    }	}	marginStr = (String)attributes.getAttribute(HTML.Attribute.MARGINHEIGHT);	if (marginStr != null) {	    margin = Integer.parseInt(marginStr);	    if (margin > 0) {		newInsets.top = margin;		newInsets.bottom = margin;		modified = true;	    }	}	if (modified) {	    htmlPane.setMargin(newInsets);	}    }    /**     * If the frameborder attribute has been specified, either in the frame,     * or by the frames enclosing frameset, the JScrollPane's setBorder()     * method is invoked to achieve the desired look.     */    private void setBorder() {	AttributeSet attributes = getElement().getAttributes();	String frameBorder = (String)attributes.getAttribute(HTML.Attribute.FRAMEBORDER);	if ((frameBorder != null) && 	    (frameBorder.equals("no") || frameBorder.equals("0"))) {	    // make invisible borders.	    scroller.setBorder(null);	}    }    /**     * This method creates the JScrollPane.  The scrollbar policy is determined by     * the scrolling attribute.  If not defined, the default is "auto" which      * maps to the scrollbar's being displayed as needed.     */    private void createScrollPane() {	AttributeSet attributes = getElement().getAttributes();	String scrolling = (String)attributes.getAttribute(HTML.Attribute.SCROLLING);	if (scrolling == null) {	    scrolling = "auto";	}		if (!scrolling.equals("no")) {	    if (scrolling.equals("yes")) {		scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, 					   JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);	    } else {		// scrollbars will be displayed if needed		//		scroller = new JScrollPane();	    } 	} else {	    scroller = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_NEVER, 				       JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);	}	JViewport vp = scroller.getViewport();	vp.add(htmlPane);	vp.setBackingStoreEnabled(true);	scroller.setMinimumSize(new Dimension(5,5));	scroller.setMaximumSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));    }    /**     * Finds the outermost FrameSetView.  It then     * returns that FrameSetView's container.     */    private JEditorPane getOutermostJEditorPane() {	View parent = getParent();	FrameSetView frameSetView = null;	while (parent != null) {	    if (parent instanceof FrameSetView) {		frameSetView = (FrameSetView)parent;	    }	    parent = parent.getParent();	}	if (frameSetView != null) {	    return (JEditorPane)frameSetView.getContainer();	}	return null;    }    /**     * Returns true if this frame is contained within     * a nested frameset.     */    private boolean inNestedFrameSet() {	FrameSetView parent = (FrameSetView)getParent();	return (parent.getParent() instanceof FrameSetView);    }    /**     * Notification of a change relative to a      * hyperlink. This method searches for the outermost     * JEditorPane, and then fires an HTMLFrameHyperlinkEvent     * to that frame.  In addition, if the target is _parent,     * and there is not nested framesets then the target is     * reset to _top.  If the target is _top, in addition to     * firing the event to the outermost JEditorPane, this     * method also invokes the setPage() method and explicitly     * replaces the current document with the destination url.     *     * @param HyperlinkEvent     */    public void hyperlinkUpdate(HyperlinkEvent evt) {	JEditorPane c = getOutermostJEditorPane();	if (c == null) {	    return;	}	if (!(evt instanceof HTMLFrameHyperlinkEvent)) {	    c.fireHyperlinkUpdate(evt);	    return;	}	HTMLFrameHyperlinkEvent e = (HTMLFrameHyperlinkEvent)evt;	if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {	    String target = e.getTarget();	    if (e.getTarget().equals("_parent") && !inNestedFrameSet()){ 		target = "_top";	    }            if (evt instanceof FormSubmitEvent) {                HTMLEditorKit kit = (HTMLEditorKit)c.getEditorKit();                if (kit != null && kit.isAutoFormSubmission()) {		    if (target.equals("_top")) {			try {			    c.setPage(e.getURL());			} catch (IOException ex) {			    // Need a way to handle exceptions			}		    } else {			HTMLDocument doc = (HTMLDocument)c.getDocument();			doc.processHTMLFrameHyperlinkEvent(e);		    }                } else {                    c.fireHyperlinkUpdate(evt);                }                return;            }	    if (target.equals("_top")) {		try {		    c.setPage(e.getURL());		} catch (IOException ex) {		    // Need a way to handle exceptions		    // ex.printStackTrace();		}	    }	    if (!c.isEditable()) {		c.fireHyperlinkUpdate(new HTMLFrameHyperlinkEvent(c,								  e.getEventType(), 								  e.getURL(), 								  e.getDescription(),								  getElement(),								  target));	    }	}    }    /**     * Gives notification from the document that attributes were changed     * in a location that this view is responsible for.  Currently this view     * handles changes to its SRC attribute.     *     * @param e 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     *     */        public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f) {	Element elem = getElement();	AttributeSet attributes = elem.getAttributes();	URL oldPage = src;	String srcAtt = (String)attributes.getAttribute(HTML.Attribute.SRC);	URL base = ((HTMLDocument)elem.getDocument()).getBase();	try {	    src = new URL(base, srcAtt);	    if (!createdComponent) {		return;	    }	    if (oldPage.equals(src) && (src.getRef() == null)) {		return;	    }	    htmlPane.setPage(src);	    Document newDoc = htmlPane.getDocument();	    if (newDoc instanceof HTMLDocument) {		((HTMLDocument)newDoc).setFrameDocumentState(true);	    }	} catch (MalformedURLException e1) {	    // Need a way to handle exceptions	    //e1.printStackTrace();	} catch (IOException e2) {	    // Need a way to handle exceptions	    //e2.printStackTrace();	}    }    /**     * Determines the minimum span for this view along an     * axis.     *     * @param axis may be either <code>View.X_AXIS</code> or      *	<code>View.Y_AXIS</code>     * @return the preferred span; given that we do not     * support resizing of frames, the minimum span returned     * is the same as the preferred span     *      */    public float getMinimumSpan(int axis) {      return 5;    }    /**     * Determines the maximum span for this view along an     * axis.     *     * @param axis may be either <code>View.X_AXIS</code> or      *	<code>View.Y_AXIS</code>     * @return the preferred span; given that we do not     * support resizing of frames, the maximum span returned     * is the same as the preferred span     *      */    public float getMaximumSpan(int axis) {	return Integer.MAX_VALUE;    }    /** Editor pane rendering frame of HTML document     *  It uses the same editor kits classes as outermost JEditorPane     */    private class FrameEditorPane extends JEditorPane {        public EditorKit getEditorKitForContentType(String type) {            EditorKit editorKit = super.getEditorKitForContentType(type);             JEditorPane outerMostJEditorPane = null;            if ((outerMostJEditorPane = getOutermostJEditorPane()) != null) {                EditorKit inheritedEditorKit = outerMostJEditorPane.getEditorKitForContentType(type);                if (! editorKit.getClass().equals(inheritedEditorKit.getClass())) {                    editorKit = (EditorKit) inheritedEditorKit.clone();                    setEditorKitForContentType(type, editorKit);                }            }             return editorKit;        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色系网站成人免费| 国产精品午夜电影| 亚洲欧美成aⅴ人在线观看| 美女任你摸久久| 色激情天天射综合网| 国产欧美一区二区精品忘忧草| 一区二区三区日韩精品视频| 成人永久免费视频| 精品国产污网站| 理论电影国产精品| 欧美另类高清zo欧美| 夜夜揉揉日日人人青青一国产精品| 高清免费成人av| 精品国产免费一区二区三区香蕉| 丝瓜av网站精品一区二区| 在线看国产一区二区| 亚洲欧美视频在线观看视频| 成人综合激情网| 欧美韩国日本综合| 粉嫩在线一区二区三区视频| 精品欧美一区二区在线观看| 三级成人在线视频| 欧美日韩国产精选| 亚洲福利一区二区| 欧美日韩黄色影视| 五月婷婷另类国产| 欧美精品久久久久久久久老牛影院| 依依成人综合视频| 欧美三级视频在线观看| 亚洲一区二区三区免费视频| 欧美三区在线观看| 日韩**一区毛片| 欧美一区二区在线不卡| 久久精工是国产品牌吗| 亚洲精品在线观看网站| 国产一区二区在线电影| 日本一区二区在线不卡| 99国产精品国产精品久久| 亚洲婷婷综合久久一本伊一区| 91丨九色丨尤物| 亚洲伊人色欲综合网| 欧美日韩美女一区二区| 裸体健美xxxx欧美裸体表演| 精品不卡在线视频| 丁香天五香天堂综合| 亚洲日本一区二区| 欧美精品1区2区3区| 久久精品二区亚洲w码| 久久精品一区四区| 一本色道久久综合狠狠躁的推荐| 一区二区三区在线视频播放| 91精品在线观看入口| 国产麻豆成人精品| 亚洲视频你懂的| 欧美一级高清大全免费观看| 国产精品自拍三区| 一区二区三区在线观看视频| 欧美日韩国产天堂| 国产一区不卡精品| 一区二区三区在线视频免费| 欧美一级在线免费| 成人av先锋影音| 日本视频一区二区三区| 国产精品乱码一区二三区小蝌蚪| 欧美日韩一区高清| 国产精品伊人色| 亚洲高清免费一级二级三级| 欧美精品一区二区三区视频| 91丨国产丨九色丨pron| 免费日韩伦理电影| 亚洲女人****多毛耸耸8| 日韩视频中午一区| 91在线观看免费视频| 美女视频黄a大片欧美| 亚洲免费高清视频在线| 久久亚洲捆绑美女| 欧美日韩国产高清一区二区三区| 国产成人午夜片在线观看高清观看| 一级做a爱片久久| 久久久精品免费网站| 制服丝袜成人动漫| 91麻豆.com| 国产超碰在线一区| 免费在线观看日韩欧美| 亚洲主播在线观看| 亚洲欧美综合色| 精品国产1区2区3区| 在线成人免费观看| 在线观看欧美黄色| 99国产精品久| 成人美女在线观看| 国产麻豆精品一区二区| 麻豆精品在线播放| 亚洲高清免费视频| 亚洲免费av观看| 中文字幕佐山爱一区二区免费| 久久蜜桃av一区二区天堂| 911国产精品| 欧美日本在线播放| 97成人超碰视| 福利电影一区二区| 国产精品资源在线| 国产一区二区伦理片| 日本美女一区二区| 免费看欧美美女黄的网站| 亚洲成av人片在线| 天天操天天干天天综合网| 亚洲一区在线播放| 亚洲一区二区三区国产| 夜夜精品视频一区二区| 亚洲图片欧美一区| 亚洲成人自拍网| 日日夜夜一区二区| 男男成人高潮片免费网站| 免费在线欧美视频| 激情偷乱视频一区二区三区| 狂野欧美性猛交blacked| 精品伊人久久久久7777人| 精品一区二区在线播放| 精品一区二区国语对白| 国产麻豆精品在线| 成人午夜激情在线| 91亚洲资源网| 91国内精品野花午夜精品| 欧美女孩性生活视频| 日韩三级精品电影久久久| 精品国产一区a| 国产精品三级视频| 一区二区三区精品视频在线| 亚洲国产一区二区视频| 日韩av电影免费观看高清完整版在线观看| 日日夜夜精品视频天天综合网| 免费av成人在线| 丁香婷婷综合激情五月色| 一本一道久久a久久精品| 在线播放欧美女士性生活| 精品久久国产字幕高潮| 国产精品日韩精品欧美在线| 亚洲精品视频自拍| 蜜桃在线一区二区三区| 国产999精品久久| 欧美色图片你懂的| www亚洲一区| 亚洲青青青在线视频| 蜜臀a∨国产成人精品| www.亚洲人| 欧美一区二区啪啪| 久久久精品tv| 香蕉av福利精品导航| 国产剧情一区二区| 欧美日韩视频在线第一区| 久久老女人爱爱| 五月综合激情网| 成人激情图片网| 91.xcao| 国产精品久久久久久久久晋中| 五月激情综合色| fc2成人免费人成在线观看播放| 欧美美女网站色| 1024成人网| 国产乱对白刺激视频不卡| 欧美日韩在线三区| 欧美国产成人精品| 久久国产麻豆精品| 欧美无砖专区一中文字| 国产精品久久三| 久草在线在线精品观看| 欧美日韩中文精品| 国产精品国产三级国产有无不卡| 麻豆91免费看| 欧美日韩精品三区| 亚洲激情六月丁香| 风间由美一区二区av101| 精品国产凹凸成av人导航| 亚洲电影在线免费观看| 91丨九色丨国产丨porny| 国产人成亚洲第一网站在线播放| 日韩国产高清影视| 在线欧美小视频| 亚洲日本成人在线观看| 成人蜜臀av电影| 中文字幕精品三区| 国产精品主播直播| 精品动漫一区二区三区在线观看| 午夜激情久久久| 欧洲国内综合视频| 亚洲伦理在线精品| av亚洲精华国产精华| 国产日韩欧美综合在线| 国产精品一品二品| 久久这里只有精品6| 国产一区二区在线看| 欧美精品一区二区三区四区| 精品亚洲欧美一区| 日韩精品一区二区三区四区| 久久国产婷婷国产香蕉| 欧美大度的电影原声| 久久精品国产秦先生| 亚洲精品一区二区三区影院| 精品一区二区久久久|