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

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

?? scrolledcomposite.java

?? 源碼為Eclipse開源開發平臺桌面開發工具SWT的源代碼,
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************* * Copyright (c) 2000, 2004 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v10.html *  * Contributors: *     IBM Corporation - initial API and implementation *******************************************************************************/package org.eclipse.swt.custom;import org.eclipse.swt.*;import org.eclipse.swt.graphics.*;import org.eclipse.swt.widgets.*;/** * A ScrolledComposite provides scrollbars and will scroll its content when the user * uses the scrollbars. * * * <p>There are two ways to use the ScrolledComposite: *  * <p> * 1) Set the size of the control that is being scrolled and the ScrolledComposite  * will show scrollbars when the contained control can not be fully seen. *  * 2) The second way imitates the way a browser would work.  Set the minimum size of * the control and the ScrolledComposite will show scroll bars if the visible area is  * less than the minimum size of the control and it will expand the size of the control  * if the visible area is greater than the minimum size.  This requires invoking  * both setMinWidth(), setMinHeight() and setExpandHorizontal(), setExpandVertical(). *  * <code><pre> * public static void main (String [] args) { *      Display display = new Display (); *      Color red = display.getSystemColor(SWT.COLOR_RED); *      Color blue = display.getSystemColor(SWT.COLOR_BLUE); *      Shell shell = new Shell (display); *      shell.setLayout(new FillLayout()); * 	 *      // set the size of the scrolled content - method 1 *      final ScrolledComposite sc1 = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); *      final Composite c1 = new Composite(sc1, SWT.NONE); *      sc1.setContent(c1); *      c1.setBackground(red); *      GridLayout layout = new GridLayout(); *      layout.numColumns = 4; *      c1.setLayout(layout); *      Button b1 = new Button (c1, SWT.PUSH); *      b1.setText("first button"); *      c1.setSize(c1.computeSize(SWT.DEFAULT, SWT.DEFAULT)); *       *      // set the minimum width and height of the scrolled content - method 2 *      final ScrolledComposite sc2 = new ScrolledComposite(shell, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); *      sc2.setExpandHorizontal(true); *      sc2.setExpandVertical(true); *      final Composite c2 = new Composite(sc2, SWT.NONE); *      sc2.setContent(c2); *      c2.setBackground(blue); *      layout = new GridLayout(); *      layout.numColumns = 4; *      c2.setLayout(layout); *      Button b2 = new Button (c2, SWT.PUSH); *      b2.setText("first button"); *      sc2.setMinSize(c2.computeSize(SWT.DEFAULT, SWT.DEFAULT)); *       *      Button add = new Button (shell, SWT.PUSH); *      add.setText("add children"); *      final int[] index = new int[]{0}; *      add.addListener(SWT.Selection, new Listener() { *          public void handleEvent(Event e) { *              index[0]++; *              Button button = new Button(c1, SWT.PUSH); *              button.setText("button "+index[0]); *              // reset size of content so children can be seen - method 1 *              c1.setSize(c1.computeSize(SWT.DEFAULT, SWT.DEFAULT)); *              c1.layout(); *               *              button = new Button(c2, SWT.PUSH); *              button.setText("button "+index[0]); *              // reset the minimum width and height so children can be seen - method 2 *              sc2.setMinSize(c2.computeSize(SWT.DEFAULT, SWT.DEFAULT)); *              c2.layout(); *          } *      }); *  *      shell.open (); *      while (!shell.isDisposed ()) { *          if (!display.readAndDispatch ()) display.sleep (); *      } *      display.dispose (); * } * </pre></code> * * <dl> * <dt><b>Styles:</b><dd>H_SCROLL, V_SCROLL * </dl> */public class ScrolledComposite extends Composite {	private Control content;	private Listener contentListener;		private int minHeight = 0;	private int minWidth = 0;	private boolean expandHorizontal = false;	private boolean expandVertical = false;	private boolean alwaysShowScroll = false;	private boolean inResize = false;/** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. * <p> * The style value is either one of the style constants defined in * class <code>SWT</code> which is applicable to instances of this * class, or must be built by <em>bitwise OR</em>'ing together  * (that is, using the <code>int</code> "|" operator) two or more * of those <code>SWT</code> style constants. The class description * lists the style constants that are applicable to the class. * Style bits are also inherited from superclasses. * </p> * * @param parent a widget which will be the parent of the new instance (cannot be null) * @param style the style of widget to construct * * @exception IllegalArgumentException <ul> *    <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * @exception SWTException <ul> *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li> * </ul> * * @see SWT#H_SCROLL * @see SWT#V_SCROLL * @see #getStyle() */	public ScrolledComposite(Composite parent, int style) {	super(parent, checkStyle(style));		ScrollBar hBar = getHorizontalBar ();	if (hBar != null) {		hBar.addListener (SWT.Selection, new Listener () {			public void handleEvent (Event e) {				hScroll();			}		});	}		ScrollBar vBar = getVerticalBar ();	if (vBar != null) {		vBar.addListener (SWT.Selection, new Listener () {			public void handleEvent (Event e) {				vScroll();			}		});	}		addListener (SWT.Resize,  new Listener () {		public void handleEvent (Event e) {			resize();		}	});		contentListener = new Listener() {		public void handleEvent(Event e) {			if (e.type != SWT.Resize) return;			resize();		}	};}private static int checkStyle (int style) {	int mask = SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT;	return style & mask;}public Point computeSize (int wHint, int hHint, boolean changed) {	checkWidget ();	/*	* When a composite does layout without using a layout	* manager, it must take into account the preferred size	* of it's children when computing it's preferred size in	* the same way that a layout manager would.  In particular,	* when a scrolled composite hides the scroll bars and	* places a child to fill the client area, then repeated	* calls to compute the preferred size of the scrolled	* composite should not keep adding in the space used by	* the scroll bars.	*/	if (content == null) {		return super.computeSize (wHint, hHint, changed);	}	Point size = content.computeSize (wHint, hHint, changed);	Rectangle trim = computeTrim (0, 0, size.x, size.y);	return new Point (trim.width, trim.height);}/** * Returns the Always Show Scrollbars flag.  True if the scrollbars are  * always shown even if they are not required.  False if the scrollbars are only  * visible when some part of the composite needs to be scrolled to be seen. * The H_SCROLL and V_SCROLL style bits are also required to enable scrollbars in the  * horizontal and vertical directions. *  * @return the Always Show Scrollbars flag value */public boolean getAlwaysShowScrollBars() {	//checkWidget();	return alwaysShowScroll;}/** * Get the content that is being scrolled. *  * @return the control displayed in the content area */public Control getContent() {	//checkWidget();	return content;}void hScroll() {	if (content == null) return;	Point location = content.getLocation ();	ScrollBar hBar = getHorizontalBar ();	int hSelection = hBar.getSelection ();	content.setLocation (-hSelection, location.y);}public void layout(boolean changed) {	checkWidget();	if (content == null) return;	Rectangle contentRect = content.getBounds();	ScrollBar hBar = getHorizontalBar ();	ScrollBar vBar = getVerticalBar ();	if (!alwaysShowScroll) {		boolean hVisible = needHScroll(contentRect, false);		boolean vVisible = needVScroll(contentRect, hVisible);		if (!hVisible && vVisible) hVisible = needHScroll(contentRect, vVisible);		if (hBar != null) hBar.setVisible(hVisible);		if (vBar != null) vBar.setVisible(vVisible);	}	Rectangle hostRect = getClientArea();	if (expandHorizontal) {		contentRect.width = Math.max(minWidth, hostRect.width);		}	if (expandVertical) {		contentRect.height = Math.max(minHeight, hostRect.height);	}	if (hBar != null) {		hBar.setMaximum (contentRect.width);		hBar.setThumb (Math.min (contentRect.width, hostRect.width));		int hPage = contentRect.width - hostRect.width;		int hSelection = hBar.getSelection ();		if (hSelection >= hPage) {			if (hPage <= 0) {				hSelection = 0;				hBar.setSelection(0);			}			contentRect.x = -hSelection;		}	}	if (vBar != null) {		vBar.setMaximum (contentRect.height);		vBar.setThumb (Math.min (contentRect.height, hostRect.height));		int vPage = contentRect.height - hostRect.height;		int vSelection = vBar.getSelection ();		if (vSelection >= vPage) {			if (vPage <= 0) {				vSelection = 0;				vBar.setSelection(0);			}			contentRect.y = -vSelection;		}	}		content.setBounds (contentRect);}private boolean needHScroll(Rectangle contentRect, boolean vVisible) {	ScrollBar hBar = getHorizontalBar();	if (hBar == null) return false;		Rectangle hostRect = getBounds();	int border = getBorderWidth();	hostRect.width -= 2*border;	ScrollBar vBar = getVerticalBar();	if (vVisible && vBar != null) hostRect.width -= vBar.getSize().x;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91高清视频免费看| 91啪在线观看| 天天色图综合网| 亚洲女同ⅹxx女同tv| 亚洲视频一区二区在线| 亚洲一区二区五区| 中文字幕一区日韩精品欧美| 国产午夜一区二区三区| 国产午夜久久久久| 国产无一区二区| 国产精品夫妻自拍| 国产精品成人一区二区艾草| 中文字幕日韩精品一区| 国产精品久久久久精k8| 亚洲人午夜精品天堂一二香蕉| 亚洲人精品午夜| 亚洲二区在线观看| 免费欧美日韩国产三级电影| 久久国产精品99精品国产| 国产一区二区三区四区五区美女 | 欧美一区二区精美| 日韩一级完整毛片| 国产午夜精品一区二区三区视频 | 久久久亚洲精华液精华液精华液 | 日韩高清欧美激情| 精品一区二区三区在线观看国产| 韩国v欧美v亚洲v日本v| 播五月开心婷婷综合| 欧美色电影在线| 欧美大片日本大片免费观看| 国产蜜臀97一区二区三区 | 日韩精品一区二区三区中文不卡 | 亚洲视频狠狠干| 五月激情综合色| 国产成人在线视频免费播放| 91网站最新网址| 欧美一二区视频| 亚洲婷婷在线视频| 日本亚洲免费观看| 91在线观看视频| 日韩亚洲欧美中文三级| 中文字幕一区二区三区四区| 亚洲成人免费视频| 成人高清在线视频| 欧美一区二区三区思思人| 亚洲国产精品99久久久久久久久| 亚洲国产中文字幕| 高清久久久久久| 日韩一区二区三区电影 | 日日夜夜精品免费视频| 成人一区二区三区在线观看| 69堂亚洲精品首页| 夜夜操天天操亚洲| 91社区在线播放| 国产偷国产偷精品高清尤物| 三级一区在线视频先锋| 色综合久久久久久久| 欧美激情一区二区三区在线| 久久国产精品72免费观看| 欧美日韩美女一区二区| 亚洲另类春色校园小说| 成人免费视频播放| 久久久久久麻豆| 精品一区二区三区免费观看| 欧美丰满少妇xxxxx高潮对白| 综合色中文字幕| 99视频精品全部免费在线| 久久久久久久久久久久久久久99| 日本在线不卡视频一二三区| 欧美精品久久99久久在免费线 | 舔着乳尖日韩一区| 欧美三级欧美一级| 午夜一区二区三区视频| 精品视频1区2区| 亚洲国产成人av| 欧美四级电影在线观看| 亚洲综合一区二区精品导航| 色综合久久88色综合天天6| 亚洲欧洲精品一区二区三区不卡| 国产91精品久久久久久久网曝门| 精品国产一区二区三区不卡| 久草这里只有精品视频| 精品国产一区二区三区av性色| 久久精品国产亚洲一区二区三区| 日韩视频免费观看高清完整版| 日韩av一级片| 亚洲精品一区二区三区蜜桃下载 | 6080日韩午夜伦伦午夜伦| 性感美女久久精品| 日韩一级片网站| 另类调教123区| 中国色在线观看另类| 91在线精品一区二区| 亚洲国产精品久久人人爱蜜臀| 欧美丝袜自拍制服另类| 蜜臀精品久久久久久蜜臀| 精品久久久三级丝袜| 大桥未久av一区二区三区中文| 亚洲少妇30p| 88在线观看91蜜桃国自产| 久久99热99| 国产精品不卡一区二区三区| 在线欧美日韩精品| 久久精品久久久精品美女| 国产欧美一区二区精品性色超碰| 91视频精品在这里| 久久精品免费观看| 亚洲欧美成aⅴ人在线观看| 欧美一区二区三区视频免费播放 | 国产精华液一区二区三区| 亚洲色图都市小说| 欧美第一区第二区| 色婷婷精品久久二区二区蜜臀av| 婷婷综合另类小说色区| 国产天堂亚洲国产碰碰| 日本韩国视频一区二区| 国产制服丝袜一区| 亚洲一区二区精品3399| 久久久99精品免费观看| 欧美日韩国产电影| 波多野结衣亚洲| 热久久免费视频| 亚洲激情成人在线| 国产拍欧美日韩视频二区| 在线不卡a资源高清| 99国产麻豆精品| 国产一区91精品张津瑜| 三级精品在线观看| 亚洲精品免费视频| 日本一区二区三区在线观看| 欧美精品少妇一区二区三区| av欧美精品.com| 国产精品综合一区二区| 亚洲第一久久影院| 亚洲欧美福利一区二区| 中文字幕国产一区| 欧美精品一区二区三区蜜臀 | 久久久高清一区二区三区| 欧美日韩国产综合一区二区| 99国产精品久久久久久久久久| 韩国女主播一区二区三区| 日韩av午夜在线观看| 五月天国产精品| 亚洲第一成年网| 亚洲国产精品一区二区久久恐怖片| 亚洲区小说区图片区qvod| 欧美国产精品一区| 国产精品情趣视频| 日本一区二区三区四区在线视频 | 91精品国产综合久久小美女| 在线观看91视频| 91久久免费观看| 色8久久人人97超碰香蕉987| 99麻豆久久久国产精品免费| 成人18视频在线播放| 国产·精品毛片| 成人黄色a**站在线观看| 成人福利在线看| 91香蕉视频黄| 欧美三区在线观看| 91精品国产品国语在线不卡| 欧美一区二区三区在线视频| 日韩一区二区免费视频| 久久先锋资源网| 国产精品卡一卡二卡三| 亚洲另类在线制服丝袜| 视频一区视频二区中文字幕| 喷水一区二区三区| 国产一区二区免费在线| 成人禁用看黄a在线| 99久久精品费精品国产一区二区| fc2成人免费人成在线观看播放| 99久久er热在这里只有精品66| 91丝袜美女网| 欧美日韩国产影片| 久久亚洲一级片| 综合分类小说区另类春色亚洲小说欧美| **欧美大码日韩| 性久久久久久久久久久久| 国产一区欧美二区| 91免费国产在线观看| 在线不卡欧美精品一区二区三区| 久久毛片高清国产| 亚洲一区自拍偷拍| 国内不卡的二区三区中文字幕| 不卡欧美aaaaa| 欧美一区二区三区视频免费 | 久久婷婷国产综合国色天香| 中文一区二区在线观看| 亚洲一区二区三区四区不卡| 国产在线精品一区二区夜色 | 色久综合一二码| 欧美mv和日韩mv国产网站| 国产精品国产自产拍在线| 天堂成人免费av电影一区| 成人综合在线视频| 日韩一区二区在线播放| 日韩毛片精品高清免费| 国内精品久久久久影院薰衣草| 欧美性大战久久久久久久蜜臀|