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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? basicmenuitemui.java

?? JAVA的一些源碼 JAVA2 STANDARD EDITION DEVELOPMENT KIT 5.0
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
        resetRects();                layoutMenuItem(                  fm, text, fmAccel, acceleratorText, icon, checkIcon, arrowIcon,                  b.getVerticalAlignment(), b.getHorizontalAlignment(),                  b.getVerticalTextPosition(), b.getHorizontalTextPosition(),                  viewRect, iconRect, textRect, acceleratorRect, checkIconRect, arrowIconRect,                  text == null ? 0 : defaultTextIconGap,                  defaultTextIconGap                  );        // find the union of the icon and text rects        r.setBounds(textRect);        r = SwingUtilities.computeUnion(iconRect.x,                                        iconRect.y,                                        iconRect.width,                                        iconRect.height,                                        r);        // Find the result height        r.height = Math.max(            Math.max(r.height, checkIconRect.height),            Math.max(arrowIconRect.height, acceleratorRect.height));        //   r = iconRect.union(textRect);		// To make the accelerator texts appear in a column, find the widest MenuItem text	// and the widest accelerator text.	//Get the parent, which stores the information.	Container parent = menuItem.getParent();		//Check the parent, and see that it is not a top-level menu.        if (parent != null && parent instanceof JComponent && 	    !(menuItem instanceof JMenu && ((JMenu) menuItem).isTopLevelMenu())) {	    JComponent p = (JComponent) parent;	    	    //Get widest text so far from parent, if no one exists null is returned.	    Integer maxTextWidth = (Integer) p.getClientProperty(BasicMenuItemUI.MAX_TEXT_WIDTH);	    Integer maxAccWidth = (Integer) p.getClientProperty(BasicMenuItemUI.MAX_ACC_WIDTH);	    	    int maxTextValue = maxTextWidth!=null ? maxTextWidth.intValue() : 0;	    int maxAccValue = maxAccWidth!=null ? maxAccWidth.intValue() : 0;	    	    //Compare the text widths, and adjust the r.width to the widest.	    if (r.width < maxTextValue) {		r.width = maxTextValue;	    } else {		p.putClientProperty(BasicMenuItemUI.MAX_TEXT_WIDTH, new Integer(r.width) );	    }	    	  //Compare the accelarator widths.	    if (acceleratorRect.width > maxAccValue) {		maxAccValue = acceleratorRect.width;		p.putClientProperty(BasicMenuItemUI.MAX_ACC_WIDTH, new Integer(acceleratorRect.width) );	    }	    	    //Add on the widest accelerator 	    r.width += maxAccValue;	    r.width += defaultTextIconGap;	    	}		if( useCheckAndArrow() ) {	    // Add in the checkIcon	    r.width += checkIconRect.width;	    r.width += defaultTextIconGap;	    // Add in the arrowIcon	    r.width += defaultTextIconGap;	    r.width += arrowIconRect.width;        }		r.width += 2*defaultTextIconGap;        Insets insets = b.getInsets();        if(insets != null) {            r.width += insets.left + insets.right;            r.height += insets.top + insets.bottom;        }        // if the width is even, bump it up one. This is critical        // for the focus dash line to draw properly        if(r.width%2 == 0) {            r.width++;        }        // if the height is even, bump it up one. This is critical        // for the text to center properly        if(r.height%2 == 0                 && Boolean.TRUE !=                     UIManager.get(getPropertyPrefix() + ".evenHeight")) {            r.height++;        }/*	if(!(b instanceof JMenu && ((JMenu) b).isTopLevelMenu()) ) {	    	    // Container parent = menuItem.getParent();	    JComponent p = (JComponent) parent;	    	    System.out.println("MaxText: "+p.getClientProperty(BasicMenuItemUI.MAX_TEXT_WIDTH));	    System.out.println("MaxACC"+p.getClientProperty(BasicMenuItemUI.MAX_ACC_WIDTH));	    	    System.out.println("returning pref.width: " + r.width);	    System.out.println("Current getSize: " + b.getSize() + "\n");        }*/	return r.getSize();    }    /**     * We draw the background in paintMenuItem()     * so override update (which fills the background of opaque     * components by default) to just call paint().     *     */    public void update(Graphics g, JComponent c) {        paint(g, c);    }    public void paint(Graphics g, JComponent c) {        paintMenuItem(g, c, checkIcon, arrowIcon,                      selectionBackground, selectionForeground,                      defaultTextIconGap);    }    protected void paintMenuItem(Graphics g, JComponent c,                                     Icon checkIcon, Icon arrowIcon,                                     Color background, Color foreground,                                     int defaultTextIconGap) {        JMenuItem b = (JMenuItem) c;        ButtonModel model = b.getModel();        //   Dimension size = b.getSize();        int menuWidth = b.getWidth();        int menuHeight = b.getHeight();        Insets i = c.getInsets();	        resetRects();        viewRect.setBounds( 0, 0, menuWidth, menuHeight );        viewRect.x += i.left;        viewRect.y += i.top;        viewRect.width -= (i.right + viewRect.x);        viewRect.height -= (i.bottom + viewRect.y);        Font holdf = g.getFont();        Font f = c.getFont();        g.setFont( f );        FontMetrics fm = SwingUtilities2.getFontMetrics(c, g, f);        FontMetrics fmAccel = SwingUtilities2.getFontMetrics(                                   c, g, acceleratorFont);        // get Accelerator text        KeyStroke accelerator =  b.getAccelerator();        String acceleratorText = "";        if (accelerator != null) {            int modifiers = accelerator.getModifiers();            if (modifiers > 0) {                acceleratorText = KeyEvent.getKeyModifiersText(modifiers);                //acceleratorText += "-";                acceleratorText += acceleratorDelimiter;	    }            int keyCode = accelerator.getKeyCode();            if (keyCode != 0) {                acceleratorText += KeyEvent.getKeyText(keyCode);            } else {                acceleratorText += accelerator.getKeyChar();            }        }        Icon icon = null;        /*          * in case .checkIconFactory is defined for this UI and the icon is          * compatible with it then the icon is handled by the checkIcon.         */        MenuItemCheckIconFactory iconFactory =             (MenuItemCheckIconFactory) UIManager.get(getPropertyPrefix()                 + ".checkIconFactory");        if (iconFactory == null                || ! iconFactory.isCompatible(checkIcon, getPropertyPrefix())) {           icon = b.getIcon();          }        // layout the text and icon        String text = layoutMenuItem(            fm, b.getText(), fmAccel, acceleratorText, icon,            checkIcon, arrowIcon,            b.getVerticalAlignment(), b.getHorizontalAlignment(),            b.getVerticalTextPosition(), b.getHorizontalTextPosition(),            viewRect, iconRect, textRect, acceleratorRect,             checkIconRect, arrowIconRect,            b.getText() == null ? 0 : defaultTextIconGap,            defaultTextIconGap        );         // Paint background	paintBackground(g, b, background);        Color holdc = g.getColor();        // Paint the Check        if (checkIcon != null) {            if(model.isArmed() || (c instanceof JMenu && model.isSelected())) {                g.setColor(foreground);            } else {                g.setColor(holdc);            }            if( useCheckAndArrow() )		checkIcon.paintIcon(c, g, checkIconRect.x, checkIconRect.y);            g.setColor(holdc);        }        // Paint the Icon        if(icon != null ) {             if(!model.isEnabled()) {                icon = (Icon) b.getDisabledIcon();            } else if(model.isPressed() && model.isArmed()) {                icon = (Icon) b.getPressedIcon();                if(icon == null) {                    // Use default icon                    icon = (Icon) b.getIcon();                }             } else {                icon = (Icon) b.getIcon();            }                          if (icon!=null)                   icon.paintIcon(c, g, iconRect.x, iconRect.y);        }        // Draw the Text        if(text != null) { 	    View v = (View) c.getClientProperty(BasicHTML.propertyKey); 	    if (v != null) { 		v.paint(g, textRect); 	    } else {		paintText(g, b, textRect, text);	    }	}	        // Draw the Accelerator Text        if(acceleratorText != null && !acceleratorText.equals("")) {	  //Get the maxAccWidth from the parent to calculate the offset.	  int accOffset = 0;	  Container parent = menuItem.getParent();	  if (parent != null && parent instanceof JComponent) {	    JComponent p = (JComponent) parent;	    Integer maxValueInt = (Integer) p.getClientProperty(BasicMenuItemUI.MAX_ACC_WIDTH);	    int maxValue = maxValueInt != null ?                maxValueInt.intValue() : acceleratorRect.width;	    //Calculate the offset, with which the accelerator texts will be drawn with.	    accOffset = maxValue - acceleratorRect.width;	  }	  	  g.setFont( acceleratorFont );            if(!model.isEnabled()) {                // *** paint the acceleratorText disabled	      if ( disabledForeground != null )		  {                  g.setColor( disabledForeground );                  SwingUtilities2.drawString(b, g,acceleratorText,                                                acceleratorRect.x - accOffset,                                                 acceleratorRect.y + fmAccel.getAscent());                }                else                {                  g.setColor(b.getBackground().brighter());                  SwingUtilities2.drawString(b, g,acceleratorText,                                                acceleratorRect.x - accOffset, 						acceleratorRect.y + fmAccel.getAscent());                  g.setColor(b.getBackground().darker());                  SwingUtilities2.drawString(b, g,acceleratorText,                                                acceleratorRect.x - accOffset - 1, 						acceleratorRect.y + fmAccel.getAscent() - 1);                }            } else {                // *** paint the acceleratorText normally                if (model.isArmed()|| (c instanceof JMenu && model.isSelected())) {                    g.setColor( acceleratorSelectionForeground );                } else {                    g.setColor( acceleratorForeground );                }                SwingUtilities2.drawString(b, g,acceleratorText,                                              acceleratorRect.x - accOffset,                                              acceleratorRect.y + fmAccel.getAscent());            }        }        // Paint the Arrow        if (arrowIcon != null) {            if(model.isArmed() || (c instanceof JMenu &&model.isSelected()))                g.setColor(foreground);            if(useCheckAndArrow())                arrowIcon.paintIcon(c, g, arrowIconRect.x, arrowIconRect.y);        }        g.setColor(holdc);        g.setFont(holdf);    }    /**     * Draws the background of the menu item.     *      * @param g the paint graphics     * @param menuItem menu item to be painted     * @param bgColor selection background color     * @since 1.4     */    protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) {	ButtonModel model = menuItem.getModel();        Color oldColor = g.getColor();        int menuWidth = menuItem.getWidth();        int menuHeight = menuItem.getHeight();        if(menuItem.isOpaque()) {            if (model.isArmed()|| (menuItem instanceof JMenu && model.isSelected())) {                g.setColor(bgColor);                g.fillRect(0,0, menuWidth, menuHeight);            } else {                g.setColor(menuItem.getBackground());                g.fillRect(0,0, menuWidth, menuHeight);            }            g.setColor(oldColor);        }        else if (model.isArmed() || (menuItem instanceof JMenu &&                                     model.isSelected())) {            g.setColor(bgColor);            g.fillRect(0,0, menuWidth, menuHeight);            g.setColor(oldColor);        }    }    /**     * Renders the text of the current menu item.     * <p>     * @param g graphics context     * @param menuItem menu item to render     * @param textRect bounding rectangle for rendering the text     * @param text string to render     * @since 1.4     */    protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {	ButtonModel model = menuItem.getModel();	FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g);	int mnemIndex = menuItem.getDisplayedMnemonicIndex();	if(!model.isEnabled()) {	    // *** paint the text disabled	    if ( UIManager.get("MenuItem.disabledForeground") instanceof Color ) {		g.setColor( UIManager.getColor("MenuItem.disabledForeground") );		SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text,                          mnemIndex, textRect.x,  textRect.y + fm.getAscent());	    } else {		g.setColor(menuItem.getBackground().brighter());		SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text,                           mnemIndex, textRect.x, textRect.y + fm.getAscent());		g.setColor(menuItem.getBackground().darker());		SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text,                           mnemIndex,  textRect.x - 1, textRect.y +                           fm.getAscent() - 1);	    }	} else {	    // *** paint the text normally	    if (model.isArmed()|| (menuItem instanceof JMenu && model.isSelected())) {		g.setColor(selectionForeground); // Uses protected field.	    }	    SwingUtilities2.drawStringUnderlineCharAt(menuItem, g,text,                           mnemIndex, textRect.x, textRect.y + fm.getAscent());	}    }    /**      * Compute and return the location of the icons origin, the      * location of origin of the text baseline, and a possibly clipped     * version of the compound labels string.  Locations are computed     * relative to the viewRect rectangle.      */    private String layoutMenuItem(        FontMetrics fm,        String text,        FontMetrics fmAccel,        String acceleratorText,        Icon icon,        Icon checkIcon,        Icon arrowIcon,        int verticalAlignment,        int horizontalAlignment,        int verticalTextPosition,        int horizontalTextPosition,        Rectangle viewRect,         Rectangle iconRect,         Rectangle textRect,        Rectangle acceleratorRect,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美自拍偷拍一区| 色综合天天综合狠狠| 91精品国产麻豆国产自产在线| 亚洲一区二区三区免费视频| 欧美日韩精品二区第二页| 午夜精品久久久久久久久| 欧美日本在线一区| 免费看欧美女人艹b| 精品裸体舞一区二区三区| 国产一区二区免费看| 国产精品妹子av| 99久久99久久免费精品蜜臀| 一区二区三区91| 91.麻豆视频| 精品一区二区在线看| 中文字幕在线观看不卡视频| 色综合网站在线| 日韩电影在线免费看| 久久久www免费人成精品| 91麻豆国产精品久久| 日本aⅴ精品一区二区三区| 久久久久综合网| 欧美性受xxxx黑人xyx| 精品一区二区三区在线观看| 中文字幕亚洲区| 日韩天堂在线观看| 北岛玲一区二区三区四区| 婷婷久久综合九色综合绿巨人| 精品国产精品网麻豆系列| 99re这里只有精品视频首页| 日韩成人dvd| 中文字幕一区二区三区不卡| 7777女厕盗摄久久久| aaa欧美大片| 麻豆国产一区二区| 亚洲精品欧美激情| 国产午夜精品一区二区三区视频 | 欧美二区乱c少妇| 国产成人亚洲综合色影视| 亚洲国产中文字幕| 国产日产精品一区| 宅男噜噜噜66一区二区66| 高清国产一区二区| 日本亚洲三级在线| 亚洲精品伦理在线| 久久久不卡影院| 日韩亚洲欧美在线| 欧美制服丝袜第一页| 风间由美一区二区av101| 日本亚洲电影天堂| 一区二区三区在线视频观看| 国产亚洲精久久久久久| 欧美群妇大交群的观看方式| 91在线免费视频观看| 久久99精品久久只有精品| 亚洲18色成人| 亚洲精品中文在线影院| 国产精品丝袜一区| 久久久精品国产免大香伊| 日韩欧美一区二区在线视频| 欧美色图12p| 色女孩综合影院| 成人国产精品免费| 国产精品99久久久久久久vr | 亚洲电影在线免费观看| 最新高清无码专区| 国产精品色在线观看| 国产视频一区二区三区在线观看| 日韩欧美国产综合一区 | 日韩一区二区三区在线| 欧美日本一区二区| 欧美日韩美少妇| 日本高清免费不卡视频| 91理论电影在线观看| www.色精品| 成人午夜电影久久影院| 国产在线日韩欧美| 国产精品综合一区二区| 国产美女视频一区| 国产黄色成人av| 国产精品综合久久| 国产成人av电影免费在线观看| 国产精品99久久不卡二区| 国产精品影音先锋| 成人午夜看片网址| 成人av网在线| 91天堂素人约啪| 91香蕉视频污| 色婷婷一区二区三区四区| 色香色香欲天天天影视综合网| 91一区一区三区| 在线视频欧美精品| 7777精品伊人久久久大香线蕉超级流畅| 精品婷婷伊人一区三区三| 欧美日韩亚洲综合| 日韩欧美中文字幕制服| 精品国产髙清在线看国产毛片| 2023国产精品自拍| 国产精品国产三级国产aⅴ入口| 国产精品高潮呻吟久久| 一区二区三区欧美亚洲| 亚洲国产aⅴ成人精品无吗| 日本中文字幕不卡| 国产成人亚洲综合色影视| 91在线小视频| 精品视频1区2区| 欧美成人a视频| 亚洲国产精品黑人久久久 | 夜夜操天天操亚洲| 亚洲mv在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 99视频精品在线| 欧美日韩高清一区二区不卡| 欧美不卡一区二区| 国产精品日韩成人| 三级亚洲高清视频| 国产激情精品久久久第一区二区 | 成人av网站在线| 欧美在线免费播放| 精品1区2区在线观看| 亚洲色图视频网站| 老鸭窝一区二区久久精品| av一区二区不卡| 欧美一区二区三区人| 中文字幕精品一区二区精品绿巨人 | 国产一区二区导航在线播放| 93久久精品日日躁夜夜躁欧美| 欧美精品123区| 国产精品久久久一本精品| 日产国产高清一区二区三区 | 九九**精品视频免费播放| 97se狠狠狠综合亚洲狠狠| 精品国产亚洲一区二区三区在线观看| 国产精品国产三级国产aⅴ中文| 日本亚洲最大的色成网站www| 99re这里只有精品视频首页| 精品播放一区二区| 亚洲国产精品欧美一二99 | 成人晚上爱看视频| 精品久久久三级丝袜| 午夜精品福利一区二区蜜股av | 成人动漫在线一区| 精品理论电影在线| 三级不卡在线观看| 在线亚洲+欧美+日本专区| 国产人成亚洲第一网站在线播放| 日一区二区三区| 一本一道综合狠狠老| 国产欧美日韩在线视频| 久久se这里有精品| 欧美一二三四区在线| 亚洲一区二区欧美| 一本色道a无线码一区v| 国产精品私人影院| 国产成人激情av| www国产精品av| 久久精品国产免费| 日韩欧美aaaaaa| 日韩电影一区二区三区四区| 欧美三区免费完整视频在线观看| 久久久一区二区三区捆绑**| 美女一区二区视频| 91精品久久久久久久91蜜桃| 婷婷六月综合亚洲| 欧美精品1区2区3区| 亚洲成人高清在线| 欧美日韩国产一级| 五月婷婷综合在线| 欧美日韩一级片在线观看| 一区二区三区在线观看网站| 色婷婷亚洲精品| 亚洲午夜精品在线| 在线精品视频免费播放| 夜夜嗨av一区二区三区网页| 在线观看免费成人| 亚洲成人黄色小说| 日韩一区二区在线观看视频播放| 三级欧美在线一区| 日韩精品一区二区三区蜜臀| 韩国av一区二区三区在线观看| 欧美一级日韩免费不卡| 蜜臀av一级做a爰片久久| 日韩一区和二区| 国产综合久久久久影院| 国产日韩欧美麻豆| 99久久婷婷国产| 一区二区三区精品在线观看| 欧美日韩精品专区| 蜜臀av性久久久久蜜臀aⅴ | 国产精品激情偷乱一区二区∴| 成人激情午夜影院| 亚洲日本丝袜连裤袜办公室| 欧美视频自拍偷拍| 韩国一区二区三区| 国产精品三级av在线播放| 在线观看日韩av先锋影音电影院| 天天av天天翘天天综合网 | 青青青伊人色综合久久| 久久影院午夜片一区| 91蜜桃网址入口|