public class BranchRenderer extends AbstractRenderer
GridColumn
Modifier and Type | Field and Description |
---|---|
static int |
ASCENDER
A vertical bar from the top to the toggle
|
static int |
DESCENDER
A vertical bar from the toggle to the bottom
|
static int |
H_CENTRE_TOGGLE
A horizontal bar from the centre to the toggle
|
static int |
H_FULL
A full-width horizontal bar
|
static int |
H_LEFT_TOGGLE
A horizontal bar from the left to the toggle
|
static int |
H_RIGHT
A horizontal bar from the centre to the right
|
static int |
I
Indicates that a branch should be rendered as a 'I' shape.
|
static int |
L
Indicates that a branch should be rendered as an 'L' shape.
|
static int |
LAST_ROOT
Indicates that the decoration for the last root node should be drawn
|
static int |
LEAF
Indicates that the decoration for a leaf node should be drawn
|
static int |
NODE
Indicates that the toggle decoration for an expanded parent should be drawn
|
static int |
NONE
Indicates that a branch should not be rendered.
|
static int |
ROOT
Indicates that the decoration for a root node should be drawn
|
static int |
SMALL_L
A half-width L used on roots with no children
|
static int |
SMALL_T
A half-width T used on roots with no children
|
static int |
T
Indicates that a branch should be rendered as a 'T' shape.
|
static int |
V_FULL
A full-height vertical bar
|
static int |
V_TOP
A vertical bar from the top to the middle
|
Constructor and Description |
---|
BranchRenderer() |
Modifier and Type | Method and Description |
---|---|
org.eclipse.swt.graphics.Point |
computeSize(org.eclipse.swt.graphics.GC gc,
int hint,
int hint2,
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 |
setBranches(int[] branches)
Sets the branches that will be used.
|
void |
setIndent(int toggleIndent)
Sets the indent used for rendering the tree branches
|
void |
setToggleBounds(org.eclipse.swt.graphics.Rectangle toggleBounds)
Sets bounds of the toggle control.
|
getBounds, getDisplay, getSize, isExpanded, isFocus, isHover, isMouseDown, isSelected, setBounds, setBounds, setDisplay, setExpanded, setFocus, setHover, setLocation, setLocation, setMouseDown, setSelected, setSize, setSize
public static final int H_FULL
public static final int H_RIGHT
public static final int H_CENTRE_TOGGLE
public static final int H_LEFT_TOGGLE
public static final int V_FULL
public static final int V_TOP
public static final int DESCENDER
public static final int ASCENDER
public static final int NONE
public static final int T
public static final int L
public static final int I
public static final int NODE
public static final int LEAF
public static final int ROOT
public static final int LAST_ROOT
public static final int SMALL_T
public static final int SMALL_L
public org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.graphics.GC gc, int hint, int hint2, java.lang.Object value)
gc
- convenience GC for string and text extentshint
- given width (or SWT.DEFAULT)hint2
- given height (or SWT.DEFAULT)value
- value to be sizedpublic 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 paintedpublic void setBranches(int[] branches)
branches
- an array of branch typespublic void setIndent(int toggleIndent)
toggleIndent
- the indent used for the treepublic void setToggleBounds(org.eclipse.swt.graphics.Rectangle toggleBounds)
toggleBounds
- the bounds of the toggle control