public class CTabFolderRenderer
extends java.lang.Object
CTabFolder
. This class can be subclassed in order to
customize the look of a CTabFolder.Modifier and Type | Field and Description |
---|---|
(package private) static int |
BORDER1_COLOR |
(package private) static int[] |
BOTTOM_LEFT_CORNER |
(package private) static int[] |
BOTTOM_LEFT_CORNER_BORDERLESS |
(package private) static int[] |
BOTTOM_RIGHT_CORNER |
(package private) static int[] |
BOTTOM_RIGHT_CORNER_BORDERLESS |
(package private) static int |
BUTTON_BORDER |
(package private) static int |
BUTTON_FILL |
(package private) static int |
BUTTON_SIZE |
(package private) static int |
BUTTON_TRIM |
(package private) static RGB |
CLOSE_FILL |
(package private) int[] |
curve |
(package private) int |
curveIndent |
(package private) int |
curveWidth |
(package private) static java.lang.String |
ELLIPSIS |
(package private) Color |
fillColor |
(package private) static int |
FLAGS |
(package private) static int |
INTERNAL_SPACING |
(package private) static int |
ITEM_BOTTOM_MARGIN |
(package private) static int |
ITEM_LEFT_MARGIN |
(package private) static int |
ITEM_RIGHT_MARGIN |
(package private) static int |
ITEM_TOP_MARGIN |
(package private) Color |
lastBorderColor |
(package private) int |
lastTabHeight |
static int |
MINIMUM_SIZE |
protected CTabFolder |
parent |
static int |
PART_BACKGROUND |
static int |
PART_BODY |
static int |
PART_BORDER |
static int |
PART_CHEVRON_BUTTON |
static int |
PART_CLOSE_BUTTON |
static int |
PART_HEADER |
static int |
PART_MAX_BUTTON |
static int |
PART_MIN_BUTTON |
(package private) Color |
selectedInnerColor |
(package private) Color |
selectedOuterColor |
(package private) Color |
selectionHighlightGradientBegin |
(package private) Color[] |
selectionHighlightGradientColorsCache |
(package private) static int[] |
SIMPLE_BOTTOM_LEFT_CORNER |
(package private) static int[] |
SIMPLE_BOTTOM_LEFT_CORNER_BORDERLESS |
(package private) static int[] |
SIMPLE_BOTTOM_RIGHT_CORNER |
(package private) static int[] |
SIMPLE_BOTTOM_RIGHT_CORNER_BORDERLESS |
(package private) static int[] |
SIMPLE_TOP_LEFT_CORNER |
(package private) static int[] |
SIMPLE_TOP_LEFT_CORNER_BORDERLESS |
(package private) static int[] |
SIMPLE_TOP_RIGHT_CORNER |
(package private) static int[] |
SIMPLE_TOP_RIGHT_CORNER_BORDERLESS |
(package private) static int[] |
SIMPLE_UNSELECTED_INNER_CORNER |
(package private) Color |
tabAreaColor |
(package private) static int[] |
TOP_LEFT_CORNER |
(package private) static int[] |
TOP_LEFT_CORNER_BORDERLESS |
(package private) static int[] |
TOP_LEFT_CORNER_HILITE |
(package private) static int[] |
TOP_RIGHT_CORNER |
(package private) static int[] |
TOP_RIGHT_CORNER_BORDERLESS |
(package private) int[] |
topCurveHighlightEnd |
(package private) int[] |
topCurveHighlightStart |
Modifier | Constructor and Description |
---|---|
protected |
CTabFolderRenderer(CTabFolder parent)
Constructs a new instance of this class given its parent.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
antialias(int[] shape,
Color innerColor,
Color outerColor,
GC gc) |
protected Point |
computeSize(int part,
int state,
GC gc,
int wHint,
int hHint)
Returns the preferred size of a part.
|
protected Rectangle |
computeTrim(int part,
int state,
int x,
int y,
int width,
int height)
Given a desired client area for the part
(as described by the arguments), returns the bounding
rectangle which would be required to produce that client
area.
|
(package private) void |
createAntialiasColors() |
(package private) void |
createSelectionHighlightGradientColors(Color start) |
protected void |
dispose()
Dispose of any operating system resources associated with
the renderer.
|
(package private) void |
disposeAntialiasColors() |
(package private) void |
disposeSelectionHighlightGradientColors() |
protected void |
draw(int part,
int state,
Rectangle bounds,
GC gc)
Draw a specified
part of the CTabFolder using the provided bounds and GC . |
(package private) void |
drawBackground(GC gc,
int[] shape,
boolean selected) |
(package private) void |
drawBackground(GC gc,
int[] shape,
int x,
int y,
int width,
int height,
Color defaultBackground,
Image image,
Color[] colors,
int[] percents,
boolean vertical) |
(package private) void |
drawBackground(GC gc,
Rectangle bounds,
int state) |
(package private) void |
drawBody(GC gc,
Rectangle bounds,
int state) |
(package private) void |
drawBorder(GC gc,
int[] shape) |
(package private) void |
drawChevron(GC gc,
Rectangle chevronRect,
int chevronImageState) |
(package private) void |
drawClose(GC gc,
Rectangle closeRect,
int closeImageState) |
(package private) void |
drawHighlight(GC gc,
Rectangle bounds,
int state,
int rightEdge) |
(package private) void |
drawLeftUnselectedBorder(GC gc,
Rectangle bounds,
int state) |
(package private) void |
drawMaximize(GC gc,
Rectangle maxRect,
int maxImageState) |
(package private) void |
drawMinimize(GC gc,
Rectangle minRect,
int minImageState) |
(package private) void |
drawRightUnselectedBorder(GC gc,
Rectangle bounds,
int state) |
(package private) void |
drawSelected(int itemIndex,
GC gc,
Rectangle bounds,
int state) |
(package private) void |
drawTabArea(GC gc,
Rectangle bounds,
int state) |
(package private) void |
drawUnselected(int index,
GC gc,
Rectangle bounds,
int state) |
(package private) void |
fillRegion(GC gc,
Region region) |
(package private) Color |
getFillColor() |
(package private) boolean |
isSelectionHighlightColorsCacheHit(Color start) |
(package private) void |
setSelectionHighlightGradientColor(Color start) |
(package private) java.lang.String |
shortenText(GC gc,
java.lang.String text,
int width) |
(package private) java.lang.String |
shortenText(GC gc,
java.lang.String text,
int width,
java.lang.String ellipses) |
(package private) void |
updateCurves() |
(package private) boolean |
useEllipses() |
protected CTabFolder parent
int[] curve
int[] topCurveHighlightStart
int[] topCurveHighlightEnd
int curveWidth
int curveIndent
int lastTabHeight
Color fillColor
Color selectionHighlightGradientBegin
Color[] selectionHighlightGradientColorsCache
Color selectedOuterColor
Color selectedInnerColor
Color tabAreaColor
Color lastBorderColor
static final int[] TOP_LEFT_CORNER_HILITE
static final int[] TOP_LEFT_CORNER
static final int[] TOP_RIGHT_CORNER
static final int[] BOTTOM_LEFT_CORNER
static final int[] BOTTOM_RIGHT_CORNER
static final int[] SIMPLE_TOP_LEFT_CORNER
static final int[] SIMPLE_TOP_RIGHT_CORNER
static final int[] SIMPLE_BOTTOM_LEFT_CORNER
static final int[] SIMPLE_BOTTOM_RIGHT_CORNER
static final int[] SIMPLE_UNSELECTED_INNER_CORNER
static final int[] TOP_LEFT_CORNER_BORDERLESS
static final int[] TOP_RIGHT_CORNER_BORDERLESS
static final int[] BOTTOM_LEFT_CORNER_BORDERLESS
static final int[] BOTTOM_RIGHT_CORNER_BORDERLESS
static final int[] SIMPLE_TOP_LEFT_CORNER_BORDERLESS
static final int[] SIMPLE_TOP_RIGHT_CORNER_BORDERLESS
static final int[] SIMPLE_BOTTOM_LEFT_CORNER_BORDERLESS
static final int[] SIMPLE_BOTTOM_RIGHT_CORNER_BORDERLESS
static final RGB CLOSE_FILL
static final int BUTTON_SIZE
static final int BUTTON_TRIM
static final int BUTTON_BORDER
static final int BUTTON_FILL
static final int BORDER1_COLOR
static final int ITEM_TOP_MARGIN
static final int ITEM_BOTTOM_MARGIN
static final int ITEM_LEFT_MARGIN
static final int ITEM_RIGHT_MARGIN
static final int INTERNAL_SPACING
static final int FLAGS
static final java.lang.String ELLIPSIS
public static final int PART_BODY
public static final int PART_HEADER
public static final int PART_BORDER
public static final int PART_BACKGROUND
public static final int PART_MAX_BUTTON
public static final int PART_MIN_BUTTON
public static final int PART_CHEVRON_BUTTON
public static final int PART_CLOSE_BUTTON
public static final int MINIMUM_SIZE
protected CTabFolderRenderer(CTabFolder parent)
parent
- CTabFolderjava.lang.IllegalArgumentException
- Widget.getStyle()
protected Point computeSize(int part, int state, GC gc, int wHint, int hHint)
The preferred size of a part is the size that it would
best be displayed at. The width hint and height hint arguments
allow the caller to ask a control questions such as "Given a particular
width, how high does the part need to be to show all of the contents?"
To indicate that the caller does not wish to constrain a particular
dimension, the constant SWT.DEFAULT
is passed for the hint.
The part
value indicated what component the preferred size is
to be calculated for. Valid values are any of the part constants:
The state
parameter may be one of the following:
part
- a part constantstate
- current stategc
- the gc to use for measuringwHint
- the width hint (can be SWT.DEFAULT
)hHint
- the height hint (can be SWT.DEFAULT
)protected Rectangle computeTrim(int part, int state, int x, int y, int width, int height)
In other words, it returns a rectangle such that, if the part's bounds were set to that rectangle, the area of the part which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent).
part
- one of the part constantsstate
- the state of the partx
- the desired x coordinate of the client areay
- the desired y coordinate of the client areawidth
- the desired width of the client areaheight
- the desired height of the client areavalid part and state values
void createAntialiasColors()
void createSelectionHighlightGradientColors(Color start)
protected void dispose()
void disposeAntialiasColors()
void disposeSelectionHighlightGradientColors()
protected void draw(int part, int state, Rectangle bounds, GC gc)
part
of the CTabFolder using the provided bounds
and GC
.
The valid CTabFolder part
constants are:
The state
parameter may be a combination of:
part
- part to drawstate
- state of the partbounds
- the bounds of the partgc
- the gc to draw the part onvoid drawBackground(GC gc, int[] shape, boolean selected)
void drawBackground(GC gc, int[] shape, int x, int y, int width, int height, Color defaultBackground, Image image, Color[] colors, int[] percents, boolean vertical)
void drawBorder(GC gc, int[] shape)
Color getFillColor()
boolean isSelectionHighlightColorsCacheHit(Color start)
void setSelectionHighlightGradientColor(Color start)
java.lang.String shortenText(GC gc, java.lang.String text, int width)
java.lang.String shortenText(GC gc, java.lang.String text, int width, java.lang.String ellipses)
void updateCurves()
boolean useEllipses()