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

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

?? horizmenu.java

?? Java菜單編程有幾種類型供大家使用
?? JAVA
字號:
/*     Copyright: Sun Microsystems 1997.  All rights reserved.    Author: Patrick Chan (www.xeo.com)   7/19/96    Version: 1.1	Modified by Phil Bartholo to create a horizontal nav	bar.*/    import java.applet.*;import java.awt.*;import java.util.*;import java.net.*;public class horizMenu extends Applet {    // The background image.  This had better not be null.    Image image;    // These two fields are used to do double-buffering.    // The dimensions of bbuf is exactly the dimensions of the applet.    Image bbuf;    Graphics bbufG;    // This field is set to true only when the background image has    // completely loaded.    boolean imageDone;    /* Menu data */    Rectangle[] hitArea;    Rectangle[] srcRect;    Point[] dstPt;    boolean[] down;    String[] url;    /* Submenu data */    String[][] itemUrl;    String[][] item;	/* Margins to draw menu items */	int rightLimit;	int bottomLimit;    // If >= 0, this fields holds the index of the current menu.    // If -1, no menu is current.    int curMenu;    // If >= 0, this fields holds the index of the current menu item.    // If -1, no menu item is current.    int curMenuItem = -1;    // This is an array of rectangles - one rectangle for each menu item.      // Each rectangle specifies the    // location (relative to the left-corner of the applet) of a menu item.    //    // menuItemRect is null when curMenu is -1.    // It becomes non-null when curMenu >= 0.    //    // Note: it would have been better programming to define classes for     // the menu and menu items.  However, I decided for this little applet    // to keep the number of class files to a minimum to minimize the download    // time.      Rectangle[] menuItemRect;    // This is the color to paint "behind" the image.    Color bgColor;    // [0] is the text color of a menu item; [1] is the text color of a highlighted    // menu item.    Color fgMenuColor[] = new Color[2];    // This is the background of a menu item; [1] is the background color of a    // highlighted menu item.    Color bgMenuColor[] = new Color[2];    // marginH is the number of pixels on the left and right edges of the menu.    // marginV is the number of pixels on the top and bottom edges of the menu.    int marginH, marginV;    // This is the font used to display the menu item labels.    Font f;    // This is the font metrics of 'f'.      FontMetrics fm;    public void init() {	int[] ints;        // Grab applet parameters.        image = getImage(getCodeBase(), getParameter("image"));        marginH = Integer.parseInt(getParameter("marginh"));        marginV = Integer.parseInt(getParameter("marginv"));        // Get color parameters.	ints = parseInt(getParameter("bg-color"), " ");        bgColor = new Color(ints[0], ints[1], ints[2]);	ints = parseInt(getParameter("fg-menu-color"), " ");        fgMenuColor[0] = new Color(ints[0], ints[1], ints[2]);	ints = parseInt(getParameter("fg-hi-menu-color"), " ");        fgMenuColor[1] = new Color(ints[0], ints[1], ints[2]);	ints = parseInt(getParameter("bg-menu-color"), " ");        bgMenuColor[0] = new Color(ints[0], ints[1], ints[2]);	ints = parseInt(getParameter("bg-hi-menu-color"), " ");        bgMenuColor[1] = new Color(ints[0], ints[1], ints[2]);        // Create back buffer for double-buffering.        bbuf = createImage(size().width, size().height);        bbufG = bbuf.getGraphics();        // Determine the font from the font-height.        int fh = Integer.parseInt(getParameter("font-height"));        int i = fh;        while (i > 10) {            f = new Font(getParameter("font"), Font.PLAIN, i);            fm = getFontMetrics(f);            if (fm.getHeight() <= fh) {                break;            }            i--;        }         // Get the menu parameters.        for (i=0; ; i++) {            if (getParameter("menu"+i) == null) {                hitArea = new Rectangle[i];                srcRect = new Rectangle[i];                dstPt = new Point[i];                url = new String[i];		down = new boolean[i];                itemUrl = new String[i][];		item = new String[i][];                break;            }        }        for (i=0; i<hitArea.length; i++) {	    String[] fields = parse(getParameter("menu"+i), getParameter("separator"));                        // Get the hit area.            ints = parseInt(fields[0], " ");            hitArea[i] = new Rectangle(ints[0], ints[1], ints[2], ints[3]);			rightLimit = ints[0]+ints[2];			bottomLimit = ints[1]+ints[3];            // Get the source image.            ints = parseInt(fields[1], " ");            srcRect[i] = new Rectangle(ints[0], ints[1], ints[2], ints[3]);            // Get the destination point.            ints = parseInt(fields[2], " ");            dstPt[i] = new Point(ints[0], ints[1]);	    down[i] = fields[3].equals("d");	    url[i] = fields[4];            item[i] = new String[(fields.length-5)/2];            itemUrl[i] = new String[(fields.length-5)/2];            for (int j=0; j<item [i].length; j++) {                item[i][j] = fields[j*2+5];                itemUrl[i][j] = fields[j*2+6];            }        }    }    // s is a string containing 'sep' separators.  This method    // breaks up the string at the separators and returns the resulting    // strings in an array.  The result may have zero length but is never null.    String[] parse(String s, String sep) {	StringTokenizer st = new StringTokenizer(s, sep);        String result[] = new String[st.countTokens()];	for (int i=0; i<result.length; i++) {            result[i] = st.nextToken();	}        return result;    }    // This method is similar to parse() except that the strings are     // assumed to be decimal integers.  This method coverts these integer    // strings into integers and returns them in an array.    // The result may have zero length but is never null.    int[] parseInt(String s, String sep) {	StringTokenizer st = new StringTokenizer(s, sep);        int[] result = new int[st.countTokens()];	for (int i=0; i<result.length; i++) {            result[i] = Integer.parseInt(st.nextToken());	}        return result;    }    public void paint(Graphics g) {        imageDone = false;        update(g);    }    public void update(Graphics g) {        Graphics g2;        if (!imageDone) {        			g.setColor(bgColor);			g.fillRect( 0,0, rightLimit, (bottomLimit * 4 ) );            imageDone = g.drawImage(image, 0, 0, this);            return;        }                bbufG.setColor(bgColor);		bbufG.fillRect(0, 0, size().width, size().height);        bbufG.drawImage(image, 0, 0, this);                if (curMenu >= 0) {	    	g2 = bbuf.getGraphics();	    	for (int i=0; i<menuItemRect.length; i++) {				drawMenuItem(g2, i);	    	}	    	g2.dispose();            			g2 = bbuf.getGraphics();            // Paint the overlay image            g2.clipRect(dstPt[curMenu].x, dstPt[curMenu].y,                srcRect[curMenu].width, srcRect[curMenu].height);            g2.drawImage(image, dstPt[curMenu].x-srcRect[curMenu].x,                dstPt[curMenu].y-srcRect[curMenu].y, this);            g2.dispose();        }        g.drawImage(bbuf, 0, 0, this);    }    void drawMenuItem(Graphics g, int i) {        int x, y, w, height, secondRowNum, horizOffset, rightMargin; 		int height_adjust = 0;        		// break the menu item label into lines.        String[] line = parse(item[curMenu][i], getParameter("newline"));		//set horizontal offset		horizOffset = dstPt[curMenu].x;		rightMargin = horizOffset + ( menuItemRect[i].width * menuItemRect.length ); 		//try right justifying first if menu is too big		if ( rightMargin > rightLimit )		{			horizOffset = rightLimit - ( menuItemRect.length * menuItemRect[i].width ) -1;			rightMargin = horizOffset + ( menuItemRect[i].width * menuItemRect.length ); 		}		//if it's still too big, just start it at the beginning		if ( horizOffset < 0 )		{			horizOffset = 0;		}		menuItemRect[i].x = horizOffset + (menuItemRect[i].width * i);		menuItemRect[i].y = bottomLimit;				if ( (menuItemRect[i].x + menuItemRect[i].width) > rightLimit )		{			 secondRowNum = ( ( menuItemRect[i].x + menuItemRect[i].width ) % rightLimit );			secondRowNum = ( secondRowNum % rightLimit );			secondRowNum -= ( secondRowNum % menuItemRect[i].width );			secondRowNum = (int) ( secondRowNum / menuItemRect[i].width );			height_adjust = menuItemRect[i].height;				menuItemRect[i].x = secondRowNum * menuItemRect[i].width;			menuItemRect[i].y += menuItemRect[i].height;		}        int hi = 0;        if (i == curMenuItem) {	    	hi = 1;	    	getAppletContext().showStatus(itemUrl[curMenu][i]);        }		g.setColor(bgMenuColor[hi]);		g.fillRect(menuItemRect[i].x, menuItemRect[i].y,	    menuItemRect[i].width, menuItemRect[i].height);        // set color for text and box		g.setColor(fgMenuColor[hi]);        // draw box around menu item.		g.drawRect(menuItemRect[i].x, menuItemRect[i].y,	    menuItemRect[i].width, menuItemRect[i].height);        // draw label        g.setFont(f);	    x = menuItemRect[i].x + 2;		y = 26 + height_adjust;		int baseWidth = 2;        for (i=0; i<line.length; i++) 		{			Integer inum = new Integer(i);			String ivalue = inum.toString();            g.drawString( line[i], x, y + ( i*24 ) );			baseWidth += x;        }    }    public boolean mouseExit(Event evt, int x, int y) {        curMenuItem = curMenu = -1;		repaint();        return true;    }    public boolean mouseEnter(Event evt, int x, int y) {		curMenuItem = -1;        return mouseMove(evt, x, y);    }        public boolean mouseDown(Event evt, int x, int y) {        try {            String u = null;            if (curMenuItem >= 0 && itemUrl[curMenu].length > 0) {                u = itemUrl[curMenu][curMenuItem];            } else if (curMenu >= 0) {                u = url[curMenu];            }            if (u != null) {                URL url = new URL (getDocumentBase(), u);                if (getParameter("target") != null) {	            getAppletContext().showDocument(url, getParameter("target"));                } else {	            getAppletContext().showDocument(url);                }            }        } catch (Exception e) {            e.printStackTrace();        }        return true;    }    public boolean mouseMove(Event evt, int x, int y) {        if (curMenu >= 0) {            int sm = inMenu(menuItemRect, x, y);	    	if (curMenuItem != sm) {				curMenuItem = sm;				repaint();	    	}            if (sm >= 0) {                return true;            }            //curMenu = -1;        }        int m = inMenu(hitArea, x, y);        if (m != curMenu) {            curMenu = m;            // A new menu is now active so compute menuItemRect.            if (m >= 0) {                // Minimum width                int maxWidth = 50;                    int maxHeight = 0;    				curMenuItem = -1;                menuItemRect = new Rectangle[item[curMenu].length];                for (int i=0; i<menuItemRect.length; i++) {                    String[] line = parse(item[curMenu][i], "^");                    for (int j=0; j<line.length; j++) {                        int w = fm.stringWidth(line[j]);                        if (w > maxWidth) {                            maxWidth = w;                        }                    }                    menuItemRect[i] = new Rectangle();                    menuItemRect[i].height =                         parse(item[curMenu][i], "^").length * fm.getHeight()                        + marginV;					//menuItemRect[i].height = 20;                    maxHeight += menuItemRect[i].height;                }	        	// Determine domain of submenus                // Add one extra pixel for the left edge.				maxWidth +=  2 * marginH + 1;                if (down[m]) {                    y = Math.max(0, Math.min(size().height-maxHeight-1,                         dstPt[curMenu].y + srcRect[curMenu].height-1));                } else {                    y = Math.max(0, Math.min(size().height-maxHeight-1,                         dstPt[curMenu].y - maxHeight));                }				x = dstPt[curMenu].x + srcRect[curMenu].width-maxWidth-1;	       		for (int i=0; i<item[curMenu].length; i++) {                    menuItemRect[i].x = x;                    menuItemRect[i].y = y;                    menuItemRect[i].width = maxWidth;                    y += menuItemRect[i].height;	        	}	        	getAppletContext().showStatus(url[curMenu]);            }            repaint();        }        return true;    }    // Returns the index of the rectangle in rs containing x and y.    // Returns -1 if either rs is null or x and y is not in rs.    int inMenu(Rectangle[] rs, int x, int y) {        if (rs != null) {            for (int i=0; i<rs.length; i++) {                if (rs[i].inside(x, y)) {                    return i;                }            }        }        return -1;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久亚洲毛片| 国产精品欧美一区二区三区| 26uuu亚洲婷婷狠狠天堂| 精品美女一区二区三区| 久久久激情视频| 一区二区成人在线视频| 美女在线视频一区| 国产a精品视频| 欧美日韩在线播| 中国色在线观看另类| 亚洲成人资源在线| 成人av在线播放网站| 精品欧美一区二区久久| 一区二区视频在线看| 极品尤物av久久免费看| 欧美日韩久久不卡| 亚洲三级久久久| 韩国精品久久久| 91精品欧美久久久久久动漫| 国产精品美女久久久久高潮| 国产成人综合精品三级| 日韩一卡二卡三卡四卡| 制服丝袜成人动漫| 欧美顶级少妇做爰| 亚洲一区二区在线观看视频| 欧美日韩三级一区| 视频一区二区三区入口| 成人精品小蝌蚪| 国产日产精品一区| 色偷偷久久一区二区三区| 久久麻豆一区二区| 一区二区三区在线免费视频| 成人黄色a**站在线观看| 日韩一区二区在线免费观看| 亚洲激情图片小说视频| 欧美性猛交xxxx乱大交退制版 | 亚洲码国产岛国毛片在线| 91精品国产综合久久蜜臀| 欧美大尺度电影在线| 亚洲成人av免费| 日韩精品一区二区三区在线 | 国产福利一区二区| 成人动漫中文字幕| 欧美大片一区二区三区| 蜜臀av性久久久久蜜臀aⅴ流畅 | 艳妇臀荡乳欲伦亚洲一区| 欧美一区二区三区白人| 色天天综合色天天久久| a4yy欧美一区二区三区| 99国产精品久久久久久久久久久| 成人福利视频网站| 欧美午夜影院一区| 欧美福利电影网| 国产日韩欧美综合一区| 亚洲成人你懂的| 1000精品久久久久久久久| 国产精品素人视频| 亚洲午夜视频在线观看| 亚洲sss视频在线视频| 奇米影视7777精品一区二区| 91成人免费电影| 日韩精品中文字幕在线一区| 久久日一线二线三线suv| 国产精品国产三级国产普通话三级| 亚洲免费观看高清在线观看| 奇米一区二区三区| 成人av手机在线观看| 欧美日韩成人综合在线一区二区| 久久综合色婷婷| 亚洲欧美色综合| 国产资源在线一区| 欧美午夜视频网站| 国产欧美一二三区| 天天影视色香欲综合网老头| a级高清视频欧美日韩| 日韩视频永久免费| 一区二区三区不卡在线观看| 极品美女销魂一区二区三区| 在线精品视频免费播放| 国产欧美一区二区在线观看| 日日骚欧美日韩| 91视频在线观看| 国产精品久久久爽爽爽麻豆色哟哟| 另类人妖一区二区av| 日本久久电影网| 亚洲午夜精品17c| 国产精品资源网站| 欧美电影免费观看高清完整版在| 一区二区三区加勒比av| 91视频精品在这里| 中文字幕视频一区| av影院午夜一区| 国产精品高潮呻吟久久| 成人免费视频app| 亚洲成人综合在线| 6080yy午夜一二三区久久| 亚洲一线二线三线视频| 成人国产精品免费观看视频| 精品999在线播放| 国产成人亚洲综合色影视| 久久久久久久综合色一本| 韩国三级电影一区二区| 欧美高清在线视频| 91亚洲资源网| 日本大胆欧美人术艺术动态| 欧美区一区二区三区| 精品中文av资源站在线观看| 精品国产一区二区三区不卡| 麻豆成人免费电影| 国产欧美久久久精品影院| 成人av网站免费| 日韩电影网1区2区| 久久综合色8888| 粉嫩av一区二区三区在线播放| 中文字幕视频一区| 欧美一级日韩不卡播放免费| 日韩成人午夜精品| 中文字幕字幕中文在线中不卡视频| 欧美日韩精品免费观看视频| 狠狠久久亚洲欧美| 亚洲人成小说网站色在线 | 久久精品二区亚洲w码| 亚洲一区二区精品视频| 日韩一区二区在线免费观看| 成人精品gif动图一区| 日韩av电影天堂| 最新国产成人在线观看| 精品欧美久久久| 欧美精品在线观看一区二区| 日韩欧美在线一区二区三区| 色狠狠综合天天综合综合| 激情五月激情综合网| 亚洲综合区在线| 中文av一区特黄| 国产午夜亚洲精品不卡| 日韩欧美中文字幕一区| 在线亚洲人成电影网站色www| 精品一二三四在线| 亚洲成人久久影院| 中文字幕一区二区三| 中文字幕欧美国产| 国产欧美一区二区精品性| 日韩一本二本av| 4438x亚洲最大成人网| 欧美日韩国产精品自在自线| 欧美视频一区二区| 色呦呦日韩精品| 在线观看91视频| 91精品国产综合久久蜜臀 | 久久99深爱久久99精品| 亚洲成人av一区二区三区| 最新日韩av在线| 亚洲精品久久嫩草网站秘色| 一级特黄大欧美久久久| 五月天久久比比资源色| 日韩高清中文字幕一区| 另类小说欧美激情| 国产精品亚洲人在线观看| 成人免费的视频| 欧美日韩亚洲国产综合| 91精品久久久久久久久99蜜臂| 精品黑人一区二区三区久久| 国产欧美1区2区3区| 亚洲综合成人在线视频| 美女视频一区二区| 国产不卡免费视频| 欧美日韩国产天堂| 国产区在线观看成人精品| 午夜视频一区二区三区| 裸体一区二区三区| 色综合咪咪久久| 久久免费美女视频| 亚洲国产一区二区三区青草影视 | 亚洲自拍偷拍欧美| 狠狠色狠狠色合久久伊人| 在线观看成人小视频| 国产片一区二区| 久久超级碰视频| 91成人网在线| 久久老女人爱爱| 日本欧美一区二区三区| 成人久久视频在线观看| 欧美成人在线直播| 天天操天天干天天综合网| 99这里只有久久精品视频| 精品久久久久久久久久久院品网 | 国产日产精品一区| 奇米精品一区二区三区在线观看一| av一区二区三区四区| 国产精品国产三级国产aⅴ无密码| 奇米777欧美一区二区| 欧美私模裸体表演在线观看| 亚洲丝袜美腿综合| 99久久夜色精品国产网站| 中文字幕中文字幕中文字幕亚洲无线| 国产成人在线影院| 亚洲素人一区二区| 欧美日韩精品二区第二页| 日韩和欧美一区二区| 日韩视频一区二区三区在线播放|