public class TextPainter extends AbstractTextPainter
calculateByTextHeight, calculateByTextLength, DOT, EMPTY, LINE_SEPARATOR, NEW_LINE_REGEX, paintBg, paintFg, spacing, wrapText| Constructor and Description |
|---|
TextPainter() |
TextPainter(boolean wrapText,
boolean paintBg) |
TextPainter(boolean wrapText,
boolean paintBg,
boolean calculate) |
TextPainter(boolean wrapText,
boolean paintBg,
boolean calculateByTextLength,
boolean calculateByTextHeight) |
TextPainter(boolean wrapText,
boolean paintBg,
int spacing) |
TextPainter(boolean wrapText,
boolean paintBg,
int spacing,
boolean calculate) |
TextPainter(boolean wrapText,
boolean paintBg,
int spacing,
boolean calculateByTextLength,
boolean calculateByTextHeight) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculatePadding(ILayerCell cell,
int availableLength)
This method is used to determine the padding from the cell to the available length.
|
int |
getPreferredHeight(ILayerCell cell,
org.eclipse.swt.graphics.GC gc,
IConfigRegistry configRegistry)
Get the preferred height of the cell when rendered by this painter.
|
int |
getPreferredWidth(ILayerCell cell,
org.eclipse.swt.graphics.GC gc,
IConfigRegistry configRegistry)
Get the preferred width of the cell when rendered by this painter.
|
void |
paintCell(ILayerCell cell,
org.eclipse.swt.graphics.GC gc,
org.eclipse.swt.graphics.Rectangle rectangle,
IConfigRegistry configRegistry) |
protected boolean |
performRowResize(int contentHeight,
org.eclipse.swt.graphics.Rectangle rectangle)
Checks if a row resize needs to be triggered.
|
protected void |
setNewMinLength(ILayerCell cell,
int contentWidth)
This method gets only called if automatic length calculation is enabled.
|
convertDataType, getLengthFromCache, getNumberOfNewLines, getTextToDisplay, renderStrikethrough, renderUnderlined, setStrikethrough, setUnderline, setupGCFromConfiggetBackgroundColourgetCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainterpublic TextPainter()
public TextPainter(boolean wrapText,
boolean paintBg)
wrapText - split text over multiple linespaintBg - skips painting the background if is FALSEpublic TextPainter(boolean wrapText,
boolean paintBg,
int spacing)
wrapText - split text over multiple linespaintBg - skips painting the background if is FALSEspacing - The space between text and cell borderpublic TextPainter(boolean wrapText,
boolean paintBg,
boolean calculate)
wrapText - split text over multiple linespaintBg - skips painting the background if is FALSEcalculate - tells the text painter to calculate the cell borders regarding the contentpublic TextPainter(boolean wrapText,
boolean paintBg,
boolean calculateByTextLength,
boolean calculateByTextHeight)
wrapText - split text over multiple linespaintBg - skips painting the background if is FALSEcalculateByTextLength - tells the text painter to calculate the cell border by containing
text length. For horizontal text rendering, this means the width of the cell is calculated
by content, for vertical text rendering the height is calculatedcalculateByTextHeight - tells the text painter to calculate the cell border by containing
text height. For horizontal text rendering, this means the height of the cell is calculated
by content, for vertical text rendering the width is calculatedpublic TextPainter(boolean wrapText,
boolean paintBg,
int spacing,
boolean calculate)
wrapText - split text over multiple linespaintBg - skips painting the background if is FALSEspacing - The space between text and cell bordercalculate - tells the text painter to calculate the cell borders regarding the contentpublic TextPainter(boolean wrapText,
boolean paintBg,
int spacing,
boolean calculateByTextLength,
boolean calculateByTextHeight)
wrapText - split text over multiple linespaintBg - skips painting the background if is FALSEspacing - The space between text and cell bordercalculateByTextLength - tells the text painter to calculate the cell border by containing
text length. For horizontal text rendering, this means the width of the cell is calculated
by content, for vertical text rendering the height is calculatedcalculateByTextHeight - tells the text painter to calculate the cell border by containing
text height. For horizontal text rendering, this means the height of the cell is calculated
by content, for vertical text rendering the width is calculatedpublic int getPreferredWidth(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
ICellPaintergetPreferredWidth in interface ICellPaintergetPreferredWidth in class CellPainterWrapperpublic int getPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
ICellPaintergetPreferredHeight in interface ICellPaintergetPreferredHeight in class CellPainterWrapperpublic void paintCell(ILayerCell cell, org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle, IConfigRegistry configRegistry)
paintCell in interface ICellPainterpaintCell in class BackgroundPainterprotected void setNewMinLength(ILayerCell cell, int contentWidth)
AbstractTextPaintersetNewMinLength in class AbstractTextPaintercell - the current cell that is paintedcontentWidth - the length of the contentprotected int calculatePadding(ILayerCell cell, int availableLength)
AbstractTextPaintercalculatePadding in class AbstractTextPaintercell - the current cell which should be resizedavailableLength - the length value that is available and was given into paintCell()
as Rectangle argumentprotected boolean performRowResize(int contentHeight,
org.eclipse.swt.graphics.Rectangle rectangle)
contentHeight - The necessary height to show the content completelyrectangle - The available rectangle to render totrue if a row resize needs to be performed, false if notCopyright © 2013. All Rights Reserved.