Class CTabFolderRenderer
CTabFolder. This class can be subclassed in order to
customize the look of a CTabFolder.- Since:
- 3.6
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int(package private) static final int(package private) static final int(package private) static final intprivate static final intprivate static final Stringprivate static final floatprivate Font(package private) static final RGB(package private) int[](package private) int(package private) int(package private) static final String(package private) Color(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) static final int(package private) Color(package private) intstatic final intprotected CTabFolderstatic final intPart constant indicating the background of the tab folder.static final intPart constant indicating the body of the tab folder.static final intPart constant indicating the border of the tab folder.static final intPart constant indicating the chevron button of the tab folder.static final intPart constant indicating the close button of a tab item.static final intPart constant indicating the tab header of the folder (value is -2).static final intPart constant indicating the maximize button of the tab folder.static final intPart constant indicating the minimize button of the tab folder.(package private) Color(package private) Color(package private) Color(package private) Color[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) Color(package private) static final int(package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) static final int[](package private) int[](package private) int[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCTabFolderRenderer(CTabFolder parent) Constructs a new instance of this class given its parent. -
Method Summary
Modifier and TypeMethodDescription(package private) voidprotected PointcomputeSize(int part, int state, GC gc, int wHint, int hHint) Returns the preferred size of a part.protected RectanglecomputeTrim(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(package private) voidprotected voiddispose()Dispose of any operating system resources associated with the renderer.(package private) void(package private) voidprotected voidDraw a specifiedpartof the CTabFolder using the providedboundsandGC.(package private) voiddrawBackground(GC gc, int[] shape, boolean selected) (package private) voiddrawBackground(GC gc, int[] shape, int x, int y, int width, int height, Color defaultBackground, Image image, Color[] colors, int[] percents, boolean vertical) (package private) voiddrawBackground(GC gc, Rectangle bounds, int state) (package private) void(package private) voiddrawBorder(GC gc, int[] shape) (package private) voiddrawChevron(GC gc, Rectangle chevronRect, int chevronImageState) private voiddrawChevronContent(GC gc, int x, int y, String chevronString) (package private) voidprivate voiddrawCloseLines(GC gc, int x, int y, int lineLength, boolean hot) (package private) voiddrawHighlight(GC gc, Rectangle bounds, int state, int rightEdge) (package private) voiddrawLeftUnselectedBorder(GC gc, Rectangle bounds, int state) (package private) voiddrawMaximize(GC gc, Rectangle maxRect, int maxImageState) (package private) voiddrawMinimize(GC gc, Rectangle minRect, int minImageState) (package private) voiddrawRightUnselectedBorder(GC gc, Rectangle bounds, int state) private voiddrawRoundRectangle(GC gc, Rectangle chevronRect) (package private) voiddrawSelected(int itemIndex, GC gc, Rectangle bounds, int state) (package private) voiddrawTabArea(GC gc, Rectangle bounds, int state) (package private) voiddrawUnselected(int index, GC gc, Rectangle bounds, int state) (package private) voidfillRegion(GC gc, Region region) private FontgetChevronFont(Display display) (package private) Colorprivate intgetLargeTextPadding(CTabItem item) Returns padding for the text of a tab item when showing images is disabled for the tab folder.private intgetLeftTextMargin(CTabItem item) (package private) boolean(package private) void(package private) void(package private) StringshortenText(GC gc, String text, int width) (package private) StringshortenText(GC gc, String text, int width, String ellipses) private booleanshouldApplyLargeTextPadding(CTabFolder tabFolder) private booleanshouldDrawCloseIcon(CTabItem item) (package private) void(package private) boolean
-
Field Details
-
parent
-
curve
int[] curve -
topCurveHighlightStart
int[] topCurveHighlightStart -
topCurveHighlightEnd
int[] topCurveHighlightEnd -
curveWidth
int curveWidth -
curveIndent
int curveIndent -
lastTabHeight
int lastTabHeight -
fillColor
Color fillColor -
selectionHighlightGradientBegin
Color selectionHighlightGradientBegin -
selectionHighlightGradientColorsCache
Color[] selectionHighlightGradientColorsCache -
selectedOuterColor
Color selectedOuterColor -
selectedInnerColor
Color selectedInnerColor -
tabAreaColor
Color tabAreaColor -
lastBorderColor
Color lastBorderColor -
chevronFont
-
TOP_LEFT_CORNER_HILITE
static final int[] TOP_LEFT_CORNER_HILITE -
TOP_LEFT_CORNER
static final int[] TOP_LEFT_CORNER -
TOP_RIGHT_CORNER
static final int[] TOP_RIGHT_CORNER -
BOTTOM_LEFT_CORNER
static final int[] BOTTOM_LEFT_CORNER -
BOTTOM_RIGHT_CORNER
static final int[] BOTTOM_RIGHT_CORNER -
SIMPLE_TOP_LEFT_CORNER
static final int[] SIMPLE_TOP_LEFT_CORNER -
SIMPLE_TOP_RIGHT_CORNER
static final int[] SIMPLE_TOP_RIGHT_CORNER -
SIMPLE_BOTTOM_LEFT_CORNER
static final int[] SIMPLE_BOTTOM_LEFT_CORNER -
SIMPLE_BOTTOM_RIGHT_CORNER
static final int[] SIMPLE_BOTTOM_RIGHT_CORNER -
SIMPLE_UNSELECTED_INNER_CORNER
static final int[] SIMPLE_UNSELECTED_INNER_CORNER -
TOP_LEFT_CORNER_BORDERLESS
static final int[] TOP_LEFT_CORNER_BORDERLESS -
TOP_RIGHT_CORNER_BORDERLESS
static final int[] TOP_RIGHT_CORNER_BORDERLESS -
BOTTOM_LEFT_CORNER_BORDERLESS
static final int[] BOTTOM_LEFT_CORNER_BORDERLESS -
BOTTOM_RIGHT_CORNER_BORDERLESS
static final int[] BOTTOM_RIGHT_CORNER_BORDERLESS -
SIMPLE_TOP_LEFT_CORNER_BORDERLESS
static final int[] SIMPLE_TOP_LEFT_CORNER_BORDERLESS -
SIMPLE_TOP_RIGHT_CORNER_BORDERLESS
static final int[] SIMPLE_TOP_RIGHT_CORNER_BORDERLESS -
SIMPLE_BOTTOM_LEFT_CORNER_BORDERLESS
static final int[] SIMPLE_BOTTOM_LEFT_CORNER_BORDERLESS -
SIMPLE_BOTTOM_RIGHT_CORNER_BORDERLESS
static final int[] SIMPLE_BOTTOM_RIGHT_CORNER_BORDERLESS -
CLOSE_FILL
-
BUTTON_SIZE
static final int BUTTON_SIZE- See Also:
-
BUTTON_TRIM
static final int BUTTON_TRIM- See Also:
-
BUTTON_BORDER
static final int BUTTON_BORDER- See Also:
-
BUTTON_FILL
static final int BUTTON_FILL- See Also:
-
BORDER1_COLOR
static final int BORDER1_COLOR- See Also:
-
ITEM_TOP_MARGIN
static final int ITEM_TOP_MARGIN- See Also:
-
ITEM_BOTTOM_MARGIN
static final int ITEM_BOTTOM_MARGIN- See Also:
-
ITEM_LEFT_MARGIN
static final int ITEM_LEFT_MARGIN- See Also:
-
ITEM_RIGHT_MARGIN
static final int ITEM_RIGHT_MARGIN- See Also:
-
INTERNAL_SPACING
static final int INTERNAL_SPACING- See Also:
-
TABS_WITHOUT_ICONS_PADDING
static final int TABS_WITHOUT_ICONS_PADDING- See Also:
-
FLAGS
static final int FLAGS- See Also:
-
ELLIPSIS
- See Also:
-
CHEVRON_ELLIPSIS
- See Also:
-
CHEVRON_FONT_SIZE_FACTOR
private static final float CHEVRON_FONT_SIZE_FACTOR- See Also:
-
CHEVRON_BOTTOM_INDENT
private static final int CHEVRON_BOTTOM_INDENT- See Also:
-
PART_BODY
public static final int PART_BODYPart constant indicating the body of the tab folder. The body is the underlying container for all of the tab folder and all other parts are drawn on top of it. (value is -1).- See Also:
-
PART_HEADER
public static final int PART_HEADERPart constant indicating the tab header of the folder (value is -2). The header is drawn on top of the body and provides an area for the tabs and other tab folder buttons to be rendered.- See Also:
-
PART_BORDER
public static final int PART_BORDERPart constant indicating the border of the tab folder. (value is -3). The border is drawn around the body and is part of the body trim.- See Also:
-
PART_BACKGROUND
public static final int PART_BACKGROUNDPart constant indicating the background of the tab folder. (value is -4).- See Also:
-
PART_MAX_BUTTON
public static final int PART_MAX_BUTTONPart constant indicating the maximize button of the tab folder. (value is -5).- See Also:
-
PART_MIN_BUTTON
public static final int PART_MIN_BUTTONPart constant indicating the minimize button of the tab folder. (value is -6).- See Also:
-
PART_CHEVRON_BUTTON
public static final int PART_CHEVRON_BUTTONPart constant indicating the chevron button of the tab folder. (value is -7).- See Also:
-
PART_CLOSE_BUTTON
public static final int PART_CLOSE_BUTTONPart constant indicating the close button of a tab item. (value is -8).- See Also:
-
MINIMUM_SIZE
public static final int MINIMUM_SIZE- See Also:
-
-
Constructor Details
-
CTabFolderRenderer
Constructs a new instance of this class given its parent.- Parameters:
parent- CTabFolder- Throws:
IllegalArgumentException-- ERROR_INVALID_ARGUMENT - if the parent is disposed
- See Also:
-
-
Method Details
-
antialias
-
computeSize
Returns the preferred size of a part.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.DEFAULTis passed for the hint.The
partvalue indicated what component the preferred size is to be calculated for. Valid values are any of the part constants:- PART_BODY
- PART_HEADER
- PART_BORDER
- PART_BACKGROUND
- PART_MAX_BUTTON
- PART_MIN_BUTTON
- PART_CHEVRON_BUTTON
- PART_CLOSE_BUTTON
- A positive integer which is the index of an item in the CTabFolder.
The
stateparameter may be one of the following:- SWT.NONE
- SWT.SELECTED - whether the part is selected
- Parameters:
part- a part constantstate- current stategc- the gc to use for measuringwHint- the width hint (can beSWT.DEFAULT)hHint- the height hint (can beSWT.DEFAULT)- Returns:
- the preferred size of the part
- Since:
- 3.6
-
shouldDrawCloseIcon
-
getLargeTextPadding
Returns padding for the text of a tab item when showing images is disabled for the tab folder. -
shouldApplyLargeTextPadding
-
computeTrim
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.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).
- Parameters:
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 area- Returns:
- the required bounds to produce the given client area
- Since:
- 3.6
- See Also:
-
createAntialiasColors
void createAntialiasColors() -
createSelectionHighlightGradientColors
-
dispose
protected void dispose()Dispose of any operating system resources associated with the renderer. Called by the CTabFolder parent upon receiving the dispose event or when changing the renderer.- Since:
- 3.6
-
disposeAntialiasColors
void disposeAntialiasColors() -
disposeSelectionHighlightGradientColors
void disposeSelectionHighlightGradientColors() -
draw
Draw a specifiedpartof the CTabFolder using the providedboundsandGC.The valid CTabFolder
partconstants are:- PART_BODY - the entire body of the CTabFolder
- PART_HEADER - the upper tab area of the CTabFolder
- PART_BORDER - the border of the CTabFolder
- PART_BACKGROUND - the background of the CTabFolder
- PART_MAX_BUTTON
- PART_MIN_BUTTON
- PART_CHEVRON_BUTTON
- PART_CLOSE_BUTTON
- A positive integer which is the index of an item in the CTabFolder.
The
stateparameter may be a combination of:- SWT.BACKGROUND - whether the background should be drawn
- SWT.FOREGROUND - whether the foreground should be drawn
- SWT.SELECTED - whether the part is selected
- SWT.HOT - whether the part is hot (i.e. mouse is over the part)
- Parameters:
part- part to drawstate- state of the partbounds- the bounds of the partgc- the gc to draw the part on- Since:
- 3.6
-
drawBackground
-
drawBackground
-
drawBackground
-
drawBorder
-
drawBody
-
drawClose
-
drawCloseLines
-
drawChevron
-
drawRoundRectangle
-
drawChevronContent
-
drawHighlight
-
drawLeftUnselectedBorder
-
drawMaximize
-
drawMinimize
-
drawRightUnselectedBorder
-
drawSelected
-
getLeftTextMargin
-
drawTabArea
-
drawUnselected
-
fillRegion
-
getFillColor
Color getFillColor() -
getChevronFont
-
isSelectionHighlightColorsCacheHit
-
resetChevronFont
void resetChevronFont() -
setSelectionHighlightGradientColor
-
shortenText
-
shortenText
-
updateCurves
void updateCurves() -
useEllipses
boolean useEllipses()
-