亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩国产高清在线| 亚洲二区视频在线| 久久午夜国产精品| 亚洲精品在线免费播放| 26uuu久久天堂性欧美| 欧美大度的电影原声| 精品国产成人系列| 国产日韩欧美麻豆| 国产精品每日更新| 亚洲天堂中文字幕| 亚洲一区二区三区激情| 亚洲成人在线免费| 免费观看30秒视频久久| 久久成人麻豆午夜电影| 国产成人啪午夜精品网站男同| 国内精品伊人久久久久av一坑| 国产精品一二三| 东方aⅴ免费观看久久av| 成人免费看的视频| 91久久线看在观草草青青| 91福利资源站| 欧美大片日本大片免费观看| 亚洲国产岛国毛片在线| 亚洲精品你懂的| 麻豆一区二区三| 不卡影院免费观看| 欧美浪妇xxxx高跟鞋交| 亚洲综合无码一区二区| 婷婷久久综合九色综合绿巨人| 免费成人美女在线观看| 国产一区二区0| 欧美一区二区三区四区视频| 欧美草草影院在线视频| 欧美日韩综合在线免费观看| 日韩一区二区三区高清免费看看| 久久久国产综合精品女国产盗摄| 亚洲欧美综合色| 久久99久久99小草精品免视看| 国产69精品一区二区亚洲孕妇| 欧美性大战久久久久久久蜜臀| 日韩视频免费直播| 亚洲免费观看视频| 国产米奇在线777精品观看| 色婷婷激情综合| 久久精品日产第一区二区三区高清版 | 中文字幕在线不卡| 午夜精品视频一区| 91视频免费观看| 欧美成人官网二区| 婷婷成人激情在线网| 成人a级免费电影| 亚洲精品一线二线三线无人区| 亚洲精品第1页| 国产福利不卡视频| 日韩精品资源二区在线| 一区二区高清在线| 成人高清视频在线| 精品国产3级a| 日本不卡中文字幕| 欧美日韩免费在线视频| 亚洲欧洲性图库| 国产成人亚洲综合a∨婷婷| 91精品在线免费| 亚洲va国产天堂va久久en| 99国产精品一区| 国产精品久久久久久户外露出| 久久国产精品无码网站| 欧美一级生活片| 日本最新不卡在线| 欧美一级片免费看| 日本美女视频一区二区| 91精品国产色综合久久ai换脸| 亚洲欧美日韩系列| 色综合婷婷久久| 欧美性色黄大片| 一片黄亚洲嫩模| 在线欧美小视频| 亚洲一二三区视频在线观看| 欧美午夜影院一区| 亚洲sss视频在线视频| 欧美亚洲国产一区在线观看网站 | 99国产一区二区三精品乱码| 国产日产亚洲精品系列| 成人免费的视频| 国产精品国产三级国产专播品爱网| 高清在线不卡av| 最新国产成人在线观看| 91免费国产在线| 午夜精品久久久久影视| 91精品国产综合久久婷婷香蕉| 日韩激情一二三区| 亚洲精品在线免费观看视频| 国产成人丝袜美腿| 亚洲人成网站色在线观看| 一本大道久久a久久综合婷婷| 一区二区久久久久久| 欧美精品在线一区二区| 国内精品伊人久久久久av影院| 国产日韩精品一区二区浪潮av| 成人综合婷婷国产精品久久蜜臀 | 69p69国产精品| 久久国产综合精品| 国产精品视频观看| 欧美日韩精品专区| 国内一区二区在线| 亚洲免费观看高清完整版在线观看| 欧洲另类一二三四区| 久久国产乱子精品免费女| 中文字幕一区免费在线观看| 欧美日本乱大交xxxxx| 国产精品一区二区在线观看不卡| 中文字幕一区二区三区乱码在线| 欧美顶级少妇做爰| www.日韩av| 老鸭窝一区二区久久精品| 国产精品第五页| 欧美一区二区三区免费| 不卡视频在线观看| 久久精工是国产品牌吗| 亚洲三级电影网站| 久久人人爽爽爽人久久久| 在线观看av一区二区| 国产成人aaa| 美脚の诱脚舐め脚责91| 亚洲精品成a人| 国产午夜精品一区二区| 6080国产精品一区二区| 99久久精品免费看| 国产精品91xxx| 日韩av二区在线播放| 亚洲自拍偷拍av| 国产精品美女久久久久av爽李琼| 欧美一级国产精品| 日本道色综合久久| 国产suv精品一区二区6| 久久国产精品露脸对白| 亚洲成人av一区二区三区| 一区在线播放视频| 欧美高清在线精品一区| 久久综合久久综合亚洲| 91精品国产色综合久久不卡蜜臀| 欧美无人高清视频在线观看| 99久久综合精品| 波多野结衣在线aⅴ中文字幕不卡| 六月婷婷色综合| 蜜桃一区二区三区在线观看| 亚洲一区二区欧美激情| 亚洲综合在线五月| 一区二区三区中文在线| ●精品国产综合乱码久久久久| 国产亚洲成av人在线观看导航 | 91丨九色丨蝌蚪富婆spa| 国产传媒久久文化传媒| 久久国产精品无码网站| 激情综合网av| 国产一区二区三区日韩| 国产精品一区在线观看你懂的| 久久精品国产久精国产| 国产毛片精品一区| 国产精品18久久久久久vr| 国产xxx精品视频大全| 国产成人精品综合在线观看 | 蜜桃传媒麻豆第一区在线观看| 五月婷婷另类国产| 日韩专区一卡二卡| 美女免费视频一区二区| 久久99日本精品| 国产精品66部| 91网站在线播放| 欧美老肥妇做.爰bbww视频| 884aa四虎影成人精品一区| 5858s免费视频成人| 久久只精品国产| 蜜桃久久久久久久| 国产永久精品大片wwwapp| 福利电影一区二区| 欧美性猛片aaaaaaa做受| 91精品国产综合久久精品麻豆 | 91.com在线观看| 日韩女优制服丝袜电影| 亚洲国产成人午夜在线一区| 中文字幕佐山爱一区二区免费| 亚洲成人你懂的| 国产乱子伦视频一区二区三区 | 欧美亚洲自拍偷拍| 日韩一区二区三区在线| 国产精品久久久久久久蜜臀| 性做久久久久久久久| 国产精品一区二区在线观看不卡| 色综合久久88色综合天天6| 制服.丝袜.亚洲.中文.综合| 久久精品一级爱片| 午夜精彩视频在线观看不卡| 国产精一区二区三区| 欧美日韩精品一区二区在线播放| 欧美精品一区二区三区很污很色的| 成人欧美一区二区三区| 久久99国产精品久久99| 欧美熟乱第一页| 国产精品毛片大码女人|