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

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

?? redmondshelfstrategy.java

?? 利用它可以做出非常漂亮的swt界面,包含的組件有PShelf Plist
?? JAVA
字號(hào):
package com.swtplus.widgets.shelf;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.GC;

import com.swtplus.internal.FontUtils;
import com.swtplus.internal.GraphicUtils;
import com.swtplus.internal.PGC;
import com.swtplus.widgets.PShelf;
import com.swtplus.widgets.PShelfItem;

public class RedmondShelfStrategy implements IShelfStrategy {

	private int textMargin = 2;
	private int margin = 4;
	private PShelf parent;
	private int spacing = 8;
	
	private Font initialFont;
	private Font initialOpenFont;
	
	private Color gradient1;
	private Color gradient2;
	
	private Font font;
	private Font selectedFont;
	
	private Color selectedGradient1;
	private Color selectedGradient2;
	
	private Color hoverGradient1;
	private Color hoverGradient2;
	
	private Color lineColor;
	
	private Color selectedForeground;
	
	
	public RedmondShelfStrategy(int style) {
	}

	public int computeHeight(PShelfItem item, GC gc) {
		
		int h = 0;
		
		gc.setFont(font);
		
		if (item.getImage() == null){
			h = gc.getFontMetrics().getHeight() + (2*(textMargin));
		} else {
			h = Math.max(item.getImage().getBounds().height,gc.getFontMetrics().getHeight() + (2*textMargin));
		}
		
		gc.setFont(selectedFont);
		
		h = Math.max(h,gc.getFontMetrics().getHeight() + (2*textMargin));
		
		h += 2*margin;
		
		if (h % 2 != 0)
			h ++;
		
		return h;
	}

	public void paintItem(PShelfItem item, GC gc, int y, int height, int width,
			boolean open, boolean focus, boolean hover, boolean showPin,
			boolean pinned) {

		
		//Color back = parent.getBackground();
		Color fore = parent.getForeground();
		
		if (open){
			gc.setForeground(selectedGradient1);
		} else {
			if (hover){
				gc.setForeground(hoverGradient1);
			} else {
				gc.setForeground(gradient1);
			}
		}
		if (open){
			gc.setBackground(selectedGradient2);
		} else {
			if (hover){
				gc.setBackground(hoverGradient2);
			} else {
				gc.setBackground(gradient2);
			}
		}
		gc.fillGradientRectangle(0,y,width,height,true);		

		if (!open){
			gc.setForeground(lineColor);
			gc.drawLine(0,y,width -1,y);
		}			
		
		int x = 6;
		if (item.getImage() != null && !open){
			int y2 = (height - item.getImage().getBounds().height)/2;
			if ((height - item.getImage().getBounds().height) % 2 != 0)
				y2 ++;
			
			gc.drawImage(item.getImage(),x,y + y2);
			
			x += item.getImage().getBounds().width + spacing;
		}
		gc.setForeground(fore);
		
		if (open){
			gc.setFont(selectedFont);
			gc.setForeground(selectedForeground);
		} else {
			gc.setFont(font);
		}
		
		
		int y2 = (height - gc.getFontMetrics().getHeight())/2;
		if ((height - gc.getFontMetrics().getHeight()) % 2 != 0)
			y2 ++;
		
		int textWidth = width - 12;
		if (item.getImage() != null){
			textWidth -= item.getImage().getBounds().width;
			textWidth -= 6;
		}
		
		PGC pgc = new PGC(gc);
		gc.drawString(pgc.getShortString(item.getText(),textWidth),x,y +y2,true);
		
		if (item.getImage() != null && open){
			int y3 = (height - item.getImage().getBounds().height)/2;
			if ((height - item.getImage().getBounds().height) % 2 != 0)
				y3 ++;
			
			gc.drawImage(item.getImage(),width - 6 - item.getImage().getBounds().width,y + y3);
		}
		
		if (focus){
			gc.drawFocus(1,1,width-2,height-1);
		}
	}

	public void initialize(PShelf parent) {
		this.parent = parent;
		initialFont = FontUtils.createBoldFont(parent.getFont());
		//parent.setFont(initialFont);
		
		Color baseColor = parent.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT);
		
		gradient1 = GraphicUtils.createNewBlendedColor(baseColor,parent.getDisplay().getSystemColor(SWT.COLOR_WHITE),30);
		
