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

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

?? colorcomboexampler.java

?? 開源的關于SWT開發的圖形應用庫
?? JAVA
字號:
package com.swtplus.gallery;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.FontDialog;
import org.eclipse.swt.widgets.Label;

import com.swtplus.utility.Styler;
import com.swtplus.widgets.PCombo;
import com.swtplus.widgets.PGroup;
import com.swtplus.widgets.combo.ColorComboStrategy;
import com.swtplus.widgets.combo.NamedRGB;
import com.swtplus.widgets.group.SimpleGroupStrategy;

public class ColorComboExampler extends Composite implements IWidgetExampler {

	private Button resize;
	private Button readOnly;
	private ColorComboStrategy foregroundComboStrat;
	private PCombo foregroundCombo;
	private ColorComboStrategy backgroundComboStrat;
	private PCombo backgroundCombo;
	protected Font font;
	private Composite exampleArea;
	private boolean firstCreate = true;
	
	private PCombo pCombo;
	private Color foreground;
	private Color background;
	private Label l;
	private Button flat;
	private Button showSWT;
	private Button showDefault;
	private Button border;

	public ColorComboExampler(Composite c) {
		super(c, SWT.NONE);
		

		Styler colorStyler = new Styler();
		colorStyler.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
		
		Styler borderStyler = new Styler();
		borderStyler.setBorderColor(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
		
		SelectionListener sListener = new SelectionListener(){
			public void widgetSelected(SelectionEvent arg0) {
				recreate();
			}
			public void widgetDefaultSelected(SelectionEvent arg0) {
			}};
	
	
        this.setLayout(new FillLayout());
		final Composite container = new Composite (this,SWT.NONE);
		container.setBackground(c.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
		
		container.setLayout(new GridLayout());
		
		
		SimpleGroupStrategy sgs = new SimpleGroupStrategy(SWT.NONE);
		PGroup sgStyles = new PGroup(container,sgs);
		sgStyles.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
		sgStyles.setText("Styles");
		colorStyler.add(sgStyles);
		colorStyler.add(sgStyles.getBody());
		
		sgStyles.getBody().setLayout(new GridLayout());
		
		border = new Button(sgStyles.getBody(),SWT.CHECK | SWT.FLAT);
		border.setText("PCombo.BORDER");
		colorStyler.add(border);
		border.setSelection(true);
		border.addSelectionListener(sListener);
		
		resize = new Button(sgStyles.getBody(),SWT.CHECK | SWT.FLAT);
		resize.setText("PCombo.RESIZE");
		colorStyler.add(resize);
		resize.addSelectionListener(sListener);
		
		readOnly = new Button(sgStyles.getBody(),SWT.CHECK | SWT.FLAT);
		readOnly.setText("PCombo.READ_ONLY");
		colorStyler.add(readOnly);
		readOnly.addSelectionListener(sListener);
		
		flat = new Button(sgStyles.getBody(),SWT.CHECK | SWT.FLAT);
		flat.setText("PCombo.FLAT");
		colorStyler.add(flat);
		flat.addSelectionListener(sListener);

		showSWT = new Button(sgStyles.getBody(),SWT.CHECK | SWT.FLAT);
		showSWT.setText("ColorComboStrategy.SHOW_SWTPALETTE");
		colorStyler.add(showSWT);
		showSWT.addSelectionListener(sListener);

		showDefault = new Button(sgStyles.getBody(),SWT.CHECK | SWT.FLAT);
		showDefault.setText("ColorComboStrategy.SHOW_DEFAULT");
		colorStyler.add(showDefault);
		showDefault.addSelectionListener(sListener);
		
		
		sgs = new SimpleGroupStrategy(SWT.NONE);
		PGroup sg = new PGroup(container,sgs);
		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
		sg.setLayoutData(gd);
		sg.setText("Colors and Font");
		c = sg.getBody();
		GridLayout gl = new GridLayout();
		gl.numColumns = 2;
		c.setLayout(gl);
		colorStyler.add(sg);
		colorStyler.add(sg.getBody());
		
		Label colorForegroundLabel = new Label(c,SWT.NONE);
		colorForegroundLabel.setText("Foreground Color:");
		colorStyler.add(colorForegroundLabel);
		
		foregroundComboStrat = new ColorComboStrategy(ColorComboStrategy.SHOW_DEFAULT | ColorComboStrategy.SHOW_SWTPALETTE);
		foregroundCombo = new PCombo(c,PCombo.READ_ONLY | PCombo.FLAT,foregroundComboStrat);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		foregroundCombo.setLayoutData(gd);
		borderStyler.add(foregroundCombo);

		Label backLabel = new Label(c,SWT.NONE);
		backLabel.setText("Background Color:");
		colorStyler.add(backLabel);
		
		backgroundComboStrat = new ColorComboStrategy(ColorComboStrategy.SHOW_DEFAULT | ColorComboStrategy.SHOW_SWTPALETTE);
		backgroundCombo = new PCombo(c,PCombo.READ_ONLY | PCombo.FLAT,backgroundComboStrat);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		backgroundCombo.setLayoutData(gd);
		borderStyler.add(backgroundCombo);
		
		Label l = new Label(c,SWT.NONE);
		l.setText("Font:");
		colorStyler.add(l);
		
		Button fontButton = new Button(c,SWT.PUSH | SWT.FLAT);
		fontButton.setText("Change Font...");
		fontButton.addSelectionListener(new SelectionListener(){
			public void widgetDefaultSelected(SelectionEvent arg0) {
			}
			public void widgetSelected(SelectionEvent arg0) {
				FontDialog fd = new FontDialog(Display.getCurrent().getActiveShell());
				FontData fds = fd.open();
				if (fds != null){
					if (font != null)
						font.dispose();
					
					font = new Font(Display.getCurrent(),fds);
					recreate();
				}
			}});
		
		

		
		colorStyler.style();
		borderStyler.style();
		
		registerListeners(this);
	}

	public void setExampleArea(Composite area) {
		exampleArea = area;
		
		GridLayout gl = new GridLayout();
		gl.marginWidth = 100;
		area.setLayout(gl);
		recreate();
		
		firstCreate = false;		
	}
	
	public void recreate(){
		
		if (pCombo != null){
			pCombo.dispose();
		}
		if (l != null){
			l.dispose();
		}	
		
		int style = 0;
		if (showDefault.getSelection())
			style = style | ColorComboStrategy.SHOW_DEFAULT;
		if (showSWT.getSelection())
			style = style | ColorComboStrategy.SHOW_SWTPALETTE;
		
		ColorComboStrategy strategy = new ColorComboStrategy(style);
		
		
		if (foreground != null)
			foreground.dispose();
		if (background != null)
			background.dispose();
		
		style = SWT.NONE;
		if (border.getSelection())
			style = style | PCombo.BORDER;
		if (readOnly.getSelection())
			style = style | PCombo.READ_ONLY;
		if (resize.getSelection())
			style = style | PCombo.RESIZE;
		if (flat.getSelection())
			style = style | PCombo.FLAT;
		
		
		pCombo = new PCombo(exampleArea,style,strategy);

		if (firstCreate){
			foregroundComboStrat.setDefaultRGB(pCombo.getForeground().getRGB());
			foregroundCombo.setValue(new NamedRGB("Default",pCombo.getForeground().getRGB()));
			backgroundComboStrat.setDefaultRGB(pCombo.getBackground().getRGB());
			backgroundCombo.setValue(new NamedRGB("Default",pCombo.getBackground().getRGB()));

			font = null;
		} else {
			foreground = new Color(Display.getCurrent(), ((NamedRGB)foregroundCombo.getValue()).getRGB());
			pCombo.setForeground(foreground);
			
			background = new Color(Display.getCurrent(), ((NamedRGB)backgroundCombo.getValue()).getRGB());
			pCombo.setBackground(background);
			
			if (font != null)
				pCombo.setFont(font);
		}
		
		
//		GridData gd = new GridData(SWT.CENTER,SWT.TOP,true,false);
//		gd.verticalIndent = 100;
		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
		gd.verticalIndent = 100;
		
		//gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_CENTER;
		//gd.widthHint = 200;
		//gd.heightHint = 300;
		pCombo.setLayoutData(gd);
		
		l = new Label(exampleArea,SWT.NONE);
		gd = new GridData(SWT.CENTER,SWT.TOP,true,false);
		gd.heightHint = 70;
		l.setLayoutData(gd);
	
		
		exampleArea.layout();
	}

	public void registerListeners (Composite master){
		Control [] children = master.getChildren();
		for (int i = 0; i < children.length; i++) {
			Control child = children[i];
			if (child instanceof Composite){
				if (child instanceof Combo){
					Combo combo = (Combo) child;
					combo.addSelectionListener(new SelectionListener(){

						public void widgetSelected(SelectionEvent arg0) {
							//recreate();
						}

						public void widgetDefaultSelected(SelectionEvent arg0) {}
						
					});
				} else if (child instanceof PCombo){
					PCombo pCombo = (PCombo) child;
					pCombo.addModifyListener(new ModifyListener() {
						public void modifyText(ModifyEvent e) {
							recreate();
						}				
					});
				} else {
					registerListeners ((Composite) child);
				}
			}else if (child instanceof Button){
				Button button = (Button) child;
				button.addSelectionListener(new SelectionListener(){

					public void widgetSelected(SelectionEvent arg0) {
						recreate();
					}

					public void widgetDefaultSelected(SelectionEvent arg0) {}
					
				});
			}
		} 
	}

	public void dispose() {
		if (pCombo != null){
			pCombo.dispose();
		}
		if (l != null){
			l.dispose();
		}		
		super.dispose();
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕欧美一区| 综合网在线视频| 亚洲欧美日韩一区二区三区在线观看| 午夜久久电影网| 成人高清视频在线| 日韩欧美一区二区在线视频| 亚洲黄色av一区| 成人av在线资源| 欧美大白屁股肥臀xxxxxx| 一区二区三区在线看| 国产精品18久久久久久久网站| 欧美人狂配大交3d怪物一区| 日韩一区欧美小说| 成人天堂资源www在线| 精品国产在天天线2019| 天堂成人国产精品一区| 欧美天天综合网| 亚洲欧美另类在线| av成人动漫在线观看| 国产亚洲欧洲997久久综合| 精品中文字幕一区二区| 7777精品伊人久久久大香线蕉完整版 | 国产成人99久久亚洲综合精品| 欧美一区二区三区四区在线观看| 亚洲成a人片在线不卡一二三区| 成人精品在线视频观看| 国产亚洲人成网站| 国产精品久久精品日日| 久久er精品视频| 欧美精品 国产精品| 亚洲一区视频在线观看视频| 91片在线免费观看| 综合激情成人伊人| 一本到高清视频免费精品| 国产精品国产自产拍在线| 成人av免费在线播放| 久久奇米777| 国产精品一区在线观看乱码| 国产亚洲综合在线| 国产a精品视频| 中文字幕一区二区三区精华液| 风间由美一区二区av101| 国产精品乱码一区二三区小蝌蚪| 成人动漫中文字幕| 亚洲另类在线制服丝袜| 欧美亚洲综合网| 国产三级精品三级| 国内精品免费在线观看| 久久精品人人做人人爽人人| 成人在线一区二区三区| 亚洲欧美日韩国产综合| 欧美视频你懂的| 人人狠狠综合久久亚洲| 26uuuu精品一区二区| 国产91精品免费| 一区二区三区在线免费播放| 91精品蜜臀在线一区尤物| 九一久久久久久| 国产精品久久网站| 欧美日本乱大交xxxxx| 青青草精品视频| 国产免费成人在线视频| 在线观看国产精品网站| 奇米一区二区三区| 国产精品久久午夜| 7777精品伊人久久久大香线蕉完整版| 国精产品一区一区三区mba桃花 | 国产aⅴ精品一区二区三区色成熟| 国产色91在线| 欧美日韩国产综合视频在线观看| 欧美在线一二三四区| 亚洲国产欧美另类丝袜| 欧美va亚洲va| 色久优优欧美色久优优| 久久国产精品色婷婷| 国产精品丝袜在线| 在线免费一区三区| 日本一不卡视频| 日本一区二区三区dvd视频在线| 欧美在线|欧美| 成人网在线播放| 强制捆绑调教一区二区| 亚洲人吸女人奶水| 精品国产一区二区三区不卡| 欧美性猛交xxxxxxxx| 国产乱色国产精品免费视频| 香蕉成人伊视频在线观看| 国产精品美女久久久久久久久久久 | 亚洲一区免费观看| 中文字幕乱码亚洲精品一区| 日韩一区二区三区在线| 色老汉一区二区三区| 成人免费视频一区| 激情亚洲综合在线| 老司机一区二区| 天使萌一区二区三区免费观看| 亚洲桃色在线一区| 国产精品久久久久影院老司| 久久一区二区三区四区| 日韩欧美国产麻豆| 欧美日韩高清一区二区三区| 99r精品视频| 福利视频网站一区二区三区| 精品亚洲欧美一区| 六月婷婷色综合| 美女视频第一区二区三区免费观看网站| 亚洲欧美日韩久久| 亚洲天堂精品在线观看| 欧美激情中文不卡| 欧美国产1区2区| 久久精品人人做人人爽97| 久久久久久久综合日本| 精品久久久网站| 欧美精品一区二区三区在线播放 | 91影院在线免费观看| 99久久伊人久久99| av一本久道久久综合久久鬼色| 国产精品一级片在线观看| 国产一区二区免费在线| 国产成人在线影院| 国产成人精品免费网站| 成人精品鲁一区一区二区| 成人免费黄色大片| 色综合久久中文综合久久97 | 日本欧美大码aⅴ在线播放| 亚洲午夜在线观看视频在线| 亚洲综合一区二区三区| 亚洲一卡二卡三卡四卡无卡久久| 亚洲综合免费观看高清完整版 | 亚洲精品在线免费观看视频| 精品动漫一区二区三区在线观看| 久久品道一品道久久精品| 国产日韩欧美一区二区三区乱码| 日本一区二区三区四区在线视频| 国产精品久久久久久久久果冻传媒 | 亚洲在线观看免费| 日韩高清中文字幕一区| 国产精品综合久久| 91美女片黄在线观看| 欧美乱妇20p| 久久久精品综合| 亚洲精品欧美专区| 美女国产一区二区三区| 粉嫩蜜臀av国产精品网站| 色婷婷久久久综合中文字幕| 欧美成人性战久久| 91视频国产观看| 在线观看av一区二区| 欧美三级午夜理伦三级中视频| 欧美日韩国产欧美日美国产精品| 欧美大片在线观看| 亚洲欧洲日产国产综合网| 午夜在线电影亚洲一区| 国产传媒日韩欧美成人| 欧洲精品一区二区| 久久综合久久综合久久| 亚洲五月六月丁香激情| 国产精品香蕉一区二区三区| 欧洲一区二区三区在线| 久久久久久久久久久黄色| 亚洲一本大道在线| 国产v日产∨综合v精品视频| 6080日韩午夜伦伦午夜伦| 国产精品久久久久aaaa樱花| 久久不见久久见免费视频1| 一本一道波多野结衣一区二区| 欧美精品一区二区三区在线| 亚洲一区二区欧美激情| 国内外精品视频| 成人app网站| 欧美精品一区二区不卡| 亚洲精品日产精品乱码不卡| 国产麻豆精品久久一二三| 欧美日韩成人一区| 亚洲欧美综合色| 国产成人免费网站| 精品免费99久久| 三级不卡在线观看| 欧美精品 日韩| 亚洲欧洲av一区二区三区久久| 精品亚洲成a人| 欧美一区二区免费| 亚洲亚洲人成综合网络| 色综合久久综合网97色综合| 日本一区二区三区四区| 国产乱国产乱300精品| 日韩欧美国产高清| 欧美aaaaaa午夜精品| 欧洲精品一区二区三区在线观看| 中文字幕日韩av资源站| 成人小视频免费观看| 久久精品网站免费观看| 久久精品国产99| 精品少妇一区二区三区| 蜜桃av一区二区| 日韩精品一区二区三区在线观看| 日本va欧美va欧美va精品| 日韩一区二区电影网| 日本不卡一区二区三区 | 欧美不卡在线视频|