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.
OVERLAY_BOTTOM_LEFT, OVERLAY_BOTTOM_RIGHT, OVERLAY_TOP_LEFT, OVERLAY_TOP_RIGHT| Constructor | Description |
|---|---|
DefaultGalleryItemRenderer() |
| Modifier and Type | Method | 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) |
getGallery, isSelected, postDraw, preDraw, setGallery, setSelectedpublic 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)
AbstractGalleryItemRendererdraw in class AbstractGalleryItemRendererpublic void setDropShadowsSize(int dropShadowsSize)
public boolean isDropShadows()
public void setDropShadows(boolean dropShadows)
public int getDropShadowsSize()
public org.eclipse.swt.graphics.Font getFont()
public void setFont(org.eclipse.swt.graphics.Font font)
font - the font to setpublic void dispose()
dispose in class AbstractGalleryItemRendererpublic 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)