public class VerticalTextImagePainter extends AbstractTextPainter
Note:
This is the old implementation that uses GraphicsUtils to create the
counter-clockwise rotated vertical text. Internally it will render the text
horizontal to a temporary image and rotate the image afterwards.
This implementation is kept in case the new VerticalTextPainter that
uses Transform for rotations is not working as intended. A typical
case for this could be wrong size calculations dependent on several fonts.
calculateByTextHeight, calculateByTextLength, DOT, EMPTY, LINE_SEPARATOR, NEW_LINE_REGEX, paintBg, paintFg, spacing, wrapText| Constructor and Description |
|---|
VerticalTextImagePainter() |
VerticalTextImagePainter(boolean wrapText,
boolean paintBg) |
VerticalTextImagePainter(boolean wrapText,
boolean paintBg,
boolean calculate) |
VerticalTextImagePainter(boolean wrapText,
boolean paintBg,
boolean calculateByTextLength,
boolean calculateByTextHeight) |
VerticalTextImagePainter(boolean wrapText,
boolean paintBg,
int spacing) |
VerticalTextImagePainter(boolean wrapText,
boolean paintBg,
int spacing,
boolean calculate) |
VerticalTextImagePainter(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 void |
setNewMinLength(ILayerCell cell,
int contentHeight)
This method gets only called if automatic length calculation is enabled.
|
convertDataType, getLengthFromCache, getNumberOfNewLines, getTextToDisplay, isCalculateByTextHeight, isCalculateByTextLength, isTrimText, isWrapText, paintDecoration, renderStrikethrough, renderUnderlined, resetGC, setCalculateByTextHeight, setCalculateByTextLength, setStrikethrough, setTrimText, setUnderline, setupGCFromConfig, setWrapTextgetBackgroundColourgetCellPainterAt, getWrappedPainter, getWrappedPainterBounds, setWrappedPainterpublic VerticalTextImagePainter()
public VerticalTextImagePainter(boolean wrapText,
boolean paintBg)
wrapText - split text over multiple linespaintBg - skips painting the background if is FALSEpublic VerticalTextImagePainter(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 VerticalTextImagePainter(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 VerticalTextImagePainter(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 VerticalTextImagePainter(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 VerticalTextImagePainter(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 CellPainterWrappercell - The cell for which the preferred width is requested.gc - The GC that is used for rendering.configRegistry - The IConfigRegistry that contains the configuration used for
rendering.public int getPreferredHeight(ILayerCell cell, org.eclipse.swt.graphics.GC gc, IConfigRegistry configRegistry)
ICellPaintergetPreferredHeight in interface ICellPaintergetPreferredHeight in class CellPainterWrappercell - The cell for which the preferred height is requested.gc - The GC that is used for rendering.configRegistry - The IConfigRegistry that contains the configuration used for
rendering.public 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 contentHeight)
AbstractTextPaintersetNewMinLength in class AbstractTextPaintercell - the current cell that is paintedcontentHeight - 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 argumentCopyright © 2016. All rights reserved.