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

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

?? officexpmenuui.java

?? JAVA swing 的office xp 和 office2003 風格。
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* ====================================================================
 * 
 * Office Look and Feels License
 * http://sourceforge.net/projects/officelnfs
 *
 * Copyright (c) 2003-2005 Robert Futrell.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer. 
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The names "Office Look And Feels" and "OfficeLnFs" must not
 *    be used to endorse or promote products derived from this software
 *    without prior written permission. For written permission, please
 *    contact robert_futrell@users.sourceforge.net.
 *
 * 4. Products derived from this software may not be called "OfficeLnFs"
 *    nor may "OfficeLnFs" appear in their names without prior written
 *    permission.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 */ 
package org.fife.plaf.OfficeXP;

import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import javax.swing.ButtonModel;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.MouseInputListener;
import javax.swing.plaf.basic.BasicHTML;
import javax.swing.plaf.ComponentUI;
import javax.swing.text.View;

import com.sun.java.swing.plaf.windows.WindowsMenuUI;


/**
 * Component UI for a menu using the Office XP Look and Feel.
 *
 * @author Robert Futrell
 * @version 1.0
 */
public class OfficeXPMenuUI extends WindowsMenuUI {

	private boolean isMouseOver = false;

 	// These rects are used for painting and preferred size calculations.
	// They are reused to keep from having to reallocate them.
	protected static final Rectangle zeroRect = new Rectangle(0,0,0,0);
	protected static Rectangle iconRect = new Rectangle();
	protected static Rectangle textRect = new Rectangle();
	protected static Rectangle arrowIconRect = new Rectangle();
	protected static Rectangle viewRect = new Rectangle(Short.MAX_VALUE, Short.MAX_VALUE);
	protected static Rectangle r = new Rectangle();


    protected MouseInputListener createMouseInputListener(JComponent c) {
		return new MouseInputHandler();
    }


	public static ComponentUI createUI(JComponent x) {
		return new OfficeXPMenuUI();
    }


	/**
	 * Horrible, horrible hack to get non-top level menus' heights to be the
	 * same as that of regular menu items.
	 */
	protected Dimension getPreferredMenuItemSize(JComponent c,
									Icon checkIcon,
									Icon arrowIcon,
									int defaultTextIconGap) {

		JMenu menu = (JMenu)c;
		Dimension d = null;

		if (menu.isTopLevelMenu()) {
			d = super.getPreferredMenuItemSize(menu, checkIcon,
							arrowIcon, defaultTextIconGap);
			d.width += 4;	// Allows for the "shadow" to be drawn.
			d.height = 22;
		}
		else { // Menu that's a menu item inside another menu.
			d = getPreferredNonTopLevelMenuSize(menu, checkIcon, arrowIcon,
										defaultTextIconGap);
		}

		return d;

	}




	/**
	 * Computes the preferred dimensions of a menu that is NOT a top-level
	 * menu.  This method is called from <code>getPreferredMenuItemSize</code>
	 * because its super implementation won't properly calculate the
	 * preferred width of a non-top level menu in this LnF (because we always
	 * have an icon's width of space on the left, etc.).
	 */
	protected Dimension getPreferredNonTopLevelMenuSize(JMenu menu,
										Icon checkIcon,
										Icon arrowIcon,
										int defaultTextIconGap) {

		Icon icon = (Icon)menu.getIcon();
		String text = menu.getText();
		Font font = menu.getFont();
		FontMetrics fm = menu.getFontMetrics(font);
		resetRects();

		layoutMenuItem(fm, text, icon, arrowIcon,
					viewRect, iconRect, textRect, 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);


		// If the width of this menu's text is longer than the parent menu's
		// current longest text, update it.  This is so that other menu
		// items in the parent menu can have their accelerators align.

		// Get the parent, which stores the information.
		Container parent = menu.getParent();

		if (parent!=null && (parent instanceof JComponent)) {

			//Get widest text so far from parent, if no one exists null
			// is returned.
			JComponent p = (JComponent) parent;
			Integer maxTextWidth = (Integer) p.getClientProperty(
								OfficeXPMenuItemUI.MAX_TEXT_WIDTH);
			int maxTextValue = maxTextWidth!=null ?
									maxTextWidth.intValue() : 0;

			//Compare the text widths, and adjust the r.width to the widest.
			if (r.width < maxTextValue)
				r.width = maxTextValue;
			else {
				p.putClientProperty(OfficeXPMenuItemUI.MAX_TEXT_WIDTH,
								new Integer(r.width));
			}

			r.width += defaultTextIconGap;

		}

		// Add in the checkIcon
		r.width += 20;//checkIconRect.width;
		r.width += defaultTextIconGap;

		// Add in the arrowIcon
		r.width += defaultTextIconGap;
		r.width += 12;//arrowIconRect.width;

		// Add in the "padding" on either side of the menu item.
		r.width += 2*defaultTextIconGap;

		Insets insets = menu.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)
			r.height++;

