public interface IRenderer
NOTE: THIS WIDGET AND ITS API ARE STILL UNDER DEVELOPMENT. THIS IS A PRE-RELEASE ALPHA VERSION. USERS SHOULD EXPECT API CHANGES IN FUTURE VERSIONS.
Renders a single visual unit. A IRenderer implementation can have state (i.e. is hovered or is selected) that affects the drawing.| Modifier and Type | Method and Description |
|---|---|
org.eclipse.swt.graphics.Point |
computeSize(org.eclipse.swt.graphics.GC gc,
int wHint,
int hHint,
java.lang.Object value)
Returns the size of the given value's visual representation.
|
void |
paint(org.eclipse.swt.graphics.GC gc,
java.lang.Object value)
Paints the visual representation of the given value on the given GC.
|
void |
setBounds(int x,
int y,
int width,
int height)
Sets the bounds of the drawing.
|
void |
setBounds(org.eclipse.swt.graphics.Rectangle bounds)
Sets the bounds of the drawing.
|
void |
setDisplay(org.eclipse.swt.widgets.Display display)
Sets the display.
|
void |
setExpanded(boolean expanded)
Sets the expanded state.
|
void |
setFocus(boolean focus)
Sets focus state.
|
void |
setHover(boolean hover)
Sets the hover state.
|
void |
setLocation(int x,
int y)
Sets the location of the drawing.
|
void |
setLocation(org.eclipse.swt.graphics.Point location)
Sets the location of the drawing.
|
void |
setMouseDown(boolean mouseDown)
Sets the hover state.
|
void |
setSelected(boolean selected)
Sets the selected state.
|
void |
setSize(int width,
int height)
Sets the area of the drawing.
|
void |
setSize(org.eclipse.swt.graphics.Point size)
Sets the area of the drawing.
|
void paint(org.eclipse.swt.graphics.GC gc,
java.lang.Object value)
Implementors need to respect the bounds values that may have been
specified. The bounds values may affect the x and y values for all
drawing operations as well as the width and heights. Implementors may use
a Transform to translate the coordinates of all the
drawing operations, otherwise they will need to offset each draw.
gc - GC to paint withvalue - the value being paintedorg.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.graphics.GC gc,
int wHint,
int hHint,
java.lang.Object value)
gc - convenience GC for string and text extentswHint - given width (or SWT.DEFAULT)hHint - given height (or SWT.DEFAULT)value - value to be sizedvoid setBounds(org.eclipse.swt.graphics.Rectangle bounds)
bounds - Bounds.void setBounds(int x,
int y,
int width,
int height)
x - X coordinate.y - Y coordinate.width - Width.height - Height.void setLocation(org.eclipse.swt.graphics.Point location)
location - Location.void setLocation(int x,
int y)
x - X.y - Y.void setFocus(boolean focus)
focus - focus state.void setHover(boolean hover)
hover - Hover state.void setMouseDown(boolean mouseDown)
mouseDown - Mouse state.void setSelected(boolean selected)
selected - Selection state.void setExpanded(boolean expanded)
expanded - Expansion state.void setSize(int width,
int height)
width - Width.height - Height.void setSize(org.eclipse.swt.graphics.Point size)
size - Size.void setDisplay(org.eclipse.swt.widgets.Display display)
display - Display.