本文整理汇总了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));
}
}
示例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();
}
示例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);
}
示例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;
}