		return new Dimension((int)r.getWidth(),
							OfficeXPMenuItemUI.MENU_ITEM_HEIGHT);

	}


    /**
     * Get the temporary flag to indicate if the mouse has entered the menu.
     */
    protected boolean isMouseOver() {
		return isMouseOver;
    }


	/**
	 * 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.
	 */
    protected String layoutMenuItem(FontMetrics fm, String text, Icon icon,
					Icon arrowIcon, Rectangle viewRect, Rectangle iconRect,
					Rectangle textRect, Rectangle arrowIconRect,
					int textIconGap, int menuItemGap) {

		OfficeXPMenuItemUI.layoutCompoundLabel(menuItem, fm, text, viewRect,
										iconRect, textRect);

		// Initialize the arrowIcon bounds rectangle width & height.
		if (arrowIcon != null) {
			arrowIconRect.width = arrowIcon.getIconWidth();
			arrowIconRect.height = arrowIcon.getIconHeight();
		}
		else {
			arrowIconRect.width = arrowIconRect.height = 0;
		}

		//Rectangle labelRect = iconRect.union(textRect);

		// Position the Arrow Icon.
		int temp = viewRect.x;// + 6;
		textRect.x += temp;
		iconRect.x += temp;
		if (menuItem.getComponentOrientation().isLeftToRight()) {
			arrowIconRect.x = viewRect.x + viewRect.width - menuItemGap -
							arrowIconRect.width;
		}
		else {
			arrowIconRect.x = viewRect.x + menuItemGap;
		}

		arrowIconRect.y = 8;//labelRect.y + (labelRect.height/2) - arrowIconRect.height/2;

		return text;

	}


    protected void paintBackground(Graphics g, JMenuItem menuItem,
    									Color bgColor) {
		// If the user is running pre-Windows XP, don't do all this jazz.
		if (OfficeXPLookAndFeel.isClassicWindows()) {
			super.paintBackground(g, menuItem, bgColor);
		}
		JMenu menu = (JMenu)menuItem;
		// If this is a submenu, it should be painted just like menu items.
		if (!menu.isTopLevelMenu()) {
			paintSubmenuBackground(g, menu);
		}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本少妇一区二区| 亚洲国产中文字幕在线视频综合| 成人国产精品免费观看动漫| 五月婷婷久久丁香| 中文字幕中文字幕在线一区 | 亚洲人成人一区二区在线观看| 6080日韩午夜伦伦午夜伦| 成人免费观看男女羞羞视频| 奇米777欧美一区二区| 亚洲男人天堂av网| 国产免费成人在线视频| 欧美一区二区福利在线| 欧美在线观看一区二区| av在线免费不卡| 国产黄色91视频| 久久99国产精品久久99| 日韩综合小视频| 亚洲精品免费在线观看| 国产精品日韩精品欧美在线| 欧美大片顶级少妇| 日韩无一区二区| 在线不卡中文字幕播放| 色久综合一二码| 91丨九色porny丨蝌蚪| 国产jizzjizz一区二区| 国产一区视频导航| 精品一区二区在线免费观看| 日本成人在线不卡视频| 亚洲成人高清在线| 亚洲一区二区三区在线| 亚洲免费在线播放| 亚洲黄网站在线观看| 亚洲同性同志一二三专区| 欧美高清在线一区二区| 国产欧美一区二区精品性| 久久久九九九九| 久久久久久久综合狠狠综合| 2020国产成人综合网| 精品久久一区二区| 精品99999| 国产日本欧洲亚洲| 日本一区二区免费在线| 国产精品视频麻豆| 国产精品久久久久久久久动漫 | 日本一区二区三区免费乱视频| 久久久久久久久久久久电影| 337p粉嫩大胆噜噜噜噜噜91av| 精品成人私密视频| 国产欧美一区在线| 综合久久久久久久| 亚洲影视资源网| 日韩不卡手机在线v区| 奇米精品一区二区三区在线观看一| 日韩电影在线观看电影| 美国十次综合导航| 国产高清精品网站| av中文一区二区三区| 日本丰满少妇一区二区三区| 欧美日韩精品一区二区三区 | 国产精品成人免费| 亚洲综合色成人| 蜜臀av一级做a爰片久久| 国内成人精品2018免费看| 国产成人综合在线| 色综合久久久久| 555www色欧美视频| 久久免费国产精品| 一区二区三区色| 免费高清在线视频一区·| 国产盗摄一区二区三区| 91在线观看视频| 欧美一区二区久久| 国产精品亲子伦对白| 亚洲国产欧美另类丝袜| 精品在线播放免费| 一本一道波多野结衣一区二区| 欧美日韩精品欧美日韩精品一| 亚洲精品一区二区精华| 亚洲图片欧美激情| 久久国产生活片100| 不卡影院免费观看| 91精品国产综合久久精品麻豆| 国产色一区二区| 婷婷成人激情在线网| 国产suv精品一区二区6| 欧美精品久久99久久在免费线 | 99久久er热在这里只有精品66| 在线欧美日韩国产| 欧美精品一区二区蜜臀亚洲| 亚洲天天做日日做天天谢日日欢| 日日摸夜夜添夜夜添国产精品 | 午夜精品久久久久久久久久| 国产一区二区三区国产| 欧美综合在线视频| 中文一区一区三区高中清不卡| 午夜电影久久久| 99精品久久免费看蜜臀剧情介绍| 欧美一区二区三区思思人| 国产精品免费视频观看| 久久国产三级精品| 欧美色大人视频| 国产精品看片你懂得| 久久成人麻豆午夜电影| 欧美在线视频日韩| 中文字幕不卡的av| 韩日av一区二区| 欧美精品在线观看播放| 亚洲男同性视频| 成人一区二区三区在线观看| 日韩一级片在线播放| 亚洲大型综合色站| 91麻豆免费看片| 国产精品免费aⅴ片在线观看| 经典三级视频一区| 欧美一区二区成人6969| 午夜私人影院久久久久| 色欧美乱欧美15图片| 一区在线观看视频| 成人午夜在线免费| 久久精品视频一区| 国内精品写真在线观看| 日韩一区二区电影在线| 日本亚洲视频在线| 欧美精品三级日韩久久| 亚洲第四色夜色| 欧美另类videos死尸| 亚洲午夜久久久久久久久电影网 | 91老师片黄在线观看| 国产精品毛片大码女人 | 在线看国产一区| 亚洲天堂精品在线观看| 99久久99久久久精品齐齐| 欧美国产一区在线| 成人白浆超碰人人人人| 国产精品人成在线观看免费| 国产成人高清在线| 国产精品欧美经典| av一区二区三区在线| 亚洲人成网站色在线观看| 日本韩国欧美国产| 亚洲国产精品一区二区久久恐怖片 | 欧美一卡在线观看| 琪琪一区二区三区| 337p日本欧洲亚洲大胆精品 | 久久久亚洲精华液精华液精华液| 久久99国产精品免费网站| 久久亚洲影视婷婷| 国产成人av资源| 最新国产精品久久精品| 色噜噜夜夜夜综合网| 亚洲第一会所有码转帖| 日韩一区二区在线免费观看| 精品一区二区在线免费观看| 久久久久久**毛片大全| 成人av集中营| 一级特黄大欧美久久久| 欧美福利一区二区| 狠狠网亚洲精品| 一区二区中文视频| 欧美日韩1234| 国产在线看一区| 综合分类小说区另类春色亚洲小说欧美| 色妞www精品视频| 视频一区视频二区中文字幕| 精品日韩欧美一区二区| 粉嫩绯色av一区二区在线观看| 伊人开心综合网| 日韩视频在线你懂得| 成人动漫av在线| 午夜国产精品一区| 久久久久久久国产精品影院| 成人h动漫精品| 日韩精品成人一区二区三区| 久久久精品免费免费| 色婷婷久久99综合精品jk白丝| 免费高清不卡av| 成人欧美一区二区三区白人| 这里只有精品视频在线观看| 国产成人自拍网| 亚洲国产成人porn| 国产欧美日韩激情| 欧美丰满高潮xxxx喷水动漫| 国产精品99久久不卡二区| 亚洲午夜久久久久久久久电影网| 久久蜜桃香蕉精品一区二区三区| 一本大道久久精品懂色aⅴ| 麻豆成人91精品二区三区| 亚洲人被黑人高潮完整版| 日韩美女视频在线| 色www精品视频在线观看| 狠狠色综合日日| 亚洲国产日韩精品| 国产精品免费丝袜| 日韩欧美国产麻豆| 欧美视频一区在线| 成人av电影在线| 国产一区二区在线免费观看| 亚洲午夜精品久久久久久久久| 国产片一区二区| 欧美电视剧免费观看|