@API(type=EXTENDABLE, src=PUBLIC) public class ColorHighlightPainter extends java.lang.Object implements TextForegroundHighlighterPainter
Modifier and Type | Class and Description |
---|---|
static class |
ColorHighlightPainter.TextDecoration
The decoration added to text.
|
Constructor and Description |
---|
ColorHighlightPainter()
Default constructor.
|
ColorHighlightPainter(Color color,
int height,
int totalHeight)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Color |
getBgColor() |
Color |
getColor() |
Color |
getTextForegroundColor()
Get the text foreground color.
|
void |
paint(HighlightPainterInfo pi)
Renders the highlight.
|
void |
setBgColor(Color bgColor) |
void |
setBgColor(Color bgColor,
boolean useLineBoxHeight) |
void |
setColor(Color c)
Set the color used for decoration (strike out or underline)
|
void |
setStrikeOut(boolean strikeOut)
Deprecated.
Use
setTextDecoration(TextDecoration) instead. |
void |
setTextDecoration(ColorHighlightPainter.TextDecoration decoration)
Set the text decoration.
|
void |
setTextDecorationStroke(int stroke)
Set the text decoration stroke.
|
void |
setTextForegroundColor(Color foregroundColor)
Set the text foreground color.
|
boolean |
useBaseLineForUnderline() |
public ColorHighlightPainter()
public ColorHighlightPainter(Color color, int height, int totalHeight)
color
- The color to use for highlight.height
- The height of the highlight line.
This may be smaller than the total height. If it is, the extra space will remain under the line.totalHeight
- The height of the highlight.public void paint(HighlightPainterInfo pi)
HighlightPainter
paint
in interface HighlightPainter
pi
- Information used by highlightHighlightPainter.paint(ro.sync.ecss.extensions.api.highlights.HighlightPainterInfo)
public void setColor(Color c)
c
- The decoration color.public void setTextDecoration(ColorHighlightPainter.TextDecoration decoration)
ColorHighlightPainter.TextDecoration.NONE
no line will be drawn.decoration
- The new text decoration.public void setBgColor(Color bgColor)
bgColor
- The background color to set.public void setBgColor(Color bgColor, boolean useLineBoxHeight)
bgColor
- The background color to set.useLineBoxHeight
- true
to use the parent line height
for drawing the background color.public boolean useBaseLineForUnderline()
public void setTextDecorationStroke(int stroke)
stroke
- The new Stroke type. Constants are defined in Graphics
.@Deprecated public void setStrikeOut(boolean strikeOut)
setTextDecoration(TextDecoration)
instead.strikeOut
- Set this highlight as strike out.public Color getBgColor()
public Color getColor()
public void setTextForegroundColor(Color foregroundColor)
foregroundColor
- The foreground color to set.public Color getTextForegroundColor()
getTextForegroundColor
in interface TextForegroundHighlighterPainter
TextForegroundHighlighterPainter.getTextForegroundColor()
© Copyright SyncRO Soft SRL 2002 - 2014. All rights reserved.