當前位置: 首頁>>代碼示例>>Java>>正文


Java ToolItem.setSelection方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.ToolItem.setSelection方法的典型用法代碼示例。如果您正苦於以下問題:Java ToolItem.setSelection方法的具體用法?Java ToolItem.setSelection怎麽用?Java ToolItem.setSelection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.ToolItem的用法示例。


在下文中一共展示了ToolItem.setSelection方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showPage

import org.eclipse.swt.widgets.ToolItem; //導入方法依賴的package包/類
public void showPage(JSmoothPage page) {
    stack.topControl = page.getControl();
    if (pagearea != null) pagearea.layout();
    ToolItem item = page.getToolItem();
    if (!item.getSelection()) item.setSelection(true);
}
 
開發者ID:BisonSchweizAG,項目名稱:JSmooth,代碼行數:7,代碼來源:JSmoothApplication.java

示例2: createViewItems

import org.eclipse.swt.widgets.ToolItem; //導入方法依賴的package包/類
public void createViewItems(ToolBar tb) {
	visibilityItem = new DropDownToolItem(tb, false, true, true, SWT.CHECK);		
	visibilityItem.ti.setImage(Images.EYE);
	String vtt = "Visibility of items on canvas"; 
	
	showRegionsItem = visibilityItem.addItem("Show Regions", Images.EYE, vtt);
	showLinesItem = visibilityItem.addItem("Show Lines", Images.EYE, vtt);
	showBaselinesItem = visibilityItem.addItem("Show Baselines", Images.EYE, vtt);
	showWordsItem = visibilityItem.addItem("Show Words", Images.EYE, vtt);
	showPrintspaceItem = visibilityItem.addItem("Show Printspace", Images.EYE, vtt);
	renderBlackeningsItem = visibilityItem.addItem("Render Blackenings", Images.EYE, vtt);
	showReadingOrderRegionsMenuItem = visibilityItem.addItem("Show regions reading order", Images.EYE, vtt);
	showReadingOrderLinesMenuItem = visibilityItem.addItem("Show lines reading order", Images.EYE, vtt);
	showReadingOrderWordsMenuItem = visibilityItem.addItem("Show words reading order", Images.EYE, vtt);		

	selectionMode = new ToolItem(tb, SWT.RADIO);
	selectionMode.setToolTipText("Selection mode");
	selectionMode.setSelection(true);
	selectionMode.setImage(Images.getOrLoad("/icons/cursor.png"));
	modeMap.put(selectionMode, CanvasMode.SELECTION);

	zoomSelection = new ToolItem(tb, SWT.RADIO);
	zoomSelection.setToolTipText("Zoom selection mode");
	zoomSelection.setImage(Images.getOrLoad("/icons/zoom_rect.png"));
	modeMap.put(zoomSelection, CanvasMode.ZOOM);
	
	loupe = new ToolItem(tb, SWT.RADIO);
	loupe.setToolTipText("Loupe mode");
	loupe.setImage(Images.getOrLoad("/icons/zoom.png"));
	modeMap.put(loupe, CanvasMode.LOUPE);		
	
	// toolItem = new ToolItem(this, SWT.SEPARATOR);

	zoomIn = new ToolItem(tb, SWT.NONE);

	zoomIn.setToolTipText("Zoom in");
	zoomIn.setImage(Images.getOrLoad("/icons/zoom_in.png"));

	zoomOut = new ToolItem(tb, SWT.NONE);

	zoomOut.setToolTipText("Zoom out");
	zoomOut.setImage(Images.getOrLoad("/icons/zoom_out.png"));
			
	fitItem = new DropDownToolItem(tb, false, true, false, SWT.NONE);
	fitItem.addItem("Fit to page", Images.getOrLoad("/icons/arrow_in.png"), "Fit to page");
	fitItem.addItem("Original size", Images.getOrLoad( "/icons/arrow_out.png"), "Original size");
	fitItem.addItem("Fit to width", Images.getOrLoad("/icons/arrow_left_right.png"), "Fit to width");
	fitItem.addItem("Fit to height", Images.getOrLoad("/icons/arrow_up_down.png"), "Fit to height");
	
	rotateItem = new DropDownToolItem(tb, false, true, false, SWT.NONE);
	rotateItem.addItem("Rotate left", Images.getOrLoad("/icons/arrow_turn_left.png"), "Rotate left");
	rotateItem.addItem("Rotate right", Images.getOrLoad("/icons/arrow_turn_right.png"), "Rotate right");
	rotateItem.addItem("Rotate left 90 degress", Images.getOrLoad("/icons/arrow_turn_left_90.png"), "Rotate left 90 degress");
	rotateItem.addItem("Rotate right 90 degrees", Images.getOrLoad("/icons/arrow_turn_right_90.png"), "Rotate right 90 degrees");
	rotateItem.addItem("Translate left", Images.getOrLoad("/icons/arrow_left.png"), "Translate left");
	rotateItem.addItem("Translate right", Images.getOrLoad("/icons/arrow_right.png"), "Translate right");
	rotateItem.addItem("Translate up", Images.getOrLoad("/icons/arrow_up.png"), "Translate up");
	rotateItem.addItem("Translate down", Images.getOrLoad("/icons/arrow_down.png"), "Translate down");
	
	imageVersionDropdown = new DropDownToolItem(tb, true, false, true, SWT.RADIO);
	
	String versText = "Image file type displayed\n\torig: original image\n\tview: compressed viewing file\n\tbin: binarized image";
	imageVersionDropdown.addItem("orig", null, versText, false);
	imageVersionDropdown.addItem("view", null, versText, true);
	imageVersionDropdown.addItem("bin", null, versText, false);
	imageVersionDropdown.selectItem(1, false);
	
	imgEnhanceItem = new ToolItem(tb, SWT.PUSH);
	imgEnhanceItem.setImage(Images.CONTRAST);
	
	viewSettingsMenuItem = new ToolItem(tb, SWT.PUSH);
	viewSettingsMenuItem.setToolTipText("Change &viewing settings...");
	viewSettingsMenuItem.setImage(Images.getOrLoad("/icons/palette.png"));
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:75,代碼來源:CanvasToolBar.java

示例3: setSelection

import org.eclipse.swt.widgets.ToolItem; //導入方法依賴的package包/類
public static void setSelection(ToolItem ti, boolean selection) {
	if (isDisposed(ti))
		return;
	
	ti.setSelection(selection);
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:7,代碼來源:SWTUtil.java


注:本文中的org.eclipse.swt.widgets.ToolItem.setSelection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。