public abstract class AbstractGridGroupRenderer extends AbstractGalleryGroupRenderer
Abstract class which provides low-level support for a grid-based group. renderer.
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT.
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoMargin |
(package private) static int |
DEFAULT_SIZE |
protected static java.lang.String |
EMPTY_STRING |
static java.lang.String |
H_COUNT |
protected int |
itemHeight |
protected int |
itemWidth |
protected int |
margin |
protected int |
minMargin |
static java.lang.String |
V_COUNT |
expanded, gallery
Constructor and Description |
---|
AbstractGridGroupRenderer() |
Modifier and Type | Method and Description |
---|---|
protected int |
calculateMargins(int size,
int count,
int itemSize) |
void |
dispose() |
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 void |
drawItem(org.eclipse.swt.graphics.GC gc,
int index,
boolean selected,
GalleryItem parent,
int offsetY)
Draw a child item.
|
GalleryItem |
getItem(GalleryItem group,
org.eclipse.swt.graphics.Point coords)
Returns the item at coords relative to the parent group.
|
protected GalleryItem |
getItem(GalleryItem group,
org.eclipse.swt.graphics.Point coords,
int offsetY)
Get item at pixel position
|
int |
getItemHeight() |
int |
getItemWidth() |
protected org.eclipse.swt.graphics.Point |
getLayoutData(GalleryItem item) |
int |
getMinMargin() |
GalleryItem |
getNextItem(GalleryItem item,
int key)
Returns the item that should be selected when the current item is 'item'
and the 'key' is pressed
|
org.eclipse.swt.graphics.Rectangle |
getSize(GalleryItem item)
Returns the size of a group.
|
protected org.eclipse.swt.graphics.Rectangle |
getSize(GalleryItem item,
int offsetY) |
protected org.eclipse.swt.graphics.Point |
getSize(int nbx,
int nby,
int itemSizeX,
int itemSizeY,
int minMargin,
int autoMargin) |
protected int[] |
getVisibleItems(GalleryItem group,
int x,
int y,
int clipX,
int clipY,
int clipWidth,
int clipHeight,
int offset) |
protected org.eclipse.swt.graphics.Point |
gridLayout(int size,
int nbItems,
int itemSize)
Calculate how many items are displayed horizontally and vertically.
|
boolean |
isAlwaysExpanded()
If true, groups are always expanded and toggle button is not displayed
|
boolean |
isAutoMargin() |
protected boolean |
isGroupExpanded(GalleryItem item)
Return item expand state (item.isExpanded()) Returns always true is
alwaysExpanded is set to true.
|
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) |
void |
preLayout(org.eclipse.swt.graphics.GC gc)
This method is called before the layout of the first item.
|
void |
setAlwaysExpanded(boolean alwaysExpanded)
If true, groups are always expanded and toggle button is not displayed if
false, expand status depends on each item.
|
void |
setAutoMargin(boolean autoMargin) |
void |
setItemHeight(int itemHeight) |
void |
setItemSize(int width,
int height) |
void |
setItemWidth(int itemWidth) |
void |
setMinMargin(int minMargin) |
getBackground, getFont, getForeground, getGallery, getGroupPosition, getGroupSize, getScrollBarIncrement, isDebugMode, isExpanded, mouseDown, notifyTreeListeners, postDraw, postLayout, preDraw, setExpanded, setGallery, setGroupSize, updateScrollBarsProperties, updateStructuralValues
static final int DEFAULT_SIZE
protected int minMargin
protected int margin
protected boolean autoMargin
protected int itemWidth
protected int itemHeight
public static final java.lang.String H_COUNT
public static final java.lang.String V_COUNT
protected static final java.lang.String EMPTY_STRING
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 AbstractGalleryGroupRenderer
public GalleryItem getItem(GalleryItem group, org.eclipse.swt.graphics.Point coords)
AbstractGalleryGroupRenderer
getItem
in class AbstractGalleryGroupRenderer
public org.eclipse.swt.graphics.Rectangle getSize(GalleryItem item)
AbstractGalleryGroupRenderer
getSize
in class AbstractGalleryGroupRenderer
public void layout(org.eclipse.swt.graphics.GC gc, GalleryItem group)
AbstractGalleryGroupRenderer
layout
in class AbstractGalleryGroupRenderer
public boolean isAlwaysExpanded()
protected boolean isGroupExpanded(GalleryItem item)
item
- public void setAlwaysExpanded(boolean alwaysExpanded)
alwaysExpanded
- public int getMinMargin()
public int getItemWidth()
public void setItemWidth(int itemWidth)
public int getItemHeight()
public void setItemHeight(int itemHeight)
public void setItemSize(int width, int height)
public void setMinMargin(int minMargin)
public boolean isAutoMargin()
public void setAutoMargin(boolean autoMargin)
protected int calculateMargins(int size, int count, int itemSize)
protected org.eclipse.swt.graphics.Point getSize(int nbx, int nby, int itemSizeX, int itemSizeY, int minMargin, int autoMargin)
protected void drawItem(org.eclipse.swt.graphics.GC gc, int index, boolean selected, GalleryItem parent, int offsetY)
gc
- index
- selected
- parent
- protected int[] getVisibleItems(GalleryItem group, int x, int y, int clipX, int clipY, int clipWidth, int clipHeight, int offset)
protected org.eclipse.swt.graphics.Point gridLayout(int size, int nbItems, int itemSize)
size
- nbItems
- itemSize
- public void dispose()
dispose
in class AbstractGalleryGroupRenderer
public boolean mouseDown(GalleryItem group, org.eclipse.swt.events.MouseEvent e, org.eclipse.swt.graphics.Point coords)
public void preLayout(org.eclipse.swt.graphics.GC gc)
AbstractGalleryGroupRenderer
preLayout
in class AbstractGalleryGroupRenderer
(org.eclipse.swt.graphics.GC)
protected org.eclipse.swt.graphics.Point getLayoutData(GalleryItem item)
protected org.eclipse.swt.graphics.Rectangle getSize(GalleryItem item, int offsetY)
protected GalleryItem getItem(GalleryItem group, org.eclipse.swt.graphics.Point coords, int offsetY)
coords
- public GalleryItem getNextItem(GalleryItem item, int key)
AbstractGalleryGroupRenderer
getNextItem
in class AbstractGalleryGroupRenderer