		baseColor = GraphicUtils.createNewBlendedColor(parent.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT),parent.getDisplay().getSystemColor(SWT.COLOR_WHITE),80);
		
		gradient2 = GraphicUtils.createNewSaturatedColor(baseColor,.01f);
		
		baseColor.dispose();
		
		lineColor = GraphicUtils.createNewSaturatedColor(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION),.02f);

		
		baseColor = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);
		
		selectedGradient1 = GraphicUtils.createNewBlendedColor(baseColor,parent.getDisplay().getSystemColor(SWT.COLOR_WHITE),70);
		
		baseColor = GraphicUtils.createNewBlendedColor(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION),parent.getDisplay().getSystemColor(SWT.COLOR_BLACK),80);
		
		selectedGradient2 = GraphicUtils.createNewSaturatedColor(baseColor,.02f);
		
		baseColor.dispose();

		//initialOpenFont = FontUtils.createFont(parent.getFont(),4,SWT.BOLD);
		initialOpenFont = new Font(parent.getDisplay(),"Arial",12,SWT.BOLD);
		
		font = initialFont;
		selectedFont = initialOpenFont;
		
		selectedForeground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT);
		
		baseColor = GraphicUtils.createNewReverseColor(parent.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND));
		
		hoverGradient1 = GraphicUtils.createNewBlendedColor(baseColor,parent.getDisplay().getSystemColor(SWT.COLOR_WHITE),30);
		
				
		Color baseColor2 = GraphicUtils.createNewBlendedColor(baseColor,parent.getDisplay().getSystemColor(SWT.COLOR_WHITE),99);
		
		hoverGradient2 = GraphicUtils.createNewSaturatedColor(baseColor2,.00f);
		
		baseColor2.dispose();
		baseColor.dispose();
	}

	public void dispose() {
		initialFont.dispose();
		gradient1.dispose();
		gradient2.dispose();
		lineColor.dispose();
		
		selectedGradient1.dispose();
		selectedGradient2.dispose();
		
		initialFont.dispose();
		initialOpenFont.dispose();
		
		hoverGradient1.dispose();
		hoverGradient2.dispose();
	}

	public boolean isOpenOnTop() {
		return true;
	}

	public Color getLineColor() {
		return lineColor;
	}

	public void setLineColor(Color lineColor) {
		this.lineColor = lineColor;
	}

	public Font getFont() {
		return font;
	}

	public void setFont(Font font) {
		this.font = font;
	}

	public Color getGradient1() {
		return gradient1;
	}

	public void setGradient1(Color gradient1) {
		this.gradient1 = gradient1;
	}

	public Color getGradient2() {
		return gradient2;
	}

	public void setGradient2(Color gradient2) {
		this.gradient2 = gradient2;
	}

	public Color getHoverGradient1() {
		return hoverGradient1;
	}

	public void setHoverGradient1(Color hoverGradient1) {
		this.hoverGradient1 = hoverGradient1;
	}

	public Color getHoverGradient2() {
		return hoverGradient2;
	}

	public void setHoverGradient2(Color hoverGradient2) {
		this.hoverGradient2 = hoverGradient2;
	}

	public Font getSelectedFont() {
		return selectedFont;
	}

	public void setSelectedFont(Font selectedFont) {
		this.selectedFont = selectedFont;
	}

	public Color getSelectedForeground() {
		return selectedForeground;
	}

	public void setSelectedForeground(Color selectedForeground) {
		this.selectedForeground = selectedForeground;
	}

	public Color getSelectedGradient1() {
		return selectedGradient1;
	}

	public void setSelectedGradient1(Color selectedGradient1) {
		this.selectedGradient1 = selectedGradient1;
	}

	public Color getSelectedGradient2() {
		return selectedGradient2;
	}

	public void setSelectedGradient2(Color selectedGradient2) {
		this.selectedGradient2 = selectedGradient2;
	}

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩人成在线播放| 亚洲女爱视频在线| 一本大道综合伊人精品热热 | 亚洲精品一区二区三区影院| 91老师国产黑色丝袜在线| 精品一区二区成人精品| 亚洲国产精品一区二区www在线| 国产亚洲精品久| 日韩视频一区二区在线观看| 色88888久久久久久影院野外| 丁香激情综合国产| 蜜桃av一区二区| 亚洲福利视频一区二区| 亚洲欧洲精品天堂一级| 久久久三级国产网站| 日韩视频中午一区| 欧美日韩黄色影视| 欧美四级电影网| 99re6这里只有精品视频在线观看| 国内精品免费**视频| 另类欧美日韩国产在线| 天堂精品中文字幕在线| 一区二区三区在线观看国产| 中文字幕一区不卡| 欧美经典一区二区| 欧美国产在线观看| 国产女同性恋一区二区| 久久精品一二三| 久久麻豆一区二区| 久久久不卡网国产精品二区| 久久综合999| 久久奇米777| 久久久久久久综合| 精品国产第一区二区三区观看体验| 欧美一卡二卡三卡| 91麻豆精品国产91久久久 | 成人av在线资源网站| 成人免费的视频| av中文字幕亚洲| 日本精品一区二区三区高清 | 2017欧美狠狠色| 精品卡一卡二卡三卡四在线| 欧美r级在线观看| 久久亚洲私人国产精品va媚药| 久久先锋影音av| 欧美极品xxx| 国产精品国产三级国产三级人妇| 亚洲色图欧美偷拍| 亚洲综合免费观看高清完整版| 一区二区三区久久| 首页欧美精品中文字幕| 日韩电影在线免费观看| 麻豆精品视频在线观看| 国产乱子轮精品视频| 成人美女视频在线观看18| 99精品久久久久久| 欧美女孩性生活视频| 欧美第一区第二区| 国产精品视频九色porn| 洋洋av久久久久久久一区| 五月婷婷综合在线| 国产在线国偷精品免费看| 成人一道本在线| 91国产视频在线观看| 欧美一区二区福利视频| 国产欧美精品一区| 亚洲午夜成aⅴ人片| 另类小说视频一区二区| 成人av影视在线观看| 欧美日韩国产高清一区二区| 精品国产一区二区三区忘忧草 | 亚洲精品视频免费看| 91免费看视频| 亚洲一级在线观看| 欧美二区三区的天堂| 成人黄页在线观看| 一区二区三区中文在线| 欧美精品三级日韩久久| 国产suv一区二区三区88区| 国产高清精品网站| 国产91精品在线观看| 亚洲免费观看高清| 亚洲综合一二三区| 欧美色中文字幕| 91福利在线看| 日韩一级高清毛片| 国产黑丝在线一区二区三区| 国产盗摄一区二区三区| 亚洲精品写真福利| 中文av字幕一区| 国产精品国产馆在线真实露脸 | 久久精品人人做人人爽97| 国产欧美中文在线| 国产最新精品精品你懂的| 精品亚洲成a人在线观看| 成人av网站免费| 欧美性做爰猛烈叫床潮| 99久久er热在这里只有精品66| 青青草一区二区三区| 麻豆91免费观看| a级精品国产片在线观看| 亚洲老妇xxxxxx| 日韩欧美亚洲一区二区| 国产91富婆露脸刺激对白| 欧美日韩在线直播| 蜜桃传媒麻豆第一区在线观看| 国产精品久久久久影院| 成人91在线观看| 亚洲乱码国产乱码精品精的特点| 亚洲欧洲国产专区| 亚洲国产精品一区二区www| 理论片日本一区| 91最新地址在线播放| av电影在线观看不卡| 成人免费视频视频| 亚洲精品伦理在线| 6080午夜不卡| 中文字幕精品在线不卡| 久久―日本道色综合久久| 不卡视频一二三| 色狠狠一区二区| 美女任你摸久久| 国产精品二区一区二区aⅴ污介绍| 91在线云播放| 国产精品婷婷午夜在线观看| 欧美日韩国产不卡| 捆绑调教美女网站视频一区| 国产美女在线观看一区| 成人毛片视频在线观看| 亚洲天堂成人在线观看| 一区二区三区精品视频| 91精品国产高清一区二区三区蜜臀 | 在线播放日韩导航| 国产精品一区二区不卡| 日韩女优电影在线观看| 在线91免费看| 国产成人免费视频网站| 成人一区二区视频| 日本精品视频一区二区| 亚洲第一福利视频在线| 免费观看在线色综合| 国产一区二区三区香蕉| 风间由美一区二区av101| 精品国产乱码91久久久久久网站| 久久国产精品色| 国产精品亚洲视频| 91啪九色porn原创视频在线观看| av激情成人网| 精品国产自在久精品国产| 国产做a爰片久久毛片| 国产欧美一区二区在线| 波多野结衣中文字幕一区| 成人欧美一区二区三区白人 | 午夜精品久久久久影视| 欧美一区二区三区公司| 精品制服美女丁香| 中文字幕不卡在线观看| 91一区一区三区| 亚瑟在线精品视频| 精品国产制服丝袜高跟| 懂色中文一区二区在线播放| 一区二区三区资源| 日韩欧美一二三四区| 成人午夜激情视频| 亚洲国产一区视频| 欧美变态tickle挠乳网站| 成人性生交大片免费看视频在线 | 丝袜a∨在线一区二区三区不卡| 日韩女同互慰一区二区| 成人综合在线观看| 五月婷婷色综合| 国产午夜精品一区二区三区嫩草 | 91精品国产色综合久久不卡电影| 国产酒店精品激情| 亚洲午夜免费电影| 日韩女优毛片在线| 一本大道久久a久久综合婷婷| 日韩电影免费一区| 欧美极品少妇xxxxⅹ高跟鞋| 欧美日韩中文字幕一区二区| 国产精品一品视频| 午夜伦理一区二区| 日本一区二区电影| 777色狠狠一区二区三区| 处破女av一区二区| 日本中文字幕一区二区有限公司| 国产日韩欧美制服另类| 欧美性猛片xxxx免费看久爱| 国产伦精一区二区三区| 五月激情丁香一区二区三区| 久久精品亚洲乱码伦伦中文| 欧美少妇bbb| 成人国产视频在线观看| 免费看欧美美女黄的网站| 亚洲精品免费视频| 中文子幕无线码一区tr| 欧美大片拔萝卜| 欧美精品乱人伦久久久久久| 成人免费视频视频在线观看免费| 蜜桃一区二区三区在线观看|