public class DefaultGalleryItemRenderer extends AbstractGalleryItemRenderer
Default item renderer used by the Gallery widget. Supports single line text, image, drop shadows and decorators.
Decorator images can be set with Widget.setData(String, Object)
by using the following keys :
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.
Modifier and Type | Field and Description |
---|---|
(package private) org.eclipse.swt.graphics.Color |
backgroundColor |
(package private) boolean |
dropShadows |
(package private) int |
dropShadowsAlphaStep |
protected java.util.ArrayList<org.eclipse.swt.graphics.Color> |
dropShadowsColors
Stores colors used in drop shadows
|
(package private) int |
dropShadowsSize |
(package private) org.eclipse.swt.graphics.Color |
foregroundColor |
(package private) org.eclipse.swt.graphics.Color |
selectionBackgroundColor |
(package private) org.eclipse.swt.graphics.Color |
selectionForegroundColor |
(package private) int |
selectionRadius |
(package private) boolean |
showLabels |
(package private) boolean |
showRoundedSelectionCorners |
EMPTY_STRING, gallery, galleryBackgroundColor, galleryForegroundColor, OVERLAY_BOTTOM_LEFT, OVERLAY_BOTTOM_RIGHT, OVERLAY_TOP_LEFT, OVERLAY_TOP_RIGHT, selected
Constructor and Description |
---|
DefaultGalleryItemRenderer() |
Modifier and Type | Method and Description |
---|---|
void |
dispose() |
void |
draw(org.eclipse.swt.graphics.GC gc,
GalleryItem item,
int index,
int x,
int y,
int width,
int height)
Draws an item.
|
org.eclipse.swt.graphics.Color |
getBackgroundColor() |
int |
getDropShadowsSize() |
org.eclipse.swt.graphics.Font |
getFont()
Returns the font used for drawing all item labels or null if
system font is used.
|
org.eclipse.swt.graphics.Color |
getForegroundColor() |
org.eclipse.swt.graphics.Color |
getSelectionBackgroundColor() |
org.eclipse.swt.graphics.Color |
getSelectionForegroundColor() |
boolean |
isDropShadows() |
boolean |
isShowLabels()
Returns current label state : enabled or disabled
|
boolean |
isShowRoundedSelectionCorners() |
void |
setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor) |
void |
setDropShadows(boolean dropShadows) |
void |
setDropShadowsSize(int dropShadowsSize) |
void |
setFont(org.eclipse.swt.graphics.Font font)
Set the font for drawing all item labels or null to use system
font.
|
void |
setForegroundColor(org.eclipse.swt.graphics.Color foregroundColor) |
void |
setSelectionBackgroundColor(org.eclipse.swt.graphics.Color selectionBackgroundColor) |
void |
setSelectionForegroundColor(org.eclipse.swt.graphics.Color selectionForegroundColor) |
void |
setShowLabels(boolean showLabels)
Enables / disables labels at the bottom of each item.
|
void |
setShowRoundedSelectionCorners(boolean showRoundedSelectionCorners) |
drawAllOverlays, drawOverlayImages, getBackground, getFont, getForeground, getGallery, getImageOverlay, getOverlayRatio, getOverlaySize, isSelected, postDraw, preDraw, setGallery, setSelected
protected java.util.ArrayList<org.eclipse.swt.graphics.Color> dropShadowsColors
boolean dropShadows
int dropShadowsSize
int dropShadowsAlphaStep
org.eclipse.swt.graphics.Color selectionForegroundColor
org.eclipse.swt.graphics.Color selectionBackgroundColor
org.eclipse.swt.graphics.Color foregroundColor
org.eclipse.swt.graphics.Color backgroundColor
boolean showLabels
boolean showRoundedSelectionCorners
int selectionRadius
public boolean isShowLabels()
setShowLabels(boolean)
public void setShowLabels(boolean showLabels)
showLabels
- isShowLabels()
public void draw(org.eclipse.swt.graphics.GC gc, GalleryItem item, int index, int x, int y, int width, int height)
AbstractGalleryItemRenderer
draw
in class AbstractGalleryItemRenderer
org.eclipse.nebula.widgets.gallery.AbstractGalleryItemRenderer#draw(org
.eclipse.swt.graphics.GC,
org.eclipse.nebula.widgets.gallery.GalleryItem, int, int, int, int,
int)
public void setDropShadowsSize(int dropShadowsSize)
public boolean isDropShadows()
public void setDropShadows(boolean dropShadows)
public int getDropShadowsSize()
public org.eclipse.swt.graphics.Font getFont()
Gallery#getFont()} for setting font for a specific
GalleryItem.
public void setFont(org.eclipse.swt.graphics.Font font)
font
- the font to setGallery#setFont(Font)} for setting font for a specific
GalleryItem.
public void dispose()
dispose
in class AbstractGalleryItemRenderer
public org.eclipse.swt.graphics.Color getForegroundColor()
public void setForegroundColor(org.eclipse.swt.graphics.Color foregroundColor)
public org.eclipse.swt.graphics.Color getSelectionForegroundColor()
public void setSelectionForegroundColor(org.eclipse.swt.graphics.Color selectionForegroundColor)
public org.eclipse.swt.graphics.Color getSelectionBackgroundColor()
public void setSelectionBackgroundColor(org.eclipse.swt.graphics.Color selectionBackgroundColor)
public org.eclipse.swt.graphics.Color getBackgroundColor()
public void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
public boolean isShowRoundedSelectionCorners()
public void setShowRoundedSelectionCorners(boolean showRoundedSelectionCorners)