public abstract class AbstractGalleryGroupRenderer
extends java.lang.Object
Base class used to implement a custom gallery group renderer.
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT.
Modifier and Type | Field and Description |
---|---|
protected boolean |
expanded |
protected Gallery |
gallery |
Constructor and Description |
---|
AbstractGalleryGroupRenderer() |
Modifier and Type | Method and Description |
---|---|
abstract void |
dispose() |
abstract 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.
|
protected org.eclipse.swt.graphics.Color |
getBackground(GalleryItem item)
Returns item background color.
|
protected org.eclipse.swt.graphics.Font |
getFont(GalleryItem item)
Returns item font.
|
protected org.eclipse.swt.graphics.Color |
getForeground(GalleryItem item)
Returns item foreground color.
|
Gallery |
getGallery() |
protected org.eclipse.swt.graphics.Point |
getGroupPosition(GalleryItem item) |
protected org.eclipse.swt.graphics.Point |
getGroupSize(GalleryItem item) |
abstract GalleryItem |
getItem(GalleryItem group,
org.eclipse.swt.graphics.Point coords)
Returns the item at coords relative to the parent group.
|
abstract GalleryItem |
getNextItem(GalleryItem item,
int key)
Returns the item that should be selected when the current item is 'item'
and the 'key' is pressed
|
int |
getScrollBarIncrement()
Returns the preferred Scrollbar increment for the current gallery layout.
|
abstract org.eclipse.swt.graphics.Rectangle |
getSize(GalleryItem item)
Returns the size of a group.
|
protected boolean |
isDebugMode()
This method can be used as a condition to print trace or debug
informations in standard output.
|
boolean |
isExpanded()
Get the expand/collapse state of the current group
|
abstract 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.
|
abstract boolean |
mouseDown(GalleryItem group,
org.eclipse.swt.widgets.Event e,
org.eclipse.swt.graphics.Point coords)
This method can be implemented to handle mouse down events at the group
level.
|
protected void |
notifyTreeListeners(GalleryItem group)
Notifies the Gallery that the control expanded/collapsed state has
changed.
|
void |
postDraw(org.eclipse.swt.graphics.GC gc)
This method is called after drawing the last item.
|
void |
postLayout(org.eclipse.swt.graphics.GC gc)
This method is called after the layout of the last item.
|
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 |
setExpanded(boolean selected) |
void |
setGallery(Gallery gallery) |
protected void |
setGroupSize(GalleryItem item,
org.eclipse.swt.graphics.Point size) |
protected void |
updateScrollBarsProperties() |
protected void |
updateStructuralValues(boolean keeplocation)
Forces an update of the gallery layout.
|
protected Gallery gallery
protected boolean expanded
public boolean isExpanded()
public void setExpanded(boolean selected)
selected
- isExpanded()
public void preDraw(org.eclipse.swt.graphics.GC gc)
gc
- public void postDraw(org.eclipse.swt.graphics.GC gc)
gc
- public abstract void draw(org.eclipse.swt.graphics.GC gc, GalleryItem group, int x, int y, int clipX, int clipY, int clipWidth, int clipHeight)
gc
- group
- x
- y
- public abstract void dispose()
public abstract GalleryItem getNextItem(GalleryItem item, int key)
item
- key
- public void preLayout(org.eclipse.swt.graphics.GC gc)
gc
- public void postLayout(org.eclipse.swt.graphics.GC gc)
gc
- public abstract void layout(org.eclipse.swt.graphics.GC gc, GalleryItem group)
gc
- group
- public abstract GalleryItem getItem(GalleryItem group, org.eclipse.swt.graphics.Point coords)
group
- coords
- public abstract org.eclipse.swt.graphics.Rectangle getSize(GalleryItem item)
item
- public abstract boolean mouseDown(GalleryItem group, org.eclipse.swt.widgets.Event e, org.eclipse.swt.graphics.Point coords)
group
- The group on which the mouse click occurede
- The original mouse eventcoords
- The pointer coordinates relative to the grouppublic Gallery getGallery()
public void setGallery(Gallery gallery)
protected org.eclipse.swt.graphics.Point getGroupSize(GalleryItem item)
protected org.eclipse.swt.graphics.Point getGroupPosition(GalleryItem item)
protected void setGroupSize(GalleryItem item, org.eclipse.swt.graphics.Point size)
protected boolean isDebugMode()
protected void notifyTreeListeners(GalleryItem group)
group
- protected void updateStructuralValues(boolean keeplocation)
keeplocation
- if true, the gallery will try to keep the current visible
items in the client area after the new layout has been
calculated.protected void updateScrollBarsProperties()
public int getScrollBarIncrement()
protected org.eclipse.swt.graphics.Color getBackground(GalleryItem item)
GalleryItem.getBackground()
and should be overridden by any group
renderer which use additional colors.
Note that item renderer is automatically used for items.item
- a GalleryItemprotected org.eclipse.swt.graphics.Color getForeground(GalleryItem item)
GalleryItem.getForeground()
and should be overridden by any group
renderer which use additional colors.
Note that item renderer is automatically used for items.item
- a GalleryItemprotected org.eclipse.swt.graphics.Font getFont(GalleryItem item)
GalleryItem.getFont()
and should be overridden by any group renderer which use additional
fonts.
Note that item renderer is automatically used for items.item
- a GalleryItem