当前位置: 首页>>代码示例>>Java>>正文


Java NoGroupRenderer类代码示例

本文整理汇总了Java中org.eclipse.nebula.widgets.gallery.NoGroupRenderer的典型用法代码示例。如果您正苦于以下问题:Java NoGroupRenderer类的具体用法?Java NoGroupRenderer怎么用?Java NoGroupRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NoGroupRenderer类属于org.eclipse.nebula.widgets.gallery包,在下文中一共展示了NoGroupRenderer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: zoomModified

import org.eclipse.nebula.widgets.gallery.NoGroupRenderer; //导入依赖的package包/类
/**
 * Method that handles the zoom modification (scale widget).
 */
private void zoomModified() {
	double c = 1 + 0.1 * scale.getSelection();
	if (layout.topControl != null) {
		NoGroupRenderer gr = (NoGroupRenderer) ((Gallery) layout.topControl).getGroupRenderer();
		gr.setItemSize((int) (GALLERY_WIDTH * c), (int) (GALLERY_HEIGHT * c));
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:ReportTemplatesWizardPage.java

示例2: ThumbnailWidgetVirtualMinimal

import org.eclipse.nebula.widgets.gallery.NoGroupRenderer; //导入依赖的package包/类
public ThumbnailWidgetVirtualMinimal(Composite parent, final boolean displayTranscribedLines, int style) {
	super(parent, style);
	ENABLE_TRANSCRIBED_LINES = displayTranscribedLines;
	
	setLayout(new GridLayout());

	groupComposite = new Composite(this, SWT.NONE);
	GridLayout gl = new GridLayout(1, false);
	groupComposite.setLayout(gl);
	GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
	groupComposite.setLayoutData(gridData);

	gallery = new Gallery(groupComposite, SWT.V_SCROLL | SWT.MULTI | SWT.VIRTUAL);

	gallery.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	group = new GalleryItem(gallery, SWT.VIRTUAL);

	groupRenderer = new NoGroupRenderer();

	groupRenderer.setMinMargin(2);
	groupRenderer.setItemHeight(THUMB_HEIGHT);
	groupRenderer.setItemWidth(THUMB_WIDTH);
	groupRenderer.setAutoMargin(true);
	groupRenderer.setAlwaysExpanded(true);
	

	gallery.setGroupRenderer(groupRenderer);

	ir = new MyDefaultGalleryItemRenderer();
	ir.setShowLabels(true);
	
	gallery.setItemRenderer(ir);
	// virtual table stuff:
	gallery.setVirtualGroups(true);
	gallery.addListener(SWT.SetData, new GalleryFeedListener());
	
	gallery.addListener(SWT.MouseHover, new Listener() {
		
		@Override
		public void handleEvent(Event event) {
			GalleryItem item = gallery.getItem (new Point(event.x, event.y));
			if(item == null) {
				return;
			}
			int index;
			if (item.getParentItem() != null) { // if this is a leaf item
												// -> set nr of items to 0!
				index = item.getParentItem().indexOf(item);
			} else {
				index = gallery.indexOf(item);
			}
			String tooltipText = doc.getPages().get(index).getImgFileName() 
					+ "\nStatus: " 
					+ doc.getPages().get(index).getCurrentTranscript().getStatus().getStr();
			gallery.setToolTipText(tooltipText);
		}
	});
		
	if (doc != null)
		gallery.setItemCount(doc.getNPages());
	else{
		gallery.setItemCount(1);
	}
	
	//should bring some improvement during image loading
	gallery.setAntialias(SWT.OFF);
	gallery.setInterpolation(SWT.LOW);
	// END virtual table stuff

	this.pack();
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:73,代码来源:ThumbnailWidgetVirtualMinimal.java

示例3: createControls

import org.eclipse.nebula.widgets.gallery.NoGroupRenderer; //导入依赖的package包/类
/**
 * Create all the visible controls
 * 
 * @param parent the container of all the controls
 * @param imageWidth the width of images of the gallery
 * @param imageHeight the height of the images of the gallery
 * @param labelText the text on the description label
 */
protected void createControls(Composite parent, int imageWidth, int imageHeight, String labelText) {
	Composite firstLine = new Composite(parent, SWT.NONE);
	GridLayout firstLineLayout = new GridLayout(2,false);
	firstLineLayout.verticalSpacing = 0;
	firstLineLayout.marginHeight = 0;
	firstLine.setLayout(firstLineLayout);
	GridData firstLineData = new GridData();
	firstLineData.grabExcessHorizontalSpace=true;
	firstLineData.horizontalAlignment = SWT.FILL;
	firstLine.setLayoutData(firstLineData);
	
	Label dragLabel = new Label(firstLine, SWT.NONE);
	dragLabel.setText(labelText);
	GridData labelData = new GridData();
	labelData.grabExcessHorizontalSpace = true;
	labelData.horizontalAlignment = SWT.FILL;
	dragLabel.setLayoutData(labelData);
	
	checkedGallery = new Gallery(parent, SWT.VIRTUAL | SWT.V_SCROLL | SWT.BORDER);
	final NoGroupRenderer gr = new NoGroupRenderer();
	gr.setMinMargin(2);
	gr.setItemSize(imageWidth, imageHeight);
	gr.setAutoMargin(true);
	GridData gd = new GridData(GridData.FILL_BOTH);
	checkedGallery.setLayoutData(gd);
	checkedGallery.setGroupRenderer(gr);
	checkedGallery.enableItemsTooltip(false);
	RoundedGalleryItemRenderer ir = new RoundedGalleryItemRenderer();
	ir.setShowLabels(true);
	checkedGallery.setItemRenderer(ir);
	GridData galleryData = new GridData();
	galleryData.grabExcessHorizontalSpace = true;
	galleryData.grabExcessVerticalSpace = true;
	galleryData.horizontalAlignment = SWT.FILL;
	galleryData.verticalAlignment = SWT.FILL;
	checkedGallery.setLayoutData(galleryData);
	
    Menu popupMenu = new Menu(checkedGallery);
    checkedGallery.setMenu(popupMenu);
    checkedGallery.addMouseListener(new GalleryRightClick());
    
    initializeCreateAction();
    initializeEditAction();
    initializeDeleteAction();
	createToolBar(firstLine);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:55,代码来源:CommonViewProvider.java

示例4: createGroupRenderer

import org.eclipse.nebula.widgets.gallery.NoGroupRenderer; //导入依赖的package包/类
private AbstractGalleryGroupRenderer createGroupRenderer() {
	final NoGroupRenderer outRenderer = new NoGroupRenderer();
	outRenderer.setExpanded(false);
	outRenderer.setAutoMargin(true);
	return outRenderer;
}
 
开发者ID:aktion-hip,项目名称:relations,代码行数:7,代码来源:FinderPane.java


注:本文中的org.eclipse.nebula.widgets.gallery.NoGroupRenderer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。