Class ListItemRenderer
- java.lang.Object
-
- org.eclipse.nebula.widgets.gallery.AbstractGalleryItemRenderer
-
- org.eclipse.nebula.widgets.gallery.ListItemRenderer
-
public class ListItemRenderer extends AbstractGalleryItemRenderer
Alternate item renderer for the Gallery widget using a list style. Supports multi-line text, image, drop shadows and decorators.
Best with bigger width than height.
Decorator images can be set with
Widget.setData(String, Object)by using the following keys :- org.eclipse.nebula.widget.gallery.bottomLeftOverlay
- org.eclipse.nebula.widget.gallery.bottomRightOverlay
- org.eclipse.nebula.widget.gallery.topLeftOverlay
- org.eclipse.nebula.widget.gallery.topRightOverlay
Supported types are org.eclipse.swt.Image for one single decorator and org.eclipse.swt.Image[] for multiple decorators.
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.eclipse.swt.graphics.ColorbackgroundColor(package private) org.eclipse.swt.graphics.ColordescriptionColor(package private) org.eclipse.swt.graphics.FontdescriptionFont(package private) booleandropShadows(package private) intdropShadowsAlphaStepprotected java.util.ArrayList<org.eclipse.swt.graphics.Color>dropShadowsColors(package private) intdropShadowsSize(package private) org.eclipse.swt.graphics.ColorforegroundColor(package private) org.eclipse.swt.graphics.ColorselectionBackgroundColor(package private) org.eclipse.swt.graphics.ColorselectionForegroundColor(package private) intselectionRadius(package private) booleanshowLabels(package private) booleanshowRoundedSelectionCorners(package private) org.eclipse.swt.graphics.FonttextFont-
Fields inherited from class org.eclipse.nebula.widgets.gallery.AbstractGalleryItemRenderer
EMPTY_STRING, gallery, galleryBackgroundColor, galleryForegroundColor, OVERLAY_BOTTOM_LEFT, OVERLAY_BOTTOM_RIGHT, OVERLAY_TOP_LEFT, OVERLAY_TOP_RIGHT, selected
-
-
Constructor Summary
Constructors Constructor Description ListItemRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidcreateColors()voiddispose()voiddraw(org.eclipse.swt.graphics.GC gc, GalleryItem item, int index, int x, int y, int width, int height)Draws an item.private voidfreeDropShadowsColors()org.eclipse.swt.graphics.ColorgetBackgroundColor()org.eclipse.swt.graphics.ColorgetDescriptionColor()org.eclipse.swt.graphics.FontgetDescriptionFont()Returns the font used for drawing item description or null if system font is used.intgetDropShadowsSize()org.eclipse.swt.graphics.ColorgetForegroundColor()org.eclipse.swt.graphics.ColorgetSelectionBackgroundColor()org.eclipse.swt.graphics.ColorgetSelectionForegroundColor()org.eclipse.swt.graphics.FontgetTextFont()Deprecated.UseCanvas.setFont(Font)orGalleryItem.setFont(Font)instead.booleanisDropShadows()booleanisShowLabels()booleanisShowRoundedSelectionCorners()voidpreDraw(org.eclipse.swt.graphics.GC gc)This method is called before drawing the first item.voidsetBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)voidsetDescriptionColor(org.eclipse.swt.graphics.Color descriptionColor)voidsetDescriptionFont(org.eclipse.swt.graphics.Font descriptionFont)Set the font for drawing item description or null to use system font.voidsetDropShadows(boolean dropShadows)voidsetDropShadowsSize(int dropShadowsSize)voidsetForegroundColor(org.eclipse.swt.graphics.Color foregroundColor)voidsetSelectionBackgroundColor(org.eclipse.swt.graphics.Color selectionColor)voidsetSelectionForegroundColor(org.eclipse.swt.graphics.Color selectionForegroundColor)voidsetShowLabels(boolean showLabels)voidsetShowRoundedSelectionCorners(boolean showRoundedSelectionCorners)voidsetTextFont(org.eclipse.swt.graphics.Font textFont)Deprecated.UseCanvas.setFont(Font)orGalleryItem.setFont(Font)instead.-
Methods inherited from class org.eclipse.nebula.widgets.gallery.AbstractGalleryItemRenderer
drawAllOverlays, drawOverlayImages, getBackground, getFont, getForeground, getGallery, getImageOverlay, getOverlayRatio, getOverlaySize, isSelected, postDraw, setGallery, setSelected
-
-
-
-
Field Detail
-
dropShadowsColors
protected java.util.ArrayList<org.eclipse.swt.graphics.Color> dropShadowsColors
-
dropShadows
boolean dropShadows
-
dropShadowsSize
int dropShadowsSize
-
dropShadowsAlphaStep
int dropShadowsAlphaStep
-
selectionBackgroundColor
org.eclipse.swt.graphics.Color selectionBackgroundColor
-
selectionForegroundColor
org.eclipse.swt.graphics.Color selectionForegroundColor
-
foregroundColor
org.eclipse.swt.graphics.Color foregroundColor
-
backgroundColor
org.eclipse.swt.graphics.Color backgroundColor
-
descriptionColor
org.eclipse.swt.graphics.Color descriptionColor
-
textFont
org.eclipse.swt.graphics.Font textFont
-
descriptionFont
org.eclipse.swt.graphics.Font descriptionFont
-
showLabels
boolean showLabels
-
showRoundedSelectionCorners
boolean showRoundedSelectionCorners
-
selectionRadius
int selectionRadius
-
-
Method Detail
-
isShowLabels
public boolean isShowLabels()
-
setShowLabels
public void setShowLabels(boolean showLabels)
-
preDraw
public void preDraw(org.eclipse.swt.graphics.GC gc)
Description copied from class:AbstractGalleryItemRendererThis method is called before drawing the first item. It may be used to calculate some values (like font metrics) that will be used for each item.- Overrides:
preDrawin classAbstractGalleryItemRenderer- See Also:
(org.eclipse.swt.graphics.GC)
-
draw
public void draw(org.eclipse.swt.graphics.GC gc, GalleryItem item, int index, int x, int y, int width, int height)Description copied from class:AbstractGalleryItemRendererDraws an item.
-
setDropShadowsSize
public void setDropShadowsSize(int dropShadowsSize)
-
createColors
private void createColors()
-
freeDropShadowsColors
private void freeDropShadowsColors()
-
isDropShadows
public boolean isDropShadows()
-
setDropShadows
public void setDropShadows(boolean dropShadows)
-
getDropShadowsSize
public int getDropShadowsSize()
-
dispose
public void dispose()
- Specified by:
disposein classAbstractGalleryItemRenderer- See Also:
AbstractGalleryItemRenderer.dispose()
-
getSelectionBackgroundColor
public org.eclipse.swt.graphics.Color getSelectionBackgroundColor()
-
setSelectionBackgroundColor
public void setSelectionBackgroundColor(org.eclipse.swt.graphics.Color selectionColor)
-
getForegroundColor
public org.eclipse.swt.graphics.Color getForegroundColor()
-
setForegroundColor
public void setForegroundColor(org.eclipse.swt.graphics.Color foregroundColor)
-
getBackgroundColor
public org.eclipse.swt.graphics.Color getBackgroundColor()
-
setBackgroundColor
public void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
-
getDescriptionColor
public org.eclipse.swt.graphics.Color getDescriptionColor()
-
setDescriptionColor
public void setDescriptionColor(org.eclipse.swt.graphics.Color descriptionColor)
-
getSelectionForegroundColor
public org.eclipse.swt.graphics.Color getSelectionForegroundColor()
-
setSelectionForegroundColor
public void setSelectionForegroundColor(org.eclipse.swt.graphics.Color selectionForegroundColor)
-
getTextFont
public org.eclipse.swt.graphics.Font getTextFont()
Deprecated.UseCanvas.setFont(Font)orGalleryItem.setFont(Font)instead.Returns the font used for drawing item label or null if system font is used.- Returns:
- the font
-
setTextFont
public void setTextFont(org.eclipse.swt.graphics.Font textFont)
Deprecated.UseCanvas.setFont(Font)orGalleryItem.setFont(Font)instead.Set the font for drawing item label or null to use system font.- Parameters:
font- the font to set
-
getDescriptionFont
public org.eclipse.swt.graphics.Font getDescriptionFont()
Returns the font used for drawing item description or null if system font is used.- Returns:
- the font
-
setDescriptionFont
public void setDescriptionFont(org.eclipse.swt.graphics.Font descriptionFont)
Set the font for drawing item description or null to use system font.- Parameters:
font- the font to set
-
isShowRoundedSelectionCorners
public boolean isShowRoundedSelectionCorners()
-
setShowRoundedSelectionCorners
public void setShowRoundedSelectionCorners(boolean showRoundedSelectionCorners)
-
-