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

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

?? 原始 -swingutilities.java

?? 王森的《Java&&PDA設計入門》源碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* * @(#)SwingUtilities.java	1.80 99/04/22 * * Copyright 1997-1999 by Sun Microsystems, Inc., * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. * All rights reserved. *  * This software is the confidential and proprietary information * of Sun Microsystems, Inc. ("Confidential Information").  You * shall not disclose such Confidential Information and shall use * it only in accordance with the terms of the license agreement * you entered into with Sun. */package javax.swing;import java.applet.*;import java.awt.*;import java.awt.event.*;import java.util.Vector;import java.util.Hashtable;import java.lang.reflect.*;import javax.accessibility.*;import javax.swing.text.View;/** * A collection of utility methods for Swing. * * @version 1.80 04/22/99 * @author unknown */public class SwingUtilities implements SwingConstants{    // These states are system-wide, rather than AppContext wide.    private static boolean canAccessEventQueue = false;    private static boolean eventQueueTested = false;    /**      * Return true if <code>a</code> contains <code>b</code>     */    public static final boolean isRectangleContainingRectangle(Rectangle a,Rectangle b) {        if (b.x >= a.x && (b.x + b.width) <= (a.x + a.width) &&            b.y >= a.y && (b.y + b.height) <= (a.y + a.height)) {            return true;        }        return false;    }    /**     * Return the rectangle (0,0,bounds.width,bounds.height) for the component <code>aComponent</code>     */    public static Rectangle getLocalBounds(Component aComponent) {        Rectangle b = new Rectangle(aComponent.getBounds());        b.x = b.y = 0;        return b;    }    /**     * @return the first Window ancestor of c     */    private static Window getWindowAncestor(Component c) {        for(Container p = c.getParent(); p != null; p = p.getParent()) {            if (p instanceof Window) {                return (Window)p;            }        }        return null;    }    /**     * Convert a <code>aPoint</code> in <code>source</code> coordinate system to     * <code>destination</code> coordinate system.     * If <code>source></code>is null,<code>aPoint</code> is assumed to be in <code>destination</code>'s     * root component coordinate system.     * If <code>destination</code>is null, <code>aPoint</code> will be converted to <code>source</code>'s     * root component coordinate system.     * If both <code>source</code> and <code>destination</code> are null, return <code>aPoint</code>     * without any conversion.     */    public static Point convertPoint(Component source,Point aPoint,Component destination) {        Point p;        if(source == null && destination == null)            return aPoint;        if(source == null) {            source = getWindowAncestor(destination);            if(source == null)                throw new Error("Source component not connected to component tree hierarchy");        }        p = new Point(aPoint);        convertPointToScreen(p,source);        if(destination == null) {            destination = getWindowAncestor(source);            if(destination == null)                throw new Error("Destination component not connected to component tree hierarchy");        }        convertPointFromScreen(p,destination);        return p;    }    /**     * Convert the point <code>(x,y)</code> in <code>source</code> coordinate system to     * <code>destination</code> coordinate system.     * If <code>source></code>is null,<code>(x,y)</code> is assumed to be in <code>destination</code>'s     * root component coordinate system.     * If <code>destination</code>is null, <code>(x,y)</code> will be converted to <code>source</code>'s     * root component coordinate system.     * If both <code>source</code> and <code>destination</code> are null, return <code>(x,y)</code>     * without any conversion.     */    public static Point convertPoint(Component source,int x, int y,Component destination) {        Point point = new Point(x,y);        return convertPoint(source,point,destination);    }    /**      * Convert the rectangle <code>aRectangle</code> in <code>source</code> coordinate system to     * <code>destination</code> coordinate system.     * If <code>source></code>is null,<code>aRectangle</code> is assumed to be in <code>destination</code>'s     * root component coordinate system.     * If <code>destination</code>is null, <code>aRectangle</code> will be converted to <code>source</code>'s     * root component coordinate system.     * If both <code>source</code> and <code>destination</code> are null, return <code>aRectangle</code>     * without any conversion.     */    public static Rectangle convertRectangle(Component source,Rectangle aRectangle,Component destination) {        Point point = new Point(aRectangle.x,aRectangle.y);        point =  convertPoint(source,point,destination);        return new Rectangle(point.x,point.y,aRectangle.width,aRectangle.height);    }    /**     * Convenience method for searching above <code>comp</code> in the     * component hierarchy and returns the first object of class <code>c</code> it     * finds. Can return null, if a class <code>c</code> cannot be found.     */    public static Container getAncestorOfClass(Class c, Component comp) {        if(comp == null || c == null)            return null;        Container parent = comp.getParent();        while(parent != null && !(c.isInstance(parent)))            parent = parent.getParent();        return parent;    }    /**     * Convenience method for searching above <code>comp</code> in the     * component hierarchy and returns the first object of <code>name</code> it     * finds. Can return null, if <code>name</code> cannot be found.     */    public static Container getAncestorNamed(String name, Component comp) {        if(comp == null || name == null)            return null;        Container parent = comp.getParent();        while(parent != null && !(name.equals(parent.getName())))            parent = parent.getParent();        return parent;    }    /**     * Returns the deepest visible descendent Component of <code>parent</code>      * that contains the location <code>x</code>, <code>y</code>.      * If <code>parent</code> does not contain the specified location,     * then <code>null</code> is returned.  If <code>parent</code> is not a      * container, or none of <code>parent</code>'s visible descendents      * contain the specified location, <code>parent</code> is returned.     *     * @param parent the root component to begin the search     * @param x the x target location      * @param y the y target location       */    public static Component getDeepestComponentAt(Component parent, int x, int y) {        if (!parent.contains(x, y)) {            return null;        }        if (parent instanceof Container) {                    Component components[] = ((Container)parent).getComponents();            for (int i = 0 ; i < components.length ; i++) {                Component comp = components[i];                if (comp != null && comp.isVisible()) {                    Point loc = comp.getLocation();                    if (comp instanceof Container) {                        comp = getDeepestComponentAt(comp, x - loc.x, y - loc.y);                    } else {                        comp = comp.getComponentAt(x - loc.x, y - loc.y);                    }                    if (comp != null && comp.isVisible()) {                        return comp;                    }                }            }        }        return parent;    }    /**      * Returns a MouseEvent similar to <code>sourceEvent</code> except that its x     * and y members have been converted to <code>destination</code>'s coordinate     * system.  If <code>source</code> is null, <code>sourceEvent</code> x and y members     * are assumed to be into <code>destination<code>'s root component coordinate system.     * If <code>destination</code> is <code>null</code>, the     * returned MouseEvent will be in <code>source</code>'s coordinate system.     * <code>sourceEvent</code> will not be changed. A new event is returned.     * the <code>source</code> field of the returned event will be set     * to <code>destination</code> if destination is non null     * use the translateMouseEvent() method to translate a mouse event from     * one component to another without changing the source.     */    public static MouseEvent convertMouseEvent(Component source,                                               MouseEvent sourceEvent,                                               Component destination) {        Point p = convertPoint(source,new Point(sourceEvent.getX(),                                                sourceEvent.getY()),                               destination);        Component newSource;        if(destination != null)            newSource = destination;        else            newSource = source;        return new MouseEvent(newSource,                              sourceEvent.getID(),                              sourceEvent.getWhen(),                              sourceEvent.getModifiers(),                              p.x,p.y,                              sourceEvent.getClickCount(),                              sourceEvent.isPopupTrigger());    }    /**     * Convert a point from a component's coordinate system to     * screen coordinates.     *     * @param p  a Point object (converted to the new coordinate system)     * @param c  a Component object     */    public static void convertPointToScreen(Point p,Component c) {            Rectangle b;            int x,y;            do {                if(c instanceof JComponent) {                    x = ((JComponent)c).getX();                    y = ((JComponent)c).getY();                } else if(c instanceof java.applet.Applet) {                    Point pp = c.getLocationOnScreen();                    x = pp.x;                    y = pp.y;                } else {                    b = c.getBounds();                    x = b.x;                    y = b.y;                }                p.x += x;                p.y += y;                if(c instanceof java.awt.Window || c instanceof java.applet.Applet)                    break;                c = c.getParent();            } while(c != null);        }    /**     * Convert a point from a screen coordinates to a component's      * coordinate system     *     * @param p  a Point object (converted to the new coordinate system)     * @param c  a Component object     */    public static void convertPointFromScreen(Point p,Component c) {        Rectangle b;        int x,y;        do {            if(c instanceof JComponent) {                x = ((JComponent)c).getX();                y = ((JComponent)c).getY();            }  else if(c instanceof java.applet.Applet) {                Point pp = c.getLocationOnScreen();                x = pp.x;                y = pp.y;            } else {                b = c.getBounds();                x = b.x;                y = b.y;            }            p.x -= x;            p.y -= y;            if(c instanceof java.awt.Window || c instanceof java.applet.Applet)                break;            c = c.getParent();        } while(c != null);    }    /** Return <code>aComponent</code>'s window **/    public static Window windowForComponent(Component aComponent) {        for (Container p = aComponent.getParent(); p != null; p = p.getParent()) {            if (p instanceof Window) {                return (Window)p;            }        }        return null;    }    /**     * Return <code>true</code> if a component <code>a</code> descends from a component <code>b</code>     */    public static boolean isDescendingFrom(Component a,Component b) {        if(a == b)            return true;        for(Container p = a.getParent();p!=null;p=p.getParent())            if(p == b)                return true;        return false;    }    /**     * Convenience to calculate an intersection of two rectangles without allocating a new rectangle     * Return dest.     */    public static Rectangle computeIntersection(int x,int y,int width,int height,Rectangle dest) {        int x1 = (x > dest.x) ? x : dest.x;        int x2 = ((x+width) < (dest.x + dest.width)) ? (x+width) : (dest.x + dest.width);        int y1 = (y > dest.y) ? y : dest.y;        int y2 = ((y + height) < (dest.y + dest.height) ? (y+height) : (dest.y + dest.height));        dest.x = x1;        dest.y = y1;        dest.width = x2 - x1;        dest.height = y2 - y1;	// If rectangles don't intersect, return zero'd intersection.	if (dest.width < 0 || dest.height < 0) {	    dest.x = dest.y = dest.width = dest.height = 0;	}        return dest;    }    /**     * Convenience to calculate the union of two rectangles without allocating a new rectangle     * Return dest     */    public static Rectangle computeUnion(int x,int y,int width,int height,Rectangle dest) {        int x1 = (x < dest.x) ? x : dest.x;        int x2 = ((x+width) > (dest.x + dest.width)) ? (x+width) : (dest.x + dest.width);        int y1 = (y < dest.y) ? y : dest.y;        int y2 = ((y+height) > (dest.y + dest.height)) ? (y+height) : (dest.y + dest.height);        dest.x = x1;        dest.y = y1;        dest.width = (x2 - x1);        dest.height= (y2 - y1);        return dest;    }    /**     * Convenience returning an array of rect representing the regions within     * <code>rectA</code> that do not overlap with <code>rectB</code>. If the     * two Rects do not overlap, returns an empty array     */    public static Rectangle[] computeDifference(Rectangle rectA,Rectangle rectB) {        if (rectB == null || !rectA.intersects(rectB) || isRectangleContainingRectangle(rectB,rectA)) {            return new Rectangle[0];        }        Rectangle t = new Rectangle();        Rectangle a=null,b=null,c=null,d=null;        Rectangle result[];        int rectCount = 0;        /* rectA contains rectB */        if (isRectangleContainingRectangle(rectA,rectB)) {            t.x = rectA.x; t.y = rectA.y; t.width = rectB.x - rectA.x; t.height = rectA.height;            if(t.width > 0 && t.height > 0) {                a = new Rectangle(t);                rectCount++;            }            t.x = rectB.x; t.y = rectA.y; t.width = rectB.width; t.height = rectB.y - rectA.y;            if(t.width > 0 && t.height > 0) {                b = new Rectangle(t);                rectCount++;            }            t.x = rectB.x; t.y = rectB.y + rectB.height; t.width = rectB.width;            t.height = rectA.y + rectA.height - (rectB.y + rectB.height);            if(t.width > 0 && t.height > 0) {                c = new Rectangle(t);                rectCount++;            }            t.x = rectB.x + rectB.width; t.y = rectA.y; t.width = rectA.x + rectA.width - (rectB.x + rectB.width);            t.height = rectA.height;            if(t.width > 0 && t.height > 0) {                d = new Rectangle(t);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区在线看| 在线一区二区三区做爰视频网站| 91蜜桃网址入口| 亚洲精品在线免费播放| 一区二区三区美女| 成人天堂资源www在线| 日韩精品一区国产麻豆| 亚洲第一二三四区| 91亚洲男人天堂| 国产精品视频一二三| 久久99精品久久久久久久久久久久| 91国偷自产一区二区使用方法| 日本一区二区免费在线观看视频| 免费看欧美美女黄的网站| 91国偷自产一区二区使用方法| 亚洲国产电影在线观看| 国产乱码精品一区二区三区av| 欧美一区二区三区公司| 亚洲bt欧美bt精品| 欧美日韩国产影片| 亚洲无线码一区二区三区| 欧美美女视频在线观看| 亚洲成人777| 在线观看91精品国产麻豆| 亚洲图片欧美一区| 欧美日韩精品一区二区三区四区| 一区二区免费在线| 在线一区二区三区做爰视频网站| 亚洲激情图片小说视频| 在线观看欧美精品| 午夜精品久久久久久久久久| 欧美日韩国产高清一区| 午夜久久电影网| 日韩午夜激情av| 激情久久五月天| 国产欧美日产一区| 成人黄色av电影| 亚洲欧美国产高清| 欧美挠脚心视频网站| 午夜精品免费在线| 日韩免费成人网| 国产成人精品三级| 亚洲免费毛片网站| 欧美剧情片在线观看| 精品影视av免费| 中文无字幕一区二区三区| 91看片淫黄大片一级在线观看| 亚洲综合在线视频| 日韩一区二区三区精品视频| 国内精品伊人久久久久影院对白| 日本一区二区三区电影| 色视频欧美一区二区三区| 日韩高清中文字幕一区| 久久久久88色偷偷免费| 色天使久久综合网天天| 久久精品国产精品亚洲精品| 中文字幕av一区二区三区免费看 | 在线精品亚洲一区二区不卡| 性做久久久久久久免费看| 精品伦理精品一区| 不卡的av在线| 美女在线一区二区| 亚洲色图丝袜美腿| 日韩精品一区二区在线| 99久久精品免费精品国产| 日韩中文字幕区一区有砖一区 | 91农村精品一区二区在线| 午夜伦欧美伦电影理论片| 久久亚洲影视婷婷| 在线观看亚洲专区| 韩国v欧美v亚洲v日本v| 亚洲综合图片区| 国产视频一区二区在线| 欧美色图免费看| 粗大黑人巨茎大战欧美成人| 青青草国产成人av片免费| 国产欧美一区二区三区网站| 欧美久久久久久久久中文字幕| 成人高清在线视频| 麻豆精品一二三| 亚洲第一久久影院| 中文字幕永久在线不卡| 久久亚洲一区二区三区明星换脸| 欧美日韩一区三区| 99久久综合99久久综合网站| 美女视频一区二区三区| 亚洲高清视频的网址| 中文字幕一区二区视频| 精品国产一区二区在线观看| 精品视频1区2区| 在线观看视频欧美| 99精品1区2区| 99免费精品在线观看| 国产成都精品91一区二区三 | 香蕉影视欧美成人| 亚洲老司机在线| 日韩码欧中文字| 中文字幕免费观看一区| 久久午夜羞羞影院免费观看| 日韩亚洲欧美一区| 欧美精品国产精品| 欧美精品亚洲二区| 欧美理论电影在线| 在线播放日韩导航| 欧美剧在线免费观看网站 | 天天色天天操综合| 亚洲午夜影视影院在线观看| 一区二区三区在线播| 亚洲免费视频成人| 亚洲精品日日夜夜| 一区二区三区欧美久久| 一区二区三区在线看| 夜夜嗨av一区二区三区网页| 亚洲国产视频在线| 日韩成人dvd| 免费看日韩精品| 国产在线麻豆精品观看| 国产在线国偷精品产拍免费yy| 国产中文一区二区三区| 国产.精品.日韩.另类.中文.在线.播放| 国产真实精品久久二三区| 国产精品一区二区久久精品爱涩| 国产福利一区二区三区视频| 成人国产电影网| 色婷婷av一区二区三区大白胸| 日本道精品一区二区三区| 欧美日韩久久一区| 欧美精品一区男女天堂| 国产欧美精品国产国产专区| 自拍偷拍欧美激情| 亚洲妇熟xx妇色黄| 麻豆91小视频| 99这里只有精品| 91麻豆精品91久久久久同性| 精品福利在线导航| 亚洲欧美一区二区在线观看| 亚洲一区二区三区中文字幕在线| 日韩专区中文字幕一区二区| 国内精品第一页| 91视频免费播放| 欧美一级免费观看| 国产精品嫩草久久久久| 亚洲成av人片观看| 国产盗摄一区二区| 欧美色区777第一页| 久久久久久一二三区| 一区二区免费看| 国产一区二区三区精品欧美日韩一区二区三区 | 久久精品国产成人一区二区三区 | 亚洲女与黑人做爰| 蜜桃视频在线观看一区二区| 成人va在线观看| 日韩色视频在线观看| 亚洲免费在线观看| 国产成人午夜99999| 欧美精品一级二级三级| 国产精品乱码妇女bbbb| 日本不卡免费在线视频| 成人黄色a**站在线观看| 欧美一区二区在线视频| 国产精品成人免费| 精品午夜一区二区三区在线观看| 日本国产一区二区| 国产视频一区二区在线| 日本欧美一区二区| 欧美午夜片在线看| 中文字幕一区二区三区在线不卡 | 久久久久免费观看| 免费一级片91| 欧美人妇做爰xxxⅹ性高电影| 欧美国产日本视频| 久久99九九99精品| 欧美一卡2卡3卡4卡| 亚洲电影在线播放| 91免费视频观看| **网站欧美大片在线观看| 国产综合色视频| 精品国产乱子伦一区| 日韩电影在线观看电影| 欧美在线看片a免费观看| 亚洲视频一区在线| 99久久久久久| 国产精品免费aⅴ片在线观看| 久久精品国产亚洲a| 91麻豆精品国产91久久久久久久久| 亚洲人成人一区二区在线观看| 成人av资源网站| 国产精品久久久久一区二区三区| 国产精品一区二区x88av| 精品少妇一区二区三区免费观看| 日韩影视精彩在线| 欧美人与禽zozo性伦| 亚洲成人黄色影院| 欧美日韩三级一区二区| 亚洲h动漫在线| 欧美一级一区二区| 久久国产乱子精品免费女| 日韩精品一区二区三区四区 | 蜜臀av一级做a爰片久久| 制服丝袜中文字幕亚洲|