public class DefaultGalleryGroupRenderer extends AbstractGridGroupRenderer
Default group renderer used by the Gallery widget. Supports multi-line text, images, animation and several other features.
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT.
H_COUNT, V_COUNT
Constructor | Description |
---|---|
DefaultGalleryGroupRenderer() |
This group renderer draws a title line, then items in a grid layout.
|
Modifier and Type | Method | Description |
---|---|---|
void |
draw(org.eclipse.swt.graphics.GC gc,
GalleryItem group,
int x,
int y,
int clipX,
int clipY,
int clipWidth,
int clipHeight) |
Group size informations can be retrieved from group.
|
IMovement |
getAnimationCloseMovement() |
|
int |
getAnimationLength() |
|
IMovement |
getAnimationOpenMovement() |
Get the current movement used for animation
|
org.eclipse.swt.graphics.Font |
getFont() |
Returns the font used for drawing the group title or null if
system font is used.
|
GalleryItem |
getItem(GalleryItem group,
org.eclipse.swt.graphics.Point coords) |
Returns the item at coords relative to the parent group.
|
int |
getMaxImageHeight() |
|
int |
getMaxImageWidth() |
|
int |
getScrollBarIncrement() |
Returns the preferred Scrollbar increment for the current gallery layout.
|
org.eclipse.swt.graphics.Rectangle |
getSize(GalleryItem item) |
Returns the size of a group.
|
org.eclipse.swt.graphics.Color |
getTitleBackground() |
|
org.eclipse.swt.graphics.Color |
getTitleBackground2() |
|
org.eclipse.swt.graphics.Color |
getTitleForeground() |
Get group title text color.
|
boolean |
isAnimation() |
|
boolean |
isFillIfSingleColumn() |
|
boolean |
isTitleBackgroundGradient() |
|
void |
layout(org.eclipse.swt.graphics.GC gc,
GalleryItem group) |
This method is called on each root item when the Gallery changes (resize,
item addition or removal) in order to update the gallery size.
|
boolean |
mouseDown(GalleryItem group,
org.eclipse.swt.events.MouseEvent e,
org.eclipse.swt.graphics.Point coords) |
This method can be implemented to handle mouse down events at the group
level.
|
void |
preDraw(org.eclipse.swt.graphics.GC gc) |
This method is called before drawing the first item.
|
void |
preLayout(org.eclipse.swt.graphics.GC gc) |
This method is called before the layout of the first item.
|
void |
setAnimation(boolean animation) |
Enable animation for group expand/collapse.
|
void |
setAnimationCloseMovement(IMovement animationMovement) |
Set the movement used for close animation.
|
void |
setAnimationLength(int animationLength) |
Set the length of the animation
|
void |
setAnimationOpenMovement(IMovement animationMovement) |
Set the movement used for open animation.
|
void |
setFillIfSingleColumn(boolean fillIfSingle) |
Experimental feature.
|
void |
setFont(org.eclipse.swt.graphics.Font font) |
Set the font for drawing the group title or null to use system
font.
|
void |
setGallery(Gallery gallery) |
|
void |
setMaxImageHeight(int imageHeight) |
Set the maximum height for a group image in the title bar.
|
void |
setMaxImageWidth(int imageWidth) |
Set the maximum width for a group image in the title bar.
|
void |
setTitleBackground(org.eclipse.swt.graphics.Color titleBackground) |
|
void |
setTitleBackgroundGradient(org.eclipse.swt.graphics.Color gradientBackground,
org.eclipse.swt.graphics.Color gradientForeground) |
|
void |
setTitleForeground(org.eclipse.swt.graphics.Color titleColor) |
Change group title text color.
|
getGallery, isExpanded, postDraw, postLayout, setExpanded
dispose, getItemHeight, getItemWidth, getMinMargin, getNextItem, isAlwaysExpanded, isAutoMargin, setAlwaysExpanded, setAutoMargin, setItemHeight, setItemSize, setItemWidth, setMinMargin
public DefaultGalleryGroupRenderer()
public void setGallery(Gallery gallery)
setGallery
in class AbstractGalleryGroupRenderer
public void draw(org.eclipse.swt.graphics.GC gc, GalleryItem group, int x, int y, int clipX, int clipY, int clipWidth, int clipHeight)
AbstractGalleryGroupRenderer
draw
in class AbstractGridGroupRenderer
public void layout(org.eclipse.swt.graphics.GC gc, GalleryItem group)
AbstractGalleryGroupRenderer
layout
in class AbstractGridGroupRenderer
public void preDraw(org.eclipse.swt.graphics.GC gc)
AbstractGalleryGroupRenderer
preDraw
in class AbstractGalleryGroupRenderer
public void preLayout(org.eclipse.swt.graphics.GC gc)
AbstractGalleryGroupRenderer
preLayout
in class AbstractGridGroupRenderer
public GalleryItem getItem(GalleryItem group, org.eclipse.swt.graphics.Point coords)
AbstractGalleryGroupRenderer
getItem
in class AbstractGridGroupRenderer
public boolean mouseDown(GalleryItem group, org.eclipse.swt.events.MouseEvent e, org.eclipse.swt.graphics.Point coords)
AbstractGalleryGroupRenderer
mouseDown
in class AbstractGridGroupRenderer
group
- The group on which the mouse click occurede
- The original mouse eventcoords
- The pointer coordinates relative to the grouppublic org.eclipse.swt.graphics.Rectangle getSize(GalleryItem item)
AbstractGalleryGroupRenderer
getSize
in class AbstractGridGroupRenderer
public org.eclipse.swt.graphics.Color getTitleForeground()
public void setTitleForeground(org.eclipse.swt.graphics.Color titleColor)
titleColor
- Color or null to revert to default.public org.eclipse.swt.graphics.Color getTitleBackground()
public void setTitleBackground(org.eclipse.swt.graphics.Color titleBackground)
public void setTitleBackgroundGradient(org.eclipse.swt.graphics.Color gradientBackground, org.eclipse.swt.graphics.Color gradientForeground)
public org.eclipse.swt.graphics.Font getFont()
public void setFont(org.eclipse.swt.graphics.Font font)
font
- the font to setpublic int getScrollBarIncrement()
AbstractGalleryGroupRenderer
getScrollBarIncrement
in class AbstractGalleryGroupRenderer
public boolean isFillIfSingleColumn()
setFillIfSingleColumn(boolean)
public void setFillIfSingleColumn(boolean fillIfSingle)
Experimental feature.
If set to true, this will enable a special behavior when the items are so large that only one can fit in the client area. In this case, items are always resized and centered to fit best in the client area.
See bug 266613 : https://bugs.eclipse.org/266613
fillIfSingle
- public int getMaxImageWidth()
setMaxImageWidth(int)
public void setMaxImageWidth(int imageWidth)
imageWidth
- GalleryItem.setImage(Image)
public int getMaxImageHeight()
setMaxImageHeight(int)
public void setMaxImageHeight(int imageHeight)
imageHeight
- GalleryItem.setImage(Image)
public boolean isAnimation()
setAnimation(boolean)
public void setAnimation(boolean animation)
animation
- setAnimationLength(int)
,
setAnimationOpenMovement(IMovement)
public int getAnimationLength()
setAnimationLength(int)
public void setAnimationLength(int animationLength)
animationLength
- setAnimation(boolean)
,
setAnimationOpenMovement(IMovement)
public IMovement getAnimationOpenMovement()
setAnimationOpenMovement(IMovement)
public IMovement getAnimationCloseMovement()
setAnimationCloseMovement(IMovement)
public void setAnimationOpenMovement(IMovement animationMovement)
animationMovement
- setAnimation(boolean)
,
setAnimationLength(int)
public void setAnimationCloseMovement(IMovement animationMovement)
animationMovement
- setAnimation(boolean)
,
setAnimationLength(int)
public boolean isTitleBackgroundGradient()
public org.eclipse.swt.graphics.Color getTitleBackground